System Preprocessors
Defines | Functions
flipsign.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"
#include "anamod.h"

Go to the source code of this file.

Defines

#define PREPROCESSOR   "flipsign"

Functions

static PetscErrorCode flipsign (const char *type, int nopt, PetscBool overwrite, NumericalProblem inproblem, NumericalProblem *outproblem, void *gctx, void **ctx, PetscBool *success)
static PetscErrorCode back_flipsign (const char *flipsign_type, PetscBool overwrite, void *gctx, void *ctx, NumericalProblem nextproblem, NumericalProblem problem, NumericalSolution flipped, NumericalSolution straight)
static PetscErrorCode setup_flipsign_choices ()
static PetscErrorCode specific_flipsign_choices (NumericalProblem theproblem, SalsaTransform flipsign)
PetscErrorCode DeclareFlipsignPreprocessor (void)

Detailed Description

Definition in file flipsign.c.


Define Documentation

#define PREPROCESSOR   "flipsign"

Function Documentation

static PetscErrorCode back_flipsign ( const char *  flipsign_type,
PetscBool  overwrite,
void *  gctx,
void *  ctx,
NumericalProblem  nextproblem,
NumericalProblem  problem,
NumericalSolution  flipped,
NumericalSolution  straight 
) [static]

Definition at line 85 of file flipsign.c.

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

Referenced by DeclareFlipsignPreprocessor().

PetscErrorCode DeclareFlipsignPreprocessor ( void  )
static PetscErrorCode flipsign ( const char *  type,
int  nopt,
PetscBool  overwrite,
NumericalProblem  inproblem,
NumericalProblem outproblem,
void *  gctx,
void **  ctx,
PetscBool *  success 
) [static]
static PetscErrorCode setup_flipsign_choices ( ) [static]

This routine is only called when the flipsign preprocessor is created by DeclarePreprocessor() inside DeclareFlipsignPreprocessor()

Definition at line 114 of file flipsign.c.

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

Referenced by DeclareFlipsignPreprocessor().

static PetscErrorCode specific_flipsign_choices ( NumericalProblem  theproblem,
SalsaTransform  flipsign 
) [static]

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

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

Definition at line 143 of file flipsign.c.

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

Referenced by DeclareFlipsignPreprocessor().