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

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

merged trunk-jpl and trunk for revision 13974

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/objects/objects.h"
12#include "../../shared/shared.h"
13#include "../../io/io.h"
14#include "../../Container/Container.h"
15#include "../../EnumDefinitions/EnumDefinitions.h"
16#include "../../include/include.h"
17#include "../../modules/modules.h"
18
19void 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){
20
21 int i,analysis_type,dim,verbose;
22 bool isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy;
23
24 /*output: */
25 Elements *elements = NULL;
26 Nodes *nodes = NULL;
27 Vertices *vertices = NULL;
28 Materials *materials = NULL;
29 Constraints *constraints = NULL;
30 Loads *loads = NULL;
31 Parameters *parameters = NULL;
32
33 /*Initialize IoModel from input file*/
34 IoModel* iomodel = new IoModel(IOMODEL);
35
36 /*Fetch parameters: */
37 iomodel->Constant(&dim,MeshDimensionEnum);
38 iomodel->Constant(&verbose,VerboseEnum);
39 iomodel->Constant(&isthermal,TransientIsthermalEnum);
40 iomodel->Constant(&isenthalpy,ThermalIsenthalpyEnum);
41 iomodel->Constant(&isprognostic,TransientIsprognosticEnum);
42 iomodel->Constant(&isdiagnostic,TransientIsdiagnosticEnum);
43 iomodel->Constant(&isgroundingline,TransientIsgroundinglineEnum);
44
45 SetVerbosityLevel(verbose);
46
47 for(i=0;i<nummodels;i++){
48
49 analysis_type=analysis_type_list[i];
50
51 /*Hack for trasient runs (to be improved)*/
52 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue;
53 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue;
54 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && dim==2) continue;
55 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isthermal==false) continue;
56 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isthermal==false) continue;
57 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isthermal==false) continue;
58 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
59 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
60 if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
61 if(solution_type==TransientSolutionEnum && analysis_type==PrognosticAnalysisEnum && isprognostic==false && isgroundingline==false) continue;
62 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHorizAnalysisEnum && isdiagnostic==false) continue;
63 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticVertAnalysisEnum && isdiagnostic==false) continue;
64 if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHutterAnalysisEnum && isdiagnostic==false) continue;
65 if(solution_type==SteadystateSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
66 if(solution_type==SteadystateSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
67 if(solution_type==SteadystateSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
68
69 if(VerboseMProcessor()) _pprintLine_(" creating datasets for analysis " << EnumToStringx(analysis_type));
70 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,rootpath,solution_type,analysis_type,nummodels,i);
71 }
72
73 /*Free resources:*/
74 delete iomodel;
75
76 /*Assign output pointers:*/
77 *pelements=elements;
78 *pnodes=nodes;
79 *pvertices=vertices;
80 *pmaterials=materials;
81 *pconstraints=constraints;
82 *ploads=loads;
83 *pparameters=parameters;
84
85}
Note: See TracBrowser for help on using the repository browser.