Changeset 4005


Ignore:
Timestamp:
06/03/10 07:37:08 (15 years ago)
Author:
Mathieu Morlighem
Message:

Updated CreateNodes

Location:
issm/trunk/src/c/modules/ModelProcessorx
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
    2726
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    4746
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
    68 
    6963}
  • issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness2/CreateNodesBalancedthickness2.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=false;
    2120
     
    2322        DataSet* nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
    2726
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    5958
    6059                                /*Add node to nodes dataset: */
    61                                 nodes->AddObject(new Node(i+1,vertex_index,node_index,iomodel));
     60                                nodes->AddObject(new Node(iomodel->nodecounter+i+1,vertex_index,node_index,iomodel));
    6261
    6362                        }
     
    7574        xfree((void**)&iomodel->elements);
    7675
    77         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    78          * datasets, it will not be redone: */
    79         nodes->Presort();
    80 
    8176        /*Assign output pointer: */
    8277        *pnodes=nodes;
  • issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
    2726
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    4746                       
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160       
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
    68 
    6963}
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp

    r4002 r4005  
    1717        /*Intermediary*/
    1818        int i;
     19        int totalnodes;
    1920        bool continuous_galerkin=true;
    2021
     
    2223        DataSet*    nodes = NULL;
    2324
    24         /*Recover pointer: */
    25         nodes=*pnodes;
    26 
    27         /*Create nodes if they do not exist yet*/
    28         if(!nodes) nodes = new DataSet(NodesEnum);
     25        /*First create nodes*/
     26        nodes = new DataSet(NodesEnum);
    2927       
    3028        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    3129        if (!iomodel->ismacayealpattyn)goto cleanup_and_return;
     30
     31        /*Recover number of nodes already created in other analyses: */
     32        totalnodes=iomodel->nodecounter;
    3233
    3334        /*Continuous Galerkin partition of nodes: */
     
    5051                       
    5152                        /*Add node to nodes dataset: */
    52                         nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel,DiagnosticHorizAnalysisEnum));
     53                        nodes->AddObject(new Node(totalnodes+i+1,i,iomodel,DiagnosticHorizAnalysisEnum));
    5354                }
    5455        }
    5556
    56        
     57        /*Increase nodecounter for other analyses to start their node indexing correctly: */
     58        totalnodes+=iomodel->numberofvertices;
     59        iomodel->nodecounter=totalnodes;
     60
    5761        /*Clean fetched data: */
    5862        xfree((void**)&iomodel->gridonbed);
     
    6468        xfree((void**)&iomodel->uppernodes);
    6569
     70        /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
     71         * datasets, it will not be redone: */
     72        nodes->Presort();
     73
    6674        /*Assign output pointer: */
    6775        *pnodes=nodes;
     76
    6877}
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes     = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    2729
    2830        /*Now, is the flag ishutter on? otherwise, do nothing: */
    2931        if (!iomodel->ishutter)goto cleanup_and_return;
    30 
    31         /*Recover number of nodes already created in other analyses: */
    32         totalnodes=iomodel->nodecounter;
    3332
    3433        /*Continuous Galerkin partition of nodes: */
     
    5352
    5453                        /*Add node to nodes dataset: */
    55                         nodes->AddObject(new Node(i+1,i,iomodel));
     54                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5655
    5756                }
     
    6968        xfree((void**)&iomodel->numbernodetoelementconnectivity);
    7069
    71         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    72          * datasets, it will not be redone: */
    73         elements->Presort();
    74 
    7570        cleanup_and_return:
    7671
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    2729
    2830        /*Now, do we have Stokes elements?*/
    29         if (iomodel->dim==2) goto cleanup_and_return;
    30         if (!iomodel->isstokes)                goto cleanup_and_return;
    31 
    32         /*Recover number of nodes already created in other analyses: */
    33         totalnodes=iomodel->nodecounter;
     31        if (iomodel->dim==2)    goto cleanup_and_return;
     32        if (!iomodel->isstokes) goto cleanup_and_return;
    3433
    3534        /*Continuous Galerkin partition of nodes: */
     
    5150
    5251                        /*Add node to nodes dataset: */
    53                         nodes->AddObject(new Node(i+1,i,iomodel));
     52                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5453
    5554                }
     
    6665        xfree((void**)&iomodel->gridoniceshelf);
    6766
    68         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    69          * datasets, it will not be redone: */
    70         nodes->Presort();
    71 
    7267        cleanup_and_return:
    7368
    7469        /*Assign output pointer: */
    7570        *pnodes=nodes;
    76 
    7771}
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create the elements, nodes and material properties: */
    26         nodes     = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    2729
    2830        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    2931        if (iomodel->dim==2)goto cleanup_and_return;
    30 
    31         /*Recover number of nodes already created in other analyses: */
    32         totalnodes=iomodel->nodecounter;
    3332
    3433        /*Continuous Galerkin partition of nodes: */
     
    4847
    4948                        /*Add node to nodes dataset: */
    50                         nodes->AddObject(new Node(i+1,i,iomodel));
     49                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5150
    5251                }
     
    6160        xfree((void**)&iomodel->gridoniceshelf);
    6261       
    63         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    64          * datasets, it will not be redone: */
    65         nodes->Presort();
    66 
    6762        cleanup_and_return:
    6863
    6964        /*Assign output pointer: */
    7065        *pnodes=nodes;
    71 
    7266}
  • issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
    2221        /*DataSets: */
    2322        DataSet*    nodes = NULL;
    24        
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
    2723
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    4746                       
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
    2221        /*DataSets: */
    2322        DataSet*    nodes = NULL;
    24        
    25         /*First create nodes*/
    26         nodes     = new DataSet(NodesEnum);
    2723
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    4746
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
    68 
    6963}
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic2/CreateNodesPrognostic2.cpp

    r3999 r4005  
    1919        int vertex_index;
    2020        int node_index;
    21         int totalnodes;
    2221        bool continuous_galerkin=false;
    2322
     
    2524        DataSet* nodes = NULL;
    2625
    27         /*First create nodes*/
    28         nodes     = new DataSet(NodesEnum);
     26        /*Recover pointer: */
     27        nodes=*pnodes;
    2928
    30         /*Recover number of nodes already created in other analyses: */
    31         totalnodes=iomodel->nodecounter;
     29        /*Create nodes if they do not exist yet*/
     30        if(!nodes) nodes = new DataSet(NodesEnum);
    3231
    3332        /*Continuous Galerkin partition of nodes: */
     
    6059
    6160                                /*Add node to nodes dataset: */
    62                                 nodes->AddObject(new Node(node_index+1,vertex_index,node_index,iomodel));
     61                                nodes->AddObject(new Node(iomodel->nodecounter+node_index+1,vertex_index,node_index,iomodel));
    6362
    6463                        }
     
    7574        xfree((void**)&iomodel->gridoniceshelf);
    7675
    77         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    78          * datasets, it will not be redone: */
    79         nodes->Presort();
    80 
    8176        /*Assign output pointer: */
    8277        *pnodes=nodes;
  • issm/trunk/src/c/modules/ModelProcessorx/SlopeCompute/CreateNodesSlopeConpute.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
    2221        /*DataSets: */
    2322        DataSet*    nodes = NULL;
     23
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    2429       
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
    27 
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
    30 
    3130        /*Continuous Galerkin partition of nodes: */
    3231        NodesPartitioning(&iomodel->my_nodes,iomodel->my_elements, iomodel->my_vertices, iomodel->my_bordervertices, iomodel, iomodel_handle,continuous_galerkin);
     
    4746                       
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160       
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
    68 
    6963}
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp

    r3999 r4005  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423       
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
    2726
    28         /*Recover number of nodes already created in other analyses: */
    29         totalnodes=iomodel->nodecounter;
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    3029
    3130        /*Continuous Galerkin partition of nodes: */
     
    4746                       
    4847                        /*Add node to nodes dataset: */
    49                         nodes->AddObject(new Node(i+1,i,iomodel));
     48                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel));
    5049
    5150                }
     
    6059        xfree((void**)&iomodel->gridoniceshelf);
    6160       
    62         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    63          * datasets, it will not be redone: */
    64         nodes->Presort();
    65 
    6661        /*Assign output pointer: */
    6762        *pnodes=nodes;
    68 
    6963}
Note: See TracChangeset for help on using the changeset viewer.