System Preprocessors
Defines | Functions
pc.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "syspro.h"
#include "syspro_impl.h"
#include "sysprolinear.h"
#include "sysprotransform.h"
#include "linear_impl.h"
#include "linpc.h"
#include "linksp.h"
#include "petsc.h"
#include "petscmat.h"
#include "petscpc.h"
#include "petscksp.h"
#include "anamod.h"

Go to the source code of this file.

Defines

#define PREPROCESSOR   "pc"

Functions

static PetscErrorCode setup_pc_choices ()
static PetscErrorCode disable_pcs (NumericalProblem theproblem, SalsaTransform pc)
static PetscErrorCode pcoptionshandling ()
static PetscErrorCode create_solver (NumericalProblem prob, void **ctx)
static PetscErrorCode destroy_solver (void *ctx)
static PetscErrorCode setup_pc (const char *type, int pcv, PetscBool overwrite, NumericalProblem inproblem, NumericalProblem *outproblem, void *gctx, void **ctx, PetscBool *success)
static PetscErrorCode unset_pc (const char *type, PetscBool overwrite, void *gctx, void *ctx, NumericalProblem thisproblem, NumericalProblem upproblem, NumericalSolution old, NumericalSolution nnew)
PetscErrorCode DeclarePCPreprocessor (void)

Define Documentation

#define PREPROCESSOR   "pc"

Definition at line 23 of file pc.c.

Referenced by DeclarePCPreprocessor(), pcoptionshandling(), and setup_pc_choices().


Function Documentation

static PetscErrorCode create_solver ( NumericalProblem  prob,
void **  ctx 
) [static]

Create a solver and install a monitor that dynamically increases the maximum number of iterations.

Definition at line 274 of file pc.c.

References CHKERRQ(), NumericalProblem_::comm, and ierr.

Referenced by DeclarePCPreprocessor().

PetscErrorCode DeclarePCPreprocessor ( void  )
static PetscErrorCode destroy_solver ( void *  ctx) [static]

Definition at line 294 of file pc.c.

References CHKERRQ(), and ierr.

Referenced by DeclarePCPreprocessor().

static PetscErrorCode disable_pcs ( NumericalProblem  theproblem,
SalsaTransform  pc 
) [static]
static PetscErrorCode pcoptionshandling ( ) [static]

Disable certain preconditioners based on commandline options.

At the moment this is only disabling of direct solvers if the user asks for iterative only.

Definition at line 240 of file pc.c.

References CHKERRQ(), ierr, PREPROCESSOR, RetrieveAllPreprocessorValues(), TransformObjectGetByName(), TransformObjectGetIntAnnotation(), and TransformObjectMark().

Referenced by DeclarePCPreprocessor().

static PetscErrorCode setup_pc ( const char *  type,
int  pcv,
PetscBool  overwrite,
NumericalProblem  inproblem,
NumericalProblem outproblem,
void *  gctx,
void **  ctx,
PetscBool *  success 
) [static]
static PetscErrorCode setup_pc_choices ( ) [static]
static PetscErrorCode unset_pc ( const char *  type,
PetscBool  overwrite,
void *  gctx,
void *  ctx,
NumericalProblem  thisproblem,
NumericalProblem  upproblem,
NumericalSolution  old,
NumericalSolution  nnew 
) [static]

Definition at line 369 of file pc.c.

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

Referenced by DeclarePCPreprocessor().