singleton.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include "petsc.h"
#include "syspro.h"
#include "sysprotransform.h"
#include "sysprolinear.h"
#include "linear_impl.h"

Go to the source code of this file.

Data Structures

struct  singleton_struct

Defines

#define PREPROCESSOR   "singleton"

Functions

static PetscErrorCode eliminate_singletons (char *type, int nopt, PetscTruth overwrite, NumericalProblem inproblem, NumericalProblem *outproblem, void *gctx, void **ctx, PetscTruth *success)
static PetscErrorCode back_singleton (char *singleton_type, PetscTruth overwrite, void *gctx, void *ctx, NumericalProblem compactproblem, NumericalProblem fullproblem, NumericalSolution compactvector, NumericalSolution fullvector)
static PetscErrorCode setup_singleton_choices ()
static PetscErrorCode specific_singleton_choices (NumericalProblem theproblem, SalsaTransform singleton)
static PetscErrorCode singleton_specific_unset (NumericalProblem theproblem)
PetscErrorCode DeclareSingletonPreprocessor (void)


Detailed Description

Definition in file singleton.c.


Define Documentation

#define PREPROCESSOR   "singleton"

Definition at line 19 of file singleton.c.


Function Documentation

static PetscErrorCode back_singleton ( char *  singleton_type,
PetscTruth  overwrite,
void *  gctx,
void *  ctx,
NumericalProblem  compactproblem,
NumericalProblem  fullproblem,
NumericalSolution  compactvector,
NumericalSolution  fullvector 
) [static]

PetscErrorCode DeclareSingletonPreprocessor ( void   ) 

static PetscErrorCode eliminate_singletons ( char *  type,
int  nopt,
PetscTruth  overwrite,
NumericalProblem  inproblem,
NumericalProblem outproblem,
void *  gctx,
void **  ctx,
PetscTruth *  success 
) [static]

static PetscErrorCode setup_singleton_choices (  )  [static]

This routine is only called when the singleton preprocessor is created by DeclarePreprocessor() inside DeclareSingletonPreprocessor()

Definition at line 234 of file singleton.c.

References CHKERRQ(), ierr, NewTransformObject(), PREPROCESSOR, TransformGetByName(), and TransformObjectSetExplanation().

Referenced by DeclareSingletonPreprocessor().

static PetscErrorCode singleton_specific_unset ( NumericalProblem  theproblem  )  [static]

Definition at line 298 of file singleton.c.

References CHKERRQ(), ierr, and SysProRemoveQuantity().

Referenced by DeclareSingletonPreprocessor().

static PetscErrorCode specific_singleton_choices ( NumericalProblem  theproblem,
SalsaTransform  singleton 
) [static]

This is the 'specific setup' phase of the singleton preprocessor. See Usage modes for details.

It disables either the identity or the elimination routine, to leave only the one applicable to this particular system.

Maybe if we'd ever want to prove how effective singleton elimination is, we could leave identity in place for systems with singletons.

Definition at line 265 of file singleton.c.

References CHKERRQ(), ierr, PREPROCESSOR, SysProComputeQuantity(), TransformObjectGetByName(), and TransformObjectMark().

Referenced by DeclareSingletonPreprocessor().


Generated on Sun Oct 4 04:03:05 2009 for System Preprocessors by  doxygen 1.5.9