source: issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp@ 16137

Last change on this file since 16137 was 16137, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 16135

File size: 4.0 KB
Line 
1/*!\file ModelProcessorx
2 * \brief: create datasets using input binary file and a set of requested analyses
3 */
4
5#ifdef HAVE_CONFIG_H
6 #include <config.h>
7#else
8#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
9#endif
10
11#include "../../classes/classes.h"
12#include "../../shared/shared.h"
13#include "./ModelProcessorx.h"
14
15void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* IOMODEL,char* rootpath,const int solution_type,const int nummodels,const int* analysis_type_list){
16
17 int i,analysis_type,verbose;
18 bool isthermal,ismasstransport,isstressbalance,isgroundingline,isenthalpy;
19
20 /*output: */
21 Elements *elements = NULL;
22 Nodes *nodes = NULL;
23 Vertices *vertices = NULL;
24 Materials *materials = NULL;
25 Constraints *constraints = NULL;
26 Loads *loads = NULL;
27 Parameters *parameters = NULL;
28
29 /*Initialize IoModel from input file*/
30 IoModel* iomodel = new IoModel(IOMODEL);
31
32 /*Fetch parameters: */
33 iomodel->Constant(&verbose,VerboseEnum);
34 iomodel->Constant(&isthermal,TransientIsthermalEnum);
35 iomodel->Constant(&isenthalpy,ThermalIsenthalpyEnum);
36 iomodel->Constant(&ismasstransport,TransientIsmasstransportEnum);
37 iomodel->Constant(&isstressbalance,TransientIsstressbalanceEnum);
38 iomodel->Constant(&isgroundingline,TransientIsgroundinglineEnum);
39
40 SetVerbosityLevel(verbose);
41
42 if(VerboseMProcessor()) _printf0_(" starting model processor \n");
43
44 for(i=0;i<nummodels;i++){
45
46 analysis_type=analysis_type_list[i];
47
48 /*Hack for trasient runs (FIXME: to be improved)*/
49 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && iomodel->dim==2) continue;
50 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && iomodel->dim==2) continue;
51 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && iomodel->dim==2) continue;
52 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isthermal==false) continue;
53 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isthermal==false) continue;
54 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isthermal==false) continue;
55 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
56 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
57 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
58 if(solution_type==TransientSolutionEnum && analysis_type==MasstransportAnalysisEnum && ismasstransport==false && isgroundingline==false) continue;
59 if(solution_type==TransientSolutionEnum && analysis_type==StressbalanceAnalysisEnum && isstressbalance==false) continue;
60 if(solution_type==TransientSolutionEnum && analysis_type==StressbalanceVerticalAnalysisEnum && isstressbalance==false) continue;
61 if(solution_type==TransientSolutionEnum && analysis_type==StressbalanceSIAAnalysisEnum && isstressbalance==false) continue;
62 if(solution_type==SteadystateSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
63 if(solution_type==SteadystateSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
64 if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
65
66 if(VerboseMProcessor()) _printf0_(" creating datasets for analysis " << EnumToStringx(analysis_type) << "\n");
67 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,rootpath,solution_type,analysis_type,nummodels,i);
68 }
69 if(VerboseMProcessor()) _printf0_(" done with model processor \n");
70
71 /*Free resources:*/
72 delete iomodel;
73
74 /*Assign output pointers:*/
75 *pelements=elements;
76 *pnodes=nodes;
77 *pvertices=vertices;
78 *pmaterials=materials;
79 *pconstraints=constraints;
80 *ploads=loads;
81 *pparameters=parameters;
82
83}
Note: See TracBrowser for help on using the repository browser.