- Timestamp:
- 04/17/13 14:15:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp
r14632 r14633 1 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 2 * \brief: for each analysis, setup the issmoptions string. 3 * This is mainly for the case where we run our toolkits using petsc. In this case, we need to 3 4 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type 4 5 * and parameters … … 11 12 #endif 12 13 13 #include "../../classes/ objects/objects.h"14 #include "../../classes/classes.h" 14 15 #include "../../Container/Parameters.h" 15 16 #include "../../toolkits/toolkits.h" … … 17 18 void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){ 18 19 19 /*intermediary: */20 20 char* options=NULL; 21 21 22 22 /*Recover first the options string for this analysis: */ 23 23 options=OptionsFromAnalysis(parameters,analysis_type); 24 24 25 /* now, reset the petsc options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This26 *capability is not covered by Petsc!: */25 /*Initialize our Toolkit Options: */ 26 ToolkitOptions::Init(options); 27 27 28 28 #ifdef _HAVE_PETSC_ 29 /*In case we are using PETSC, we do not rely on issmoptions. Instead, we dump issmoptions into the Petsc 30 * options database: */ 29 31 30 #if _PETSC_MAJOR_ == 231 PetscOptionsDestroy();32 PetscOptionsCreate();33 //PetscOptionsCheckInitial_Private();34 //PetscOptionsCheckInitial_Components();35 PetscOptionsSetFromOptions();36 PetscOptionsInsertMultipleString(options); //our patch37 #else38 PetscOptionsSetFromOptions();39 PetscOptionsClear();40 //PetscOptionsSetFromOptions();41 PetscOptionsInsertMultipleString(options); //our patch42 #endif32 #if _PETSC_MAJOR_ == 2 33 PetscOptionsDestroy(); 34 PetscOptionsCreate(); 35 //PetscOptionsCheckInitial_Private(); 36 //PetscOptionsCheckInitial_Components(); 37 PetscOptionsSetFromOptions(); 38 PetscOptionsInsertMultipleString(options); //our patch 39 #else 40 PetscOptionsSetFromOptions(); 41 PetscOptionsClear(); 42 //PetscOptionsSetFromOptions(); 43 PetscOptionsInsertMultipleString(options); //our patch 44 #endif 43 45 44 46 #endif 45 46 /*Free ressources:*/ 47 47 48 xDelete<char>(options); 48 49 }
Note:
See TracChangeset
for help on using the changeset viewer.