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