#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) |
Definition in file singleton.c.
#define PREPROCESSOR "singleton" |
Definition at line 19 of file singleton.c.
static PetscErrorCode back_singleton | ( | char * | singleton_type, | |
PetscTruth | overwrite, | |||
void * | gctx, | |||
void * | ctx, | |||
NumericalProblem | compactproblem, | |||
NumericalProblem | fullproblem, | |||
NumericalSolution | compactvector, | |||
NumericalSolution | fullvector | |||
) | [static] |
Definition at line 174 of file singleton.c.
References CHKERRQ(), DeleteLinearSystem(), singleton_struct::extractor, ierr, LinearSolutionCopyStats(), LinearSolutionGetVector(), LinearSolutionSetVector(), LinearSystemGetParts(), and singleton_struct::t.
Referenced by DeclareSingletonPreprocessor().
PetscErrorCode DeclareSingletonPreprocessor | ( | void | ) |
Definition at line 311 of file singleton.c.
References back_singleton(), CHKERRQ(), DeclarePreprocessor(), eliminate_singletons(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_singleton_choices(), singleton_specific_unset(), and specific_singleton_choices().
Referenced by main().
static PetscErrorCode eliminate_singletons | ( | char * | type, | |
int | nopt, | |||
PetscTruth | overwrite, | |||
NumericalProblem | inproblem, | |||
NumericalProblem * | outproblem, | |||
void * | gctx, | |||
void ** | ctx, | |||
PetscTruth * | success | |||
) | [static] |
Definition at line 24 of file singleton.c.
References CHKERRQ(), singleton_struct::extractor, ierr, LinearSystemDuplicatePointers(), LinearSystemGetContext(), LinearSystemGetParts(), LinearSystemSetContext(), LinearSystemSetParts(), singleton_struct::n, SysProRetrieveQuantity(), and singleton_struct::t.
Referenced by DeclareSingletonPreprocessor().
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().