Changeset 6014 for issm/trunk/src/mex/Solver/Solver.cpp
- Timestamp:
- 09/24/10 10:04:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/Solver/Solver.cpp
r5903 r6014 12 12 Vec uf0 = NULL; 13 13 Vec uf = NULL; 14 char *petscrc = NULL;15 14 Parameters *parameters = NULL; 16 15 int verbose; 17 16 int analysis_type; 17 char option[100]; 18 PetscTruth flag; 19 18 20 /*Matlab solver: */ 19 21 mxArray* array[2]; … … 24 26 /*checks on arguments on the matlab side: */ 25 27 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&SolverUsage); 28 29 /*parameters: */ 30 FetchParams(¶meters,PARAMETERS); 31 parameters->FindParam(&verbose,VerboseEnum); 26 32 27 /*First, check solver string: */ 28 FetchParams(¶meters,PARAMETERS); 29 parameters->FindParam(&petscrc,PetscRcEnum); 30 int verbose; parameters->FindParam(&verbose,VerboseEnum); 33 /*In serial mode, we have no set any petsc options, do it now: */ 34 #ifdef _SERIAL_ 35 parameters->FindParam(&analysis_type,AnalysisTypeEnum); 36 PetscOptionsFromAnalysis(parameters,analysis_type); 37 #endif 31 38 39 /*Retrieve solver type: */ 40 PetscOptionsGetString(PETSC_NULL,"-ksp_type",&option[0],100,&flag); 41 32 42 /*Fetch rest of data only if not running the matlab solver: */ 33 if (strcmp(petscrc,matlabstring)!=0){ 43 if (strcmp(option,"matlab")!=0){ 44 34 45 /*Input datasets: */ 35 46 FetchData(&Kff,KFF); 36 47 FetchData(&pf,PF); 37 48 FetchData(&uf0,UF0); 38 /*Petsc solver: */ 49 50 /*Core module: */ 39 51 Solverx(&uf, Kff, pf, uf0, parameters); 52 40 53 /*Write output*/ 41 54 WriteData(UF,uf); … … 55 68 VecFree(&uf); 56 69 delete parameters; 57 xfree((void**)&petscrc);58 70 59 71 MODULEEND(); 72 60 73 } 61 74
Note:
See TracChangeset
for help on using the changeset viewer.