1 | /*
|
---|
2 | * CreateNodesDiagnosticHutter.c:
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "../../../Container/Container.h"
|
---|
6 | #include "../../../toolkits/toolkits.h"
|
---|
7 | #include "../../../io/io.h"
|
---|
8 | #include "../../../EnumDefinitions/EnumDefinitions.h"
|
---|
9 | #include "../../../classes/objects/objects.h"
|
---|
10 | #include "../../../shared/shared.h"
|
---|
11 | #include "../../MeshPartitionx/MeshPartitionx.h"
|
---|
12 | #include "../../../include/include.h"
|
---|
13 | #include "../ModelProcessorx.h"
|
---|
14 |
|
---|
15 | void CreateNodesDiagnosticHutter(Nodes** pnodes, IoModel* iomodel){
|
---|
16 |
|
---|
17 | /*Intermediary*/
|
---|
18 | int i;
|
---|
19 | bool continuous_galerkin=true;
|
---|
20 | int numberofvertices;
|
---|
21 | bool ishutter;
|
---|
22 |
|
---|
23 | /*Fetch parameters: */
|
---|
24 | iomodel->Constant(&numberofvertices,MeshNumberofverticesEnum);
|
---|
25 | iomodel->Constant(&ishutter,FlowequationIshutterEnum);
|
---|
26 |
|
---|
27 | /*Recover pointer: */
|
---|
28 | Nodes* nodes=*pnodes;
|
---|
29 |
|
---|
30 | /*Create nodes if they do not exist yet*/
|
---|
31 | if(!nodes) nodes = new Nodes();
|
---|
32 |
|
---|
33 | /*Now, is the flag ishutter on? otherwise, do nothing: */
|
---|
34 | if(!ishutter){
|
---|
35 | *pnodes=nodes;
|
---|
36 | return;
|
---|
37 | }
|
---|
38 |
|
---|
39 | /*Continuous Galerkin partition of nodes: */
|
---|
40 | NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
|
---|
41 |
|
---|
42 | /*First fetch data: */
|
---|
43 | iomodel->FetchData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MeshElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
|
---|
44 |
|
---|
45 | for (i=0;i<numberofvertices;i++){
|
---|
46 | if(iomodel->my_vertices[i]){
|
---|
47 |
|
---|
48 | /*Add node to nodes dataset: */
|
---|
49 | nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticHutterAnalysisEnum));
|
---|
50 |
|
---|
51 | }
|
---|
52 | }
|
---|
53 |
|
---|
54 | /*Clean fetched data: */
|
---|
55 | iomodel->DeleteData(7,MeshVertexonbedEnum,MeshVertexonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,MeshElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
|
---|
56 |
|
---|
57 | /*Assign output pointer: */
|
---|
58 | *pnodes=nodes;
|
---|
59 | }
|
---|