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 "../../../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 | /*DataSets: */
|
---|
24 | Nodes* nodes = NULL;
|
---|
25 |
|
---|
26 | /*Fetch parameters: */
|
---|
27 | iomodel->Constant(&numberofvertices,NumberOfVerticesEnum);
|
---|
28 | iomodel->Constant(&ishutter,FlowequationIshutterEnum);
|
---|
29 |
|
---|
30 | /*Recover pointer: */
|
---|
31 | nodes=*pnodes;
|
---|
32 |
|
---|
33 | /*Create nodes if they do not exist yet*/
|
---|
34 | if(!nodes) nodes = new Nodes(NodesEnum);
|
---|
35 |
|
---|
36 | /*Now, is the flag ishutter on? otherwise, do nothing: */
|
---|
37 | if(!ishutter){
|
---|
38 | *pnodes=nodes;
|
---|
39 | return;
|
---|
40 | }
|
---|
41 |
|
---|
42 | /*Continuous Galerkin partition of nodes: */
|
---|
43 | NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,continuous_galerkin);
|
---|
44 |
|
---|
45 | /*First fetch data: */
|
---|
46 | iomodel->FetchData(7,NodeonbedEnum,NodeonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,ElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
|
---|
47 | CreateNumberNodeToElementConnectivity(iomodel);
|
---|
48 |
|
---|
49 | for (i=0;i<numberofvertices;i++){
|
---|
50 | if(iomodel->my_vertices[i]){
|
---|
51 |
|
---|
52 | /*Add node to nodes dataset: */
|
---|
53 | nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,i+1,i,iomodel,DiagnosticHutterAnalysisEnum));
|
---|
54 |
|
---|
55 | }
|
---|
56 | }
|
---|
57 |
|
---|
58 | /*Clean fetched data: */
|
---|
59 | iomodel->DeleteData(7,NodeonbedEnum,NodeonsurfaceEnum,MaskVertexongroundediceEnum,MaskVertexonfloatingiceEnum,ElementsEnum,FlowequationVertexEquationEnum,MaskVertexonwaterEnum);
|
---|
60 |
|
---|
61 | /*Assign output pointer: */
|
---|
62 | *pnodes=nodes;
|
---|
63 | }
|
---|