/*!\file: PetscOptionsFromAnalysis.cpp * \brief: change petsc options using analysis type and parameters */ #ifdef HAVE_CONFIG_H #include "config.h" #else #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif #include "../../objects/objects.h" #include "../../Container/Parameters.h" #include "../../toolkits/toolkits.h" void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){ int dummy; double* analyses=NULL; char** strings=NULL; int numanalyses; char* string=NULL; int found=-1; int i; numanalyses=0; parameters->FindParam(&strings,&numanalyses,PetscOptionsStringsEnum); #ifdef _SERIAL_ //do not take this away, because ISSM loads analyses as a Double Param instead of a DoubleVec Param when running with only 1 analysis if(numanalyses==1){ analyses=(double*)xmalloc(1*sizeof(double)); parameters->FindParam(analyses,PetscOptionsAnalysesEnum); } else parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum); #else parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum); #endif if(numanalyses==0)return; //we did not find petsc options, don't bother. /*ok, go through analyses and figure out if it corresponds to our analysis_type: */ found=-1; for(i=0;i