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

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

merged trunk-jpl and trunk for revision 15394

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,dim,verbose;
18 bool isthermal,isprognostic,isdiagnostic,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(&dim,MeshDimensionEnum);
34 iomodel->Constant(&verbose,VerboseEnum);
35 iomodel->Constant(&isthermal,TransientIsthermalEnum);
36 iomodel->Constant(&isenthalpy,ThermalIsenthalpyEnum);
37 iomodel->Constant(&isprognostic,TransientIsprognosticEnum);
38 iomodel->Constant(&isdiagnostic,TransientIsdiagnosticEnum);
39 iomodel->Constant(&isgroundingline,TransientIsgroundinglineEnum);
40
41 SetVerbosityLevel(verbose);
42
43 if(VerboseMProcessor()) _printf0_(" starting model processor \n");
44
45 for(i=0;i<nummodels;i++){
46
47 analysis_type=analysis_type_list[i];
48
49 /*Hack for trasient runs (FIXME: to be improved)*/
50 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue;
51 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue;
52 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && dim==2) continue;
53 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isthermal==false) continue;
54 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isthermal==false) continue;
55 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isthermal==false) continue;
56 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
57 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
58 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
59 if(solution_type==TransientSolutionEnum && analysis_type==PrognosticAnalysisEnum && isprognostic==false && isgroundingline==false) continue;
60 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHorizAnalysisEnum && isdiagnostic==false) continue;
61 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticVertAnalysisEnum && isdiagnostic==false) continue;
62 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHutterAnalysisEnum && isdiagnostic==false) continue;
63 if(solution_type==SteadystateSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
64 if(solution_type==SteadystateSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
65 if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
66
67 if(VerboseMProcessor()) _printf0_(" creating datasets for analysis " << EnumToStringx(analysis_type) << "\n");
68 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,rootpath,solution_type,analysis_type,nummodels,i);
69 }
70 if(VerboseMProcessor()) _printf0_(" done with model processor \n");
71
72 /*Free resources:*/
73 delete iomodel;
74
75 /*Assign output pointers:*/
76 *pelements=elements;
77 *pnodes=nodes;
78 *pvertices=vertices;
79 *pmaterials=materials;
80 *pconstraints=constraints;
81 *ploads=loads;
82 *pparameters=parameters;
83
84}
Note: See TracBrowser for help on using the repository browser.