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