source: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp@ 8303

Last change on this file since 8303 was 8303, checked in by seroussi, 14 years ago

changed from grid to node in c

File size: 2.4 KB
Line 
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
15void CreateNodesDiagnosticHutter(Nodes** pnodes, IoModel* iomodel,ConstDataHandle iomodel_handle){
16
17 /*Intermediary*/
18 int i;
19 bool continuous_galerkin=true;
20
21 /*DataSets: */
22 Nodes* nodes = NULL;
23
24 /*Recover pointer: */
25 nodes=*pnodes;
26
27 /*Create nodes if they do not exist yet*/
28 if(!nodes) nodes = new Nodes(NodesEnum);
29
30 /*Now, is the flag ishutter on? otherwise, do nothing: */
31 if (!iomodel->ishutter)goto cleanup_and_return;
32
33 /*Continuous Galerkin partition of nodes: */
34 NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,iomodel_handle,continuous_galerkin);
35
36 /*First fetch data: */
37 IoModelFetchData(&iomodel->nodeonbed,NULL,NULL,iomodel_handle,"nodeonbed");
38 IoModelFetchData(&iomodel->nodeonsurface,NULL,NULL,iomodel_handle,"nodeonsurface");
39 IoModelFetchData(&iomodel->nodeonhutter,NULL,NULL,iomodel_handle,"nodeonhutter");
40 IoModelFetchData(&iomodel->nodeonicesheet,NULL,NULL,iomodel_handle,"nodeonicesheet");
41 IoModelFetchData(&iomodel->nodeoniceshelf,NULL,NULL,iomodel_handle,"nodeoniceshelf");
42 IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
43 IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
44 IoModelFetchData(&iomodel->nodeonwater,NULL,NULL,iomodel_handle,"nodeonwater");
45
46 CreateNumberNodeToElementConnectivity(iomodel);
47
48 for (i=0;i<iomodel->numberofvertices;i++){
49
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 xfree((void**)&iomodel->nodeonbed);
60 xfree((void**)&iomodel->nodeonsurface);
61 xfree((void**)&iomodel->nodeonhutter);
62 xfree((void**)&iomodel->nodeonicesheet);
63 xfree((void**)&iomodel->nodeoniceshelf);
64 xfree((void**)&iomodel->elements);
65 xfree((void**)&iomodel->nodeonwater);
66 xfree((void**)&iomodel->numbernodetoelementconnectivity);
67 xfree((void**)&iomodel->vertices_type);
68
69 cleanup_and_return:
70
71 /*Assign output pointer: */
72 *pnodes=nodes;
73}
Note: See TracBrowser for help on using the repository browser.