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

Last change on this file since 9356 was 9356, checked in by Eric.Larour, 14 years ago

Major rewrite of the code so that IoModel now has a parameters dataset, which gets
loaded with all the int,char and double objects in the input file.
This is a lot more flexible, as anyone can add a field to the model, and it will
automatically appear in the IoModel parameters dataset.

Not debugged with respect to nightly runs yet. Trying to get the whole change finished.

File size: 2.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 "../../Container/Container.h"
14#include "../../EnumDefinitions/EnumDefinitions.h"
15#include "../../include/include.h"
16#include "../../modules/modules.h"
17
18void 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){
19
20 int i;
21 int analysis_type;
22 int dim;
23 int verbose;
24
25 /*output: */
26 Elements *elements = NULL;
27 Nodes *nodes = NULL;
28 Vertices *vertices = NULL;
29 Materials *materials = NULL;
30 Constraints *constraints = NULL;
31 Loads *loads = NULL;
32 Parameters *parameters = NULL;
33
34
35 /*Initialize IoModel from input file*/
36 IoModel* iomodel = new IoModel(IOMODEL);
37
38 /*Fetch parameters: */
39 iomodel->parameters->FindParam(&dim,DimEnum);
40 iomodel->parameters->FindParam(&verbose,VerboseEnum);
41
42 SetVerbosityLevel(verbose);
43
44 for(i=0;i<nummodels;i++){
45
46 analysis_type=analysis_type_list[i];
47
48 /*Hack for trasient runs (to be improved)*/
49 if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue;
50 if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue;
51
52 _printf_(VerboseMProcessor()," create datasets for analysis %s\n",EnumToStringx(analysis_type));
53 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,solution_type,analysis_type,nummodels,i);
54 }
55
56 /*Free ressources:*/
57 delete iomodel;
58
59 /*Assign output pointers:*/
60 *pelements=elements;
61 *pnodes=nodes;
62 *pvertices=vertices;
63 *pmaterials=materials;
64 *pconstraints=constraints;
65 *ploads=loads;
66 *pparameters=parameters;
67
68}
Note: See TracBrowser for help on using the repository browser.