source:
issm/oecreview/Archive/14312-15392/ISSM-14631-14632.diff@
15393
Last change on this file since 15393 was 15393, checked in by , 12 years ago | |
---|---|
File size: 7.3 KB |
-
../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
1 /*!\file: PetscOptionsFromAnalysis.cpp2 * \brief: change petsc options using analysis type and parameters3 */4 5 #ifdef HAVE_CONFIG_H6 #include <config.h>7 #else8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"9 #endif10 11 #include "../../classes/objects/objects.h"12 #include "../../Container/Parameters.h"13 #include "../../toolkits/toolkits.h"14 15 void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){16 17 /*intermediary: */18 char* options=NULL;19 20 /*Recover first the options string for this analysis: */21 options=OptionsFromAnalysis(parameters,analysis_type);22 23 /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This24 *capability is not covered by Petsc!: */25 26 #if _PETSC_MAJOR_ == 227 PetscOptionsDestroy();28 PetscOptionsCreate();29 //PetscOptionsCheckInitial_Private();30 //PetscOptionsCheckInitial_Components();31 PetscOptionsSetFromOptions();32 PetscOptionsInsertMultipleString(options); //our patch33 #else34 PetscOptionsSetFromOptions();35 PetscOptionsClear();36 //PetscOptionsSetFromOptions();37 PetscOptionsInsertMultipleString(options); //our patch38 #endif39 40 /*Free ressources:*/41 xDelete<char>(options);42 } -
../trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp
1 /*!\file: ToolkitsOptionsFromAnalysis.cpp 2 * \brief: this is mainly for the case where we run our toolkits using petsc. In this case, we need to 3 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type 4 * and parameters 5 */ 6 7 #ifdef HAVE_CONFIG_H 8 #include <config.h> 9 #else 10 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 11 #endif 12 13 #include "../../classes/objects/objects.h" 14 #include "../../Container/Parameters.h" 15 #include "../../toolkits/toolkits.h" 16 17 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){ 18 19 /*intermediary: */ 20 char* options=NULL; 21 22 /*Recover first the options string for this analysis: */ 23 options=OptionsFromAnalysis(parameters,analysis_type); 24 25 /*now, reset the petsc options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This 26 *capability is not covered by Petsc!: */ 27 28 #ifdef _HAVE_PETSC_ 29 30 #if _PETSC_MAJOR_ == 2 31 PetscOptionsDestroy(); 32 PetscOptionsCreate(); 33 //PetscOptionsCheckInitial_Private(); 34 //PetscOptionsCheckInitial_Components(); 35 PetscOptionsSetFromOptions(); 36 PetscOptionsInsertMultipleString(options); //our patch 37 #else 38 PetscOptionsSetFromOptions(); 39 PetscOptionsClear(); 40 //PetscOptionsSetFromOptions(); 41 PetscOptionsInsertMultipleString(options); //our patch 42 #endif 43 44 #endif 45 46 /*Free ressources:*/ 47 xDelete<char>(options); 48 } -
../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
29 29 int i; 30 30 31 31 numanalyses=0; 32 parameters->FindParam(&strings,&numanalyses, PetscOptionsStringsEnum);32 parameters->FindParam(&strings,&numanalyses,ToolkitsOptionsStringsEnum); 33 33 34 parameters->FindParam(&analyses,&dummy, PetscOptionsAnalysesEnum);34 parameters->FindParam(&analyses,&dummy,ToolkitsOptionsAnalysesEnum); 35 35 36 36 if(numanalyses==0)return NULL; //we did not find petsc options, don't bother. 37 37 -
../trunk-jpl/src/c/shared/Numerics/numerics.h
30 30 char *OptionsFromAnalysis(Parameters *parameters,int analysis_type); 31 31 void XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors); 32 32 int cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num); 33 #ifdef _HAVE_PETSC_ 34 void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type); 35 #endif 33 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type); 36 34 37 35 #endif //ifndef _NUMERICS_H_ -
../trunk-jpl/src/c/modules/modules.h
68 68 #include "./SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h" 69 69 #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h" 70 70 #include "./ModelProcessorx/ModelProcessorx.h" 71 #include "./Parse PetscOptionsx/ParsePetscOptionsx.h"71 #include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h" 72 72 #include "./NodalValuex/NodalValuex.h" 73 73 #include "./NodeConnectivityx/NodeConnectivityx.h" 74 74 #include "./NodesDofx/NodesDofx.h" -
../trunk-jpl/src/c/Makefile.am
197 197 ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\ 198 198 ./shared/Numerics/UnitConversion.cpp\ 199 199 ./shared/Numerics/OptionsFromAnalysis.cpp\ 200 ./shared/Numerics/ToolkitsOptionsFromAnalysis.cpp\ 200 201 ./shared/Exceptions/exceptions.h\ 201 202 ./shared/Exceptions/Exceptions.cpp\ 202 203 ./shared/Exceptions/exprintf.cpp\ … … 727 728 ./toolkits/petsc/objects/PetscVec.h\ 728 729 ./toolkits/petsc/objects/PetscVec.cpp\ 729 730 ./toolkits/petsc/petscincludes.h\ 730 ./shared/Numerics/PetscOptionsFromAnalysis.cpp\731 731 ./modules/Solverx/SolverxPetsc.cpp\ 732 732 ./modules/Solverx/DofTypesToIndexSet.cpp 733 733 -
../trunk-jpl/src/c/classes/FemModel.cpp
269 269 this->nodes->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters); 270 270 this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters); 271 271 272 #ifdef _HAVE_PETSC_ 273 /*take care of petsc options, that depend on this analysis type (present only after model processor)*/ 274 if(this->parameters->Exist(PetscOptionsStringsEnum)){ 275 PetscOptionsFromAnalysis(this->parameters,analysis_type); 276 if(VerboseSolver()) _pprintLine_(" petsc Options set for analysis type: " << EnumToStringx(analysis_type)); 272 /*take care of toolkits options, that depend on this analysis type (present only after model processor)*/ 273 if(this->parameters->Exist(ToolkitsOptionsStringsEnum)){ 274 ToolkitsOptionsFromAnalysis(this->parameters,analysis_type); 275 if(VerboseSolver()) _pprintLine_(" toolkits Options set for analysis type: " << EnumToStringx(analysis_type)); 277 276 } 278 #endif279 277 280 278 } 281 279 /*}}}*/
Note:
See TracBrowser
for help on using the repository browser.