00001 #ifndef LINEAR_H
00002 #define LINEAR_H
00003
00004 #include "petscmat.h"
00005 #include "petscksp.h"
00006 #include "syspro.h"
00007 #include "nmd.h"
00008
00009 typedef struct LinearSystem_* LinearSystem;
00010 typedef struct LinearSolution_* LinearSolution;
00011 typedef struct Diagnostics_* Diagnostics;
00012
00013
00014
00015
00016 extern PetscErrorCode CreateLinearSystem(MPI_Comm,LinearSystem*);
00017 extern PetscErrorCode DeleteLinearSystem(LinearSystem);
00018 extern PetscErrorCode LinearSystemSetParts(LinearSystem,Mat,Mat,Vec,Vec,Vec);
00019 extern PetscErrorCode LinearSystemInheritParts(LinearSystem,Mat,Mat,Vec,Vec,Vec);
00020 extern PetscErrorCode LinearSystemGetParts(LinearSystem,Mat*,Mat*,Vec*,Vec*,Vec*);
00021 extern PetscErrorCode LinearSystemGetTmpVector(LinearSystem,Vec*);
00022 extern PetscErrorCode LinearSystemSetContext(LinearSystem,void *ctx);
00023 extern PetscErrorCode LinearSystemGetContext(LinearSystem,void **ctx);
00024 extern PetscErrorCode LinearSystemSetKnownSolution(LinearSystem,PetscTruth);
00025 extern PetscErrorCode LinearSystemGetKnownSolution(LinearSystem,PetscTruth*);
00026 extern PetscErrorCode LinearSystemSetMetadata(LinearSystem,NMD_metadata);
00027 extern PetscErrorCode LinearSystemGetMetadata(LinearSystem,NMD_metadata*);
00028
00029 extern PetscErrorCode LinearSystemDuplicatePointers(LinearSystem,LinearSystem*);
00030 extern PetscErrorCode LinearSystemDuplicate(LinearSystem,LinearSystem*);
00031 extern PetscErrorCode LinearSystemCopy(LinearSystem,LinearSystem);
00032
00033
00034
00035
00036 extern PetscErrorCode CreateLinearSolution(LinearSolution*);
00037 extern PetscErrorCode LinearCreateNumericalSolution(NumericalProblem,NumericalSolution*);
00038 extern PetscErrorCode LinearSolutionDelete(LinearSolution);
00039 extern PetscErrorCode LinearSolutionCopy(LinearSolution,LinearSolution);
00040 extern PetscErrorCode LinearSolutionCopyStats(LinearSolution,LinearSolution);
00041 extern PetscErrorCode LinearCopyNumericalSolution(NumericalSolution,NumericalSolution);
00042 extern PetscErrorCode LinearDeleteNumericalSolution(NumericalSolution);
00043 extern PetscErrorCode LinearDeleteNumericalSolutionContext(NumericalSolution);
00044 extern PetscErrorCode CreateDefaultLinearSolution(NumericalProblem,NumericalSolution*);
00045 extern PetscErrorCode LinearSolutionSetVector(LinearSolution,Vec);
00046 extern PetscErrorCode LinearSolutionGetVector(LinearSolution,Vec*);
00047 extern PetscErrorCode LinearSolutionGetStatistics(LinearSolution,NMD_metadata*);
00048 extern PetscErrorCode LinearSolutionSetTimes(LinearSolution,PetscLogDouble,PetscLogDouble,PetscLogDouble);
00049 extern PetscErrorCode LinearSolutionAddToPreprocessTime(LinearSolution,PetscLogDouble);
00050 extern PetscErrorCode LinearSolutionGetTimes(LinearSolution,PetscLogDouble*,PetscLogDouble*,PetscLogDouble*);
00051 extern PetscErrorCode LinearSolutionSetContext(LinearSolution,void *ctx);
00052 extern PetscErrorCode LinearSolutionGetContext(LinearSolution,void **ctx);
00053 extern PetscErrorCode LinearSystemTrueDistance
00054 (LinearSystem,LinearSolution,PetscReal*);
00055 extern PetscErrorCode LinearSystemTrueDistancePrint
00056 (NumericalProblem,NumericalSolution,char*);
00057 extern PetscErrorCode LinearSolutionCreateStatistics(LinearSolution sol);
00058
00059 extern PetscErrorCode PreprocessedLinearSystemSolution(LinearSystem,LinearSolution*);
00060
00061 extern PetscErrorCode delete_diagnostics(Diagnostics);
00062 extern PetscErrorCode make_diagnostics(char*,char*,Diagnostics*);
00063
00064
00065
00066
00067 extern PetscErrorCode DeclareSingletonPreprocessor(void);
00068 extern PetscErrorCode DeclareFlipsignPreprocessor(void);
00069 extern PetscErrorCode DeclareApproximationPreprocessor(void);
00070 extern PetscErrorCode DeclareDummyRowPreprocessor(void);
00071 extern PetscErrorCode DeclareDistributionPreprocessor(void);
00072 extern PetscErrorCode DeclareScalingPreprocessor(void);
00073 extern PetscErrorCode DeclarePCPreprocessor(void);
00074 extern PetscErrorCode DeclareKSPPreprocessor(void);
00075
00076 #endif