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