1 | /*!\file: CreateDataSets
|
---|
2 | * \brief general driver for creating all datasets that make a finite element iomodel
|
---|
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 "../../include/include.h"
|
---|
14 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
---|
15 | #include "./ModelProcessorx.h"
|
---|
16 |
|
---|
17 | void CreateDataSets(Elements** pelements,Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads,Parameters** pparameters,IoModel* iomodel,char* rootpath,const int solution_type,const int analysis_type,const int nummodels,int analysis_counter){
|
---|
18 |
|
---|
19 | bool continuous = true;
|
---|
20 | Elements *elements = NULL;
|
---|
21 | Materials *materials = NULL;
|
---|
22 | Parameters *parameters = NULL;
|
---|
23 |
|
---|
24 | /*Create elements, vertices and materials, independent of analysis_type: */
|
---|
25 | CreateElementsVerticesAndMaterials(pelements, pvertices, pmaterials, iomodel,nummodels);
|
---|
26 |
|
---|
27 | /*Recover elements and materials, for future update: */
|
---|
28 | elements=*pelements;
|
---|
29 | materials=*pmaterials;
|
---|
30 |
|
---|
31 | /*Now, branch onto analysis dependent model generation: */
|
---|
32 | switch(analysis_type){
|
---|
33 |
|
---|
34 | #ifdef _HAVE_DIAGNOSTIC_
|
---|
35 | case DiagnosticHorizAnalysisEnum:
|
---|
36 | CreateNodesDiagnosticHoriz(pnodes, iomodel);
|
---|
37 | CreateConstraintsDiagnosticHoriz(pconstraints,iomodel);
|
---|
38 | CreateLoadsDiagnosticHoriz(ploads,iomodel);
|
---|
39 | UpdateElementsDiagnosticHoriz(elements,iomodel,analysis_counter,analysis_type);
|
---|
40 | break;
|
---|
41 |
|
---|
42 | case DiagnosticVertAnalysisEnum:
|
---|
43 | CreateNodesDiagnosticVert(pnodes, iomodel);
|
---|
44 | CreateConstraintsDiagnosticVert(pconstraints,iomodel);
|
---|
45 | CreateLoadsDiagnosticVert(ploads,iomodel);
|
---|
46 | UpdateElementsDiagnosticVert(elements,iomodel,analysis_counter,analysis_type);
|
---|
47 | break;
|
---|
48 |
|
---|
49 | case DiagnosticHutterAnalysisEnum:
|
---|
50 | CreateNodesDiagnosticHutter(pnodes, iomodel);
|
---|
51 | CreateConstraintsDiagnosticHutter(pconstraints,iomodel);
|
---|
52 | CreateLoadsDiagnosticHutter(ploads,iomodel);
|
---|
53 | UpdateElementsDiagnosticHutter(elements,iomodel,analysis_counter,analysis_type);
|
---|
54 | break;
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #ifdef _HAVE_HYDROLOGY_
|
---|
58 | case HydrologyAnalysisEnum:
|
---|
59 | CreateNodesHydrology(pnodes, iomodel);
|
---|
60 | CreateConstraintsHydrology(pconstraints,iomodel);
|
---|
61 | CreateLoadsHydrology(ploads,iomodel);
|
---|
62 | UpdateElementsHydrology(elements,iomodel,analysis_counter,analysis_type);
|
---|
63 | break;
|
---|
64 | #endif
|
---|
65 |
|
---|
66 | #ifdef _HAVE_THERMAL_
|
---|
67 | case ThermalAnalysisEnum:
|
---|
68 | CreateNodesThermal(pnodes, iomodel);
|
---|
69 | CreateConstraintsThermal(pconstraints,iomodel);
|
---|
70 | CreateLoadsThermal(ploads,iomodel);
|
---|
71 | UpdateElementsThermal(elements,iomodel,analysis_counter,analysis_type);
|
---|
72 | break;
|
---|
73 |
|
---|
74 | case EnthalpyAnalysisEnum:
|
---|
75 | CreateNodesEnthalpy(pnodes, iomodel);
|
---|
76 | CreateConstraintsEnthalpy(pconstraints,iomodel);
|
---|
77 | CreateLoadsEnthalpy(ploads,iomodel);
|
---|
78 | UpdateElementsEnthalpy(elements,iomodel,analysis_counter,analysis_type);
|
---|
79 | break;
|
---|
80 |
|
---|
81 | case MeltingAnalysisEnum:
|
---|
82 | CreateNodesMelting(pnodes, iomodel);
|
---|
83 | CreateConstraintsMelting(pconstraints,iomodel);
|
---|
84 | CreateLoadsMelting(ploads,iomodel);
|
---|
85 | UpdateElementsMelting(elements,iomodel,analysis_counter,analysis_type);
|
---|
86 | break;
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | #ifdef _HAVE_BALANCED_
|
---|
90 | case BalancethicknessAnalysisEnum:
|
---|
91 | CreateNodesBalancethickness(pnodes, iomodel);
|
---|
92 | CreateConstraintsBalancethickness(pconstraints,iomodel);
|
---|
93 | CreateLoadsBalancethickness(ploads,iomodel);
|
---|
94 | UpdateElementsBalancethickness(elements,iomodel,analysis_counter,analysis_type);
|
---|
95 | break;
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | #ifdef _HAVE_SLOPE_
|
---|
99 | case BedSlopeAnalysisEnum:
|
---|
100 | CreateNodesBedSlope(pnodes, iomodel);
|
---|
101 | CreateConstraintsBedSlope(pconstraints,iomodel);
|
---|
102 | CreateLoadsBedSlope(ploads,iomodel);
|
---|
103 | UpdateElementsBedSlope(elements,iomodel,analysis_counter,analysis_type);
|
---|
104 | break;
|
---|
105 |
|
---|
106 | case SurfaceSlopeAnalysisEnum:
|
---|
107 | CreateNodesSurfaceSlope(pnodes, iomodel);
|
---|
108 | CreateConstraintsSurfaceSlope(pconstraints,iomodel);
|
---|
109 | CreateLoadsSurfaceSlope(ploads,iomodel);
|
---|
110 | UpdateElementsSurfaceSlope(elements,iomodel,analysis_counter,analysis_type);
|
---|
111 | break;
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #ifdef _HAVE_PROGNOSTIC_
|
---|
115 | case PrognosticAnalysisEnum:
|
---|
116 | CreateNodesPrognostic(pnodes, iomodel);
|
---|
117 | CreateConstraintsPrognostic(pconstraints,iomodel);
|
---|
118 | CreateLoadsPrognostic(ploads,iomodel);
|
---|
119 | UpdateElementsPrognostic(elements,iomodel,analysis_counter,analysis_type);
|
---|
120 | break;
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | default:
|
---|
124 | _error_("analysis_type: " << EnumToStringx(analysis_type) << " not supported yet!");
|
---|
125 | }
|
---|
126 |
|
---|
127 | /*Update Elements and Materials For Control methods*/
|
---|
128 | #ifdef _HAVE_CONTROL_
|
---|
129 | UpdateElementsAndMaterialsControl(elements,materials,iomodel);
|
---|
130 | #endif
|
---|
131 |
|
---|
132 | /*Generate objects that are not dependent on any analysis_type: */
|
---|
133 | CreateParameters(pparameters,iomodel,rootpath,solution_type,analysis_type,analysis_counter);
|
---|
134 |
|
---|
135 | /*Update Elements in case we are running a transient solution: */
|
---|
136 | #ifdef _HAVE_TRANSIENT_
|
---|
137 | parameters=*pparameters;
|
---|
138 | if(analysis_counter==(nummodels-1)&& solution_type==TransientSolutionEnum){
|
---|
139 | UpdateElementsTransient(elements,parameters,iomodel,analysis_counter,analysis_type);
|
---|
140 | }
|
---|
141 | #endif
|
---|
142 |
|
---|
143 | /*Sort datasets: */
|
---|
144 | SortDataSets(pelements,pnodes,pvertices, ploads, pmaterials, pconstraints, pparameters);
|
---|
145 |
|
---|
146 | /*Update counters, because we have created more nodes, loads and constraints, and ids for objects created in next call to CreateDataSets
|
---|
147 | * will need to start at the end of the updated counters: */
|
---|
148 | UpdateCounters(iomodel,pnodes,ploads,pconstraints);
|
---|
149 | }
|
---|