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