System Preprocessors
Data Structures | Defines | Functions
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 (const char *type, int nopt, PetscBool overwrite, NumericalProblem inproblem, NumericalProblem *outproblem, void *gctx, void **ctx, PetscBool *success)
static PetscErrorCode back_singleton (const char *singleton_type, PetscBool 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"

Function Documentation

static PetscErrorCode back_singleton ( const char *  singleton_type,
PetscBool  overwrite,
void *  gctx,
void *  ctx,
NumericalProblem  compactproblem,
NumericalProblem  fullproblem,
NumericalSolution  compactvector,
NumericalSolution  fullvector 
) [static]
PetscErrorCode DeclareSingletonPreprocessor ( void  )
static PetscErrorCode eliminate_singletons ( const char *  type,
int  nopt,
PetscBool  overwrite,
NumericalProblem  inproblem,
NumericalProblem outproblem,
void *  gctx,
void **  ctx,
PetscBool *  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 227 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 291 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 258 of file singleton.c.

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

Referenced by DeclareSingletonPreprocessor().