[15393] | 1 | Index: ../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp (revision 14631)
|
---|
| 4 | +++ ../trunk-jpl/src/c/shared/Numerics/PetscOptionsFromAnalysis.cpp (revision 14632)
|
---|
| 5 | @@ -1,42 +0,0 @@
|
---|
| 6 | -/*!\file: PetscOptionsFromAnalysis.cpp
|
---|
| 7 | - * \brief: change petsc options using analysis type and parameters
|
---|
| 8 | - */
|
---|
| 9 | -
|
---|
| 10 | -#ifdef HAVE_CONFIG_H
|
---|
| 11 | - #include <config.h>
|
---|
| 12 | -#else
|
---|
| 13 | -#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 14 | -#endif
|
---|
| 15 | -
|
---|
| 16 | -#include "../../classes/objects/objects.h"
|
---|
| 17 | -#include "../../Container/Parameters.h"
|
---|
| 18 | -#include "../../toolkits/toolkits.h"
|
---|
| 19 | -
|
---|
| 20 | -void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){
|
---|
| 21 | -
|
---|
| 22 | - /*intermediary: */
|
---|
| 23 | - char* options=NULL;
|
---|
| 24 | -
|
---|
| 25 | - /*Recover first the options string for this analysis: */
|
---|
| 26 | - options=OptionsFromAnalysis(parameters,analysis_type);
|
---|
| 27 | -
|
---|
| 28 | - /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This
|
---|
| 29 | - *capability is not covered by Petsc!: */
|
---|
| 30 | -
|
---|
| 31 | - #if _PETSC_MAJOR_ == 2
|
---|
| 32 | - PetscOptionsDestroy();
|
---|
| 33 | - PetscOptionsCreate();
|
---|
| 34 | - //PetscOptionsCheckInitial_Private();
|
---|
| 35 | - //PetscOptionsCheckInitial_Components();
|
---|
| 36 | - PetscOptionsSetFromOptions();
|
---|
| 37 | - PetscOptionsInsertMultipleString(options); //our patch
|
---|
| 38 | - #else
|
---|
| 39 | - PetscOptionsSetFromOptions();
|
---|
| 40 | - PetscOptionsClear();
|
---|
| 41 | - //PetscOptionsSetFromOptions();
|
---|
| 42 | - PetscOptionsInsertMultipleString(options); //our patch
|
---|
| 43 | - #endif
|
---|
| 44 | -
|
---|
| 45 | - /*Free ressources:*/
|
---|
| 46 | - xDelete<char>(options);
|
---|
| 47 | -}
|
---|
| 48 | Index: ../trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp
|
---|
| 49 | ===================================================================
|
---|
| 50 | --- ../trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp (revision 0)
|
---|
| 51 | +++ ../trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp (revision 14632)
|
---|
| 52 | @@ -0,0 +1,48 @@
|
---|
| 53 | +/*!\file: ToolkitsOptionsFromAnalysis.cpp
|
---|
| 54 | + * \brief: this is mainly for the case where we run our toolkits using petsc. In this case, we need to
|
---|
| 55 | + * plug our toolkits options directly into the petsc options database. This is the case for each analysis type
|
---|
| 56 | + * and parameters
|
---|
| 57 | + */
|
---|
| 58 | +
|
---|
| 59 | +#ifdef HAVE_CONFIG_H
|
---|
| 60 | + #include <config.h>
|
---|
| 61 | +#else
|
---|
| 62 | +#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 63 | +#endif
|
---|
| 64 | +
|
---|
| 65 | +#include "../../classes/objects/objects.h"
|
---|
| 66 | +#include "../../Container/Parameters.h"
|
---|
| 67 | +#include "../../toolkits/toolkits.h"
|
---|
| 68 | +
|
---|
| 69 | +void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){
|
---|
| 70 | +
|
---|
| 71 | + /*intermediary: */
|
---|
| 72 | + char* options=NULL;
|
---|
| 73 | +
|
---|
| 74 | + /*Recover first the options string for this analysis: */
|
---|
| 75 | + options=OptionsFromAnalysis(parameters,analysis_type);
|
---|
| 76 | +
|
---|
| 77 | + /*now, reset the petsc options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This
|
---|
| 78 | + *capability is not covered by Petsc!: */
|
---|
| 79 | +
|
---|
| 80 | + #ifdef _HAVE_PETSC_
|
---|
| 81 | +
|
---|
| 82 | + #if _PETSC_MAJOR_ == 2
|
---|
| 83 | + PetscOptionsDestroy();
|
---|
| 84 | + PetscOptionsCreate();
|
---|
| 85 | + //PetscOptionsCheckInitial_Private();
|
---|
| 86 | + //PetscOptionsCheckInitial_Components();
|
---|
| 87 | + PetscOptionsSetFromOptions();
|
---|
| 88 | + PetscOptionsInsertMultipleString(options); //our patch
|
---|
| 89 | + #else
|
---|
| 90 | + PetscOptionsSetFromOptions();
|
---|
| 91 | + PetscOptionsClear();
|
---|
| 92 | + //PetscOptionsSetFromOptions();
|
---|
| 93 | + PetscOptionsInsertMultipleString(options); //our patch
|
---|
| 94 | + #endif
|
---|
| 95 | +
|
---|
| 96 | + #endif
|
---|
| 97 | +
|
---|
| 98 | + /*Free ressources:*/
|
---|
| 99 | + xDelete<char>(options);
|
---|
| 100 | +}
|
---|
| 101 | Index: ../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp
|
---|
| 102 | ===================================================================
|
---|
| 103 | --- ../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp (revision 14631)
|
---|
| 104 | +++ ../trunk-jpl/src/c/shared/Numerics/OptionsFromAnalysis.cpp (revision 14632)
|
---|
| 105 | @@ -29,9 +29,9 @@
|
---|
| 106 | int i;
|
---|
| 107 |
|
---|
| 108 | numanalyses=0;
|
---|
| 109 | - parameters->FindParam(&strings,&numanalyses,PetscOptionsStringsEnum);
|
---|
| 110 | + parameters->FindParam(&strings,&numanalyses,ToolkitsOptionsStringsEnum);
|
---|
| 111 |
|
---|
| 112 | - parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
|
---|
| 113 | + parameters->FindParam(&analyses,&dummy,ToolkitsOptionsAnalysesEnum);
|
---|
| 114 |
|
---|
| 115 | if(numanalyses==0)return NULL; //we did not find petsc options, don't bother.
|
---|
| 116 |
|
---|
| 117 | Index: ../trunk-jpl/src/c/shared/Numerics/numerics.h
|
---|
| 118 | ===================================================================
|
---|
| 119 | --- ../trunk-jpl/src/c/shared/Numerics/numerics.h (revision 14631)
|
---|
| 120 | +++ ../trunk-jpl/src/c/shared/Numerics/numerics.h (revision 14632)
|
---|
| 121 | @@ -30,8 +30,6 @@
|
---|
| 122 | char *OptionsFromAnalysis(Parameters *parameters,int analysis_type);
|
---|
| 123 | void XZvectorsToCoordinateSystem(IssmDouble *T,IssmDouble*xzvectors);
|
---|
| 124 | int cubic(IssmDouble a, IssmDouble b, IssmDouble c, IssmDouble d, double X[3], int *num);
|
---|
| 125 | -#ifdef _HAVE_PETSC_
|
---|
| 126 | -void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type);
|
---|
| 127 | -#endif
|
---|
| 128 | +void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type);
|
---|
| 129 |
|
---|
| 130 | #endif //ifndef _NUMERICS_H_
|
---|
| 131 | Index: ../trunk-jpl/src/c/modules/modules.h
|
---|
| 132 | ===================================================================
|
---|
| 133 | --- ../trunk-jpl/src/c/modules/modules.h (revision 14631)
|
---|
| 134 | +++ ../trunk-jpl/src/c/modules/modules.h (revision 14632)
|
---|
| 135 | @@ -68,7 +68,7 @@
|
---|
| 136 | #include "./SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.h"
|
---|
| 137 | #include "./SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.h"
|
---|
| 138 | #include "./ModelProcessorx/ModelProcessorx.h"
|
---|
| 139 | -#include "./ParsePetscOptionsx/ParsePetscOptionsx.h"
|
---|
| 140 | +#include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
|
---|
| 141 | #include "./NodalValuex/NodalValuex.h"
|
---|
| 142 | #include "./NodeConnectivityx/NodeConnectivityx.h"
|
---|
| 143 | #include "./NodesDofx/NodesDofx.h"
|
---|
| 144 | Index: ../trunk-jpl/src/c/Makefile.am
|
---|
| 145 | ===================================================================
|
---|
| 146 | --- ../trunk-jpl/src/c/Makefile.am (revision 14631)
|
---|
| 147 | +++ ../trunk-jpl/src/c/Makefile.am (revision 14632)
|
---|
| 148 | @@ -197,6 +197,7 @@
|
---|
| 149 | ./shared/Numerics/XZvectorsToCoordinateSystem.cpp\
|
---|
| 150 | ./shared/Numerics/UnitConversion.cpp\
|
---|
| 151 | ./shared/Numerics/OptionsFromAnalysis.cpp\
|
---|
| 152 | + ./shared/Numerics/ToolkitsOptionsFromAnalysis.cpp\
|
---|
| 153 | ./shared/Exceptions/exceptions.h\
|
---|
| 154 | ./shared/Exceptions/Exceptions.cpp\
|
---|
| 155 | ./shared/Exceptions/exprintf.cpp\
|
---|
| 156 | @@ -727,7 +728,6 @@
|
---|
| 157 | ./toolkits/petsc/objects/PetscVec.h\
|
---|
| 158 | ./toolkits/petsc/objects/PetscVec.cpp\
|
---|
| 159 | ./toolkits/petsc/petscincludes.h\
|
---|
| 160 | - ./shared/Numerics/PetscOptionsFromAnalysis.cpp\
|
---|
| 161 | ./modules/Solverx/SolverxPetsc.cpp\
|
---|
| 162 | ./modules/Solverx/DofTypesToIndexSet.cpp
|
---|
| 163 |
|
---|
| 164 | Index: ../trunk-jpl/src/c/classes/FemModel.cpp
|
---|
| 165 | ===================================================================
|
---|
| 166 | --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 14631)
|
---|
| 167 | +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 14632)
|
---|
| 168 | @@ -269,13 +269,11 @@
|
---|
| 169 | this->nodes->SetCurrentConfiguration(elements,loads, nodes,vertices, materials,parameters);
|
---|
| 170 | this->loads->SetCurrentConfiguration(elements, loads, nodes,vertices, materials,parameters);
|
---|
| 171 |
|
---|
| 172 | - #ifdef _HAVE_PETSC_
|
---|
| 173 | - /*take care of petsc options, that depend on this analysis type (present only after model processor)*/
|
---|
| 174 | - if(this->parameters->Exist(PetscOptionsStringsEnum)){
|
---|
| 175 | - PetscOptionsFromAnalysis(this->parameters,analysis_type);
|
---|
| 176 | - if(VerboseSolver()) _pprintLine_(" petsc Options set for analysis type: " << EnumToStringx(analysis_type));
|
---|
| 177 | + /*take care of toolkits options, that depend on this analysis type (present only after model processor)*/
|
---|
| 178 | + if(this->parameters->Exist(ToolkitsOptionsStringsEnum)){
|
---|
| 179 | + ToolkitsOptionsFromAnalysis(this->parameters,analysis_type);
|
---|
| 180 | + if(VerboseSolver()) _pprintLine_(" toolkits Options set for analysis type: " << EnumToStringx(analysis_type));
|
---|
| 181 | }
|
---|
| 182 | - #endif
|
---|
| 183 |
|
---|
| 184 | }
|
---|
| 185 | /*}}}*/
|
---|