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

Last change on this file since 12706 was 12706, checked in by Mathieu Morlighem, 13 years ago

merged trunk-jpl and trunk for revision 12703

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