System Preprocessors
|
Go to the source code of this file.
typedef struct Diagnostics_* Diagnostics |
Definition at line 11 of file sysprolinear.h.
typedef struct LinearSolution_* LinearSolution |
Definition at line 10 of file sysprolinear.h.
typedef struct LinearSystem_* LinearSystem |
Definition at line 9 of file sysprolinear.h.
PetscErrorCode CreateDefaultLinearSolution | ( | NumericalProblem | , |
NumericalSolution * | |||
) |
Definition at line 528 of file linear.c.
References CHKERRQ(), CreateLinearSolution(), ierr, LinearSolutionSetVector(), LinearSystemGetParts(), and SYSPROCHECKVALIDLINSYS.
PetscErrorCode CreateLinearSolution | ( | LinearSolution * | ) |
Definition at line 411 of file linear.c.
References CHKERRQ(), LinearSolution_::cookie, ierr, LINSOLCOOKIE, and LinearSolution_::statistics.
Referenced by CreateDefaultLinearSolution(), and LinearCreateNumericalSolution().
PetscErrorCode CreateLinearSystem | ( | MPI_Comm | comm, |
LinearSystem * | system | ||
) |
Allocate the structure for a linear system
Definition at line 74 of file linear.c.
References CHKERRQ(), LinearSystem_::cookie, ierr, LINSYSCOOKIE, and LinearSystem_::partsoriginal.
Referenced by LinearSystemDuplicate(), LinearSystemDuplicatePointers(), and main().
PetscErrorCode DeclareApproximationPreprocessor | ( | void | ) |
Definition at line 280 of file approximating.c.
References approximate_system(), CHKERRQ(), DeclarePreprocessor(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_approximation_choices(), specific_approximation_choices(), and unapproximate_system().
PetscErrorCode DeclareDistributionPreprocessor | ( | void | ) |
Definition at line 298 of file distribution.c.
References CHKERRQ(), DeclarePreprocessor(), distribute_system(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_distribution_choices(), specific_distribution_choices(), and undistribute_system().
PetscErrorCode DeclareDummyRowPreprocessor | ( | void | ) |
PetscErrorCode DeclareFlipsignPreprocessor | ( | void | ) |
Definition at line 168 of file flipsign.c.
References back_flipsign(), CHKERRQ(), DeclarePreprocessor(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_flipsign_choices(), and specific_flipsign_choices().
PetscErrorCode DeclareKSPPreprocessor | ( | void | ) |
Definition at line 368 of file ksp.c.
References CHKERRQ(), DeclarePreprocessor(), disable_ksps(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_ksp(), setup_ksp_choices(), unset_ksp(), and unset_ksps().
PetscErrorCode DeclarePCPreprocessor | ( | void | ) |
Definition at line 392 of file pc.c.
References CHKERRQ(), create_solver(), DeclarePreprocessor(), destroy_solver(), disable_pcs(), ierr, SystemPreprocessor_::optionshandling, pcoptionshandling(), PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_pc(), setup_pc_choices(), SystemPreprocessorGetByName(), and unset_pc().
PetscErrorCode DeclareScalingPreprocessor | ( | void | ) |
Definition at line 292 of file scaling.c.
References CHKERRQ(), DeclarePreprocessor(), DeclarePreprocessorIntelligentChoice(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), scale_system(), set_intelligent_scaling(), setup_scaling_choices(), specific_scaling_choices(), and unscale_system().
Referenced by main().
PetscErrorCode DeclareSingletonPreprocessor | ( | void | ) |
Definition at line 304 of file singleton.c.
References back_singleton(), CHKERRQ(), DeclarePreprocessor(), eliminate_singletons(), ierr, PREPROCESSOR, PreprocessorSetPreservedCategories(), setup_singleton_choices(), singleton_specific_unset(), and specific_singleton_choices().
PetscErrorCode delete_diagnostics | ( | Diagnostics | ) |
PetscErrorCode LinearCopyNumericalSolution | ( | NumericalSolution | old, |
NumericalSolution | nnew | ||
) |
This routine is essentially LinearSolutionCopy(), except that it does casts of the arguments so that it can be used as the solutioncopy
member of SysProDeclareFunctions()
Definition at line 515 of file linear.c.
References CHKERRQ(), ierr, and LinearSolutionCopy().
PetscErrorCode LinearCreateNumericalSolution | ( | NumericalProblem | prob, |
NumericalSolution * | sol | ||
) |
Shell routine around CreateLinearSolution() to save you some type casting.
If the first argument is not NULL, its matrix is extracted and used to create the vector of the solution object.
Definition at line 432 of file linear.c.
References CHKERRQ(), CreateLinearSolution(), ierr, LinearSolutionSetVector(), and LinearSystemGetParts().
Referenced by main(), and solvelinear().
PetscErrorCode LinearDeleteNumericalProblem | ( | NumericalProblem | sys | ) |
This is like LinearSystemDelete(), except that the argument has been cast so that this routine can be used as the problemdelete
argument of SysProDeclareFunctions().
Definition at line 122 of file linear.c.
References CHKERRQ(), ierr, and LinearSystemDelete().
Referenced by main().
PetscErrorCode LinearDeleteNumericalSolution | ( | NumericalSolution | sol | ) |
This is like LinearSolutionDelete(), except that the argument has been cast so that this routine can be used as the solutiondelete
argument of SysProDeclareFunctions().
Definition at line 477 of file linear.c.
References CHKERRQ(), ierr, and LinearSolutionDelete().
Referenced by main().
PetscErrorCode LinearDeleteNumericalSolutionContext | ( | NumericalSolution | ) |
Definition at line 650 of file linear.c.
References LinearSolution_::ctx, and SYSPROCHECKVALIDLINSOL.
PetscErrorCode LinearSolutionAddToPreprocessTime | ( | LinearSolution | , |
PetscLogDouble | |||
) |
PetscErrorCode LinearSolutionCopy | ( | LinearSolution | old, |
LinearSolution | lnew | ||
) |
Copy one linear solution object into another. This clearly only works if their vectors are similarly layed out.
The context pointer is blindly copied. We may have to think about this a bit more.
See also LinearCopyNumericalSolution().
Definition at line 496 of file linear.c.
References CHKERRQ(), LinearSolution_::ctx, ierr, LinearSolution_::Out, LinearSolution_::statistics, and SYSPROCHECKVALIDLINSOLa.
Referenced by back_flipsign(), LinearCopyNumericalSolution(), unapproximate_system(), unset_ksp(), and unset_pc().
PetscErrorCode LinearSolutionCopyStats | ( | LinearSolution | , |
LinearSolution | |||
) |
Definition at line 611 of file linear.c.
References CHKERRQ(), ierr, LinearSolution_::statistics, and SYSPROCHECKVALIDLINSOLa.
Referenced by back_singleton(), undistribute_system(), and unscale_system().
PetscErrorCode LinearSolutionCreateStatistics | ( | LinearSolution | sol | ) |
Definition at line 573 of file linear.c.
References CHKERRQ(), ierr, LinearSolution_::statistics, and SYSPROCHECKVALIDLINSOL.
PetscErrorCode LinearSolutionDelete | ( | LinearSolution | sol | ) |
Delete a linear solution.
This does not affect the context stored in the solution. That needs a special purpose routine.
See also LinearDeleteNumericalSolution().
Definition at line 459 of file linear.c.
References CHKERRQ(), ierr, LinearSolution_::Out, LinearSolution_::statistics, and SYSPROCHECKVALIDLINSOL.
Referenced by LinearDeleteNumericalSolution().
PetscErrorCode LinearSolutionGetContext | ( | LinearSolution | , |
void ** | ctx | ||
) |
Definition at line 640 of file linear.c.
References LinearSolution_::ctx, and SYSPROCHECKVALIDLINSOL.
PetscErrorCode LinearSolutionGetStatistics | ( | LinearSolution | , |
NMD_metadata * | |||
) |
Definition at line 601 of file linear.c.
References LinearSolution_::statistics, and SYSPROCHECKVALIDLINSOL.
PetscErrorCode LinearSolutionGetTimes | ( | LinearSolution | , |
PetscLogDouble * | , | ||
PetscLogDouble * | , | ||
PetscLogDouble * | |||
) |
PetscErrorCode LinearSolutionGetVector | ( | LinearSolution | , |
Vec * | |||
) |
Definition at line 557 of file linear.c.
References LinearSolution_::Out, and SYSPROCHECKVALIDLINSOL.
Referenced by back_singleton(), LinearSystemTrueDistance(), LinearSystemTrueDistancePrint(), main(), undistribute_system(), and unscale_system().
PetscErrorCode LinearSolutionSetContext | ( | LinearSolution | , |
void * | ctx | ||
) |
Definition at line 630 of file linear.c.
References LinearSolution_::ctx, and SYSPROCHECKVALIDLINSOL.
PetscErrorCode LinearSolutionSetTimes | ( | LinearSolution | , |
PetscLogDouble | , | ||
PetscLogDouble | , | ||
PetscLogDouble | |||
) |
PetscErrorCode LinearSolutionSetVector | ( | LinearSolution | , |
Vec | |||
) |
Definition at line 547 of file linear.c.
References LinearSolution_::Out, and SYSPROCHECKVALIDLINSOL.
Referenced by back_singleton(), CreateDefaultLinearSolution(), LinearCreateNumericalSolution(), and solvelinear().
PetscErrorCode LinearSystemCopy | ( | LinearSystem | old, |
LinearSystem | lnew | ||
) |
Copy the values of the components of an old linear system into a new. The new system has to have been created with LinearSystemDuplicate() because this routine assumes that the data structures are already in place.
Definition at line 368 of file linear.c.
References LinearSystem_::A, ALLPARTSNEW, LinearSystem_::B, CHKERRQ(), ierr, LinearSystem_::Init, LinearSystem_::known_solution, LinearSystem_::metadata, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYSa.
Referenced by scale_system().
PetscErrorCode LinearSystemDelete | ( | LinearSystem | ) |
Definition at line 89 of file linear.c.
References LinearSystem_::A, LinearSystem_::B, CHKERRQ(), ierr, LinearSystem_::Init, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, SYSPROCHECKVALIDLINSYS, and LinearSystem_::Tmp.
Referenced by LinearDeleteNumericalProblem().
PetscErrorCode LinearSystemDuplicate | ( | LinearSystem | problem, |
LinearSystem * | newproblem | ||
) |
Allocate a new linear system, and create copies in it of the data structure, but not the values, of the components of the old system.
See also LinearSystemCopy().
Definition at line 323 of file linear.c.
References LinearSystem_::A, ALLPARTSNEW, LinearSystem_::B, CHKERRQ(), CreateLinearSystem(), NumericalProblem_::ctx, LinearSystem_::ctx, ierr, LinearSystem_::Init, LinearSystem_::known_solution, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYS.
Referenced by scale_system().
PetscErrorCode LinearSystemDuplicatePointers | ( | LinearSystem | problem, |
LinearSystem * | newproblem | ||
) |
Allocate a new linear system and give it the components of the old by pointer duplication.
Definition at line 294 of file linear.c.
References LinearSystem_::A, LinearSystem_::B, CHKERRQ(), CreateLinearSystem(), NumericalProblem_::ctx, LinearSystem_::ctx, ierr, LinearSystem_::Init, LinearSystem_::known_solution, LinearSystem_::metadata, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYS.
Referenced by approximate_system(), distribute_system(), eliminate_singletons(), flipsign(), setup_ksp(), and setup_pc().
PetscErrorCode LinearSystemGetContext | ( | LinearSystem | , |
void ** | ctx | ||
) |
Definition at line 227 of file linear.c.
References LinearSystem_::ctx, and SYSPROCHECKVALIDLINSYS.
Referenced by eliminate_singletons().
PetscErrorCode LinearSystemGetKnownSolution | ( | LinearSystem | , |
PetscBool * | |||
) |
Definition at line 247 of file linear.c.
References LinearSystem_::known_solution, and SYSPROCHECKVALIDLINSYS.
Referenced by LinearSystemTrueDistancePrint().
PetscErrorCode LinearSystemGetMetadata | ( | LinearSystem | , |
NMD_metadata * | |||
) |
Definition at line 267 of file linear.c.
References LinearSystem_::metadata, and SYSPROCHECKVALIDLINSYS.
Referenced by SysProComputeQuantity(), SysProFreeQuantities(), and SysProRemoveQuantity().
PetscErrorCode LinearSystemGetParts | ( | LinearSystem | system, |
Mat * | A, | ||
Mat * | B, | ||
Vec * | Rhs, | ||
Vec * | Sol, | ||
Vec * | Init | ||
) |
Get the matrices and vectors of the system
Definition at line 202 of file linear.c.
References LinearSystem_::A, LinearSystem_::B, LinearSystem_::Init, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYS.
Referenced by approximate_system(), back_singleton(), CreateDefaultLinearSolution(), distribute_system(), eliminate_singletons(), flipsign(), LinearCreateNumericalSolution(), LinearSystemTrueDistance(), LinearSystemTrueDistancePrint(), MatGustafssonMod(), MatSymmetricPart(), sans_partition(), scale_system(), setup_pc(), solvelinear(), specific_approximation_choices(), SysProComputeQuantity(), SysProRetrieveQuantity(), and unset_pc().
PetscErrorCode LinearSystemGetTmpVector | ( | LinearSystem | , |
Vec * | |||
) |
Definition at line 277 of file linear.c.
References CHKERRQ(), ierr, LinearSystem_::Rhs, SYSPROCHECKVALIDLINSYS, and LinearSystem_::Tmp.
Referenced by LinearSystemTrueDistance(), and LinearSystemTrueDistancePrint().
PetscErrorCode LinearSystemInheritParts | ( | LinearSystem | system, |
Mat | A, | ||
Mat | B, | ||
Vec | Rhs, | ||
Vec | Sol, | ||
Vec | Init | ||
) |
Declare the matrices and vectors for a linear system. Unlike in LinearSystemSetParts(), here the parts are marked as not original, so they will not be deleted in DeleteLinearSystem().
Definition at line 175 of file linear.c.
References LinearSystem_::A, ALLPARTSNEW, LinearSystem_::B, CHKERRQ(), ierr, LinearSystem_::Init, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYS.
PetscErrorCode LinearSystemSetContext | ( | LinearSystem | , |
void * | ctx | ||
) |
Definition at line 217 of file linear.c.
References LinearSystem_::ctx, and SYSPROCHECKVALIDLINSYS.
Referenced by eliminate_singletons().
PetscErrorCode LinearSystemSetKnownSolution | ( | LinearSystem | , |
PetscBool | |||
) |
Definition at line 237 of file linear.c.
References LinearSystem_::known_solution, and SYSPROCHECKVALIDLINSYS.
PetscErrorCode LinearSystemSetMetadata | ( | LinearSystem | , |
NMD_metadata | |||
) |
Definition at line 257 of file linear.c.
References LinearSystem_::metadata, and SYSPROCHECKVALIDLINSYS.
PetscErrorCode LinearSystemSetParts | ( | LinearSystem | system, |
Mat | A, | ||
Mat | B, | ||
Vec | Rhs, | ||
Vec | Sol, | ||
Vec | Init | ||
) |
Declare the matrices and vectors for a linear system.
Arguments:
system
A
: the matrixB
: operator to construct the preconditioner from; if NULL, (or identical to A), A will be usedDefinition at line 145 of file linear.c.
References LinearSystem_::A, LinearSystem_::B, CHKERRQ(), ierr, LinearSystem_::Init, LinearSystem_::partsoriginal, LinearSystem_::Rhs, LinearSystem_::Sol, and SYSPROCHECKVALIDLINSYS.
Referenced by distribute_system(), eliminate_singletons(), flipsign(), main(), MatGustafssonMod(), MatSymmetricPart(), and setup_pc().
PetscErrorCode LinearSystemTrueDistance | ( | LinearSystem | , |
LinearSolution | , | ||
PetscReal * | |||
) |
Definition at line 664 of file linear.c.
References CHKERRQ(), ierr, LinearSolutionGetVector(), LinearSystemGetParts(), and LinearSystemGetTmpVector().
Referenced by LinearSystemTrueDistancePrint().
PetscErrorCode LinearSystemTrueDistancePrint | ( | NumericalProblem | , |
NumericalSolution | , | ||
char * | |||
) |
Definition at line 684 of file linear.c.
References CHKERRQ(), ierr, LinearSolutionGetVector(), LinearSystemGetKnownSolution(), LinearSystemGetParts(), LinearSystemGetTmpVector(), LinearSystemTrueDistance(), SYSPROCHECKVALIDLINSOL, and SYSPROCHECKVALIDLINSYS.
PetscErrorCode make_diagnostics | ( | char * | , |
char * | , | ||
Diagnostics * | |||
) |
PetscErrorCode PreprocessedLinearSystemSolution | ( | LinearSystem | , |
LinearSolution * | |||
) |
Definition at line 717 of file linear.c.
References CHKERRQ(), ierr, PreprocessedProblemSolving(), RegisterPreprocessorContext(), and SYSPROCHECKVALIDLINSYS.