Changeset 23505


Ignore:
Timestamp:
12/05/18 15:03:06 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: converting my_vertices back to bool

Location:
issm/trunk-jpl/src/c
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r23372 r23505  
    9292        iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing");
    9393        iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase");
    94 
    9594}/*}}}*/
    9695void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
  • issm/trunk-jpl/src/c/classes/IoModel.cpp

    r23319 r23505  
    247247        xDelete<bool>(this->my_faces);
    248248        xDelete<bool>(this->my_edges);
    249         xDelete<int>(this->my_vertices);
     249        xDelete<bool>(this->my_vertices);
    250250
    251251        xDelete<int>(this->elements);
  • issm/trunk-jpl/src/c/classes/IoModel.h

    r23167 r23505  
    6666                bool *my_faces;
    6767                bool *my_edges;
    68                 int *my_vertices;
     68                bool *my_vertices;
    6969
    7070                /*Mesh properties and connectivity tables*/
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp

    r23285 r23505  
    2828
    2929                case P1DGEnum:
    30                         NodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel,false);
     30                        DiscontinuousGalerkinNodesPartitioning(&my_nodes,iomodel->my_elements,iomodel->my_vertices,iomodel);
    3131                        for(i=0;i<iomodel->numberofelements;i++){
    3232                                for(j=0;j<3;j++){
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp

    r22617 r23505  
    6969                parameters->AddObject(iomodel->CopyConstantObject("md.qmu.numberofpartitions",QmuNumberofpartitionsEnum));
    7070                iomodel->FetchData(&dpart,NULL,NULL,"md.qmu.partition");
    71                 if(!dpart){
    72                         /*Partition elements and vertices and nodes: */
    73                         ElementsAndVerticesPartitioning(&iomodel->my_elements,&iomodel->my_vertices,iomodel);
    74 
    75                         dpart=xNew<double>(iomodel->numberofvertices);
    76                         for(i=0;i<iomodel->numberofvertices;i++)dpart[i]=iomodel->my_vertices[i];
    77                 }
     71                if(!dpart) _error_("md.qmu.partition is empty");
    7872                parameters->AddObject(new DoubleVecParam(QmuPartitionEnum,dpart,iomodel->numberofvertices));
    7973
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp

    r23504 r23505  
    1515#include "../ModelProcessorx/ModelProcessorx.h"
    1616
    17 void  ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel){
     17void  ElementsAndVerticesPartitioning(bool** pmy_elements,bool** pmy_vertices,IoModel* iomodel){
    1818
    1919        int numberofelements2d;
     
    2323
    2424        /*intermediary: */
    25         int        *epart          = NULL; //element partitioning.
    26         int        *npart          = NULL; //node partitioning.
    27         int         elements_width;        //number of columns in elements (2d->3, 3d->6)
    28         int         el1,el2;
    29         int        *elements2d     = NULL;
     25        int *epart          = NULL; //element partitioning.
     26        int *npart          = NULL; //node partitioning.
     27        int  elements_width;        //number of columns in elements (2d->3, 3d->6)
     28        int *elements2d     = NULL;
    3029
    3130        /*Get my_rank:*/
     
    7574                for(int i=0;i<numrifts;i++){
    7675                        const int RIFTINFOSIZE = 12;
    77                         el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing
    78                         el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing
     76                        int el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing
     77                        int el2=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+3))-1; //matlab indexing to c indexing
    7978                        epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices;
    8079                }
     
    8483        /*Create my_vertices and my_elements, used by each partition */
    8584        bool *my_elements = xNewZeroInit<bool>(iomodel->numberofelements);
    86         int  *my_vertices = xNewZeroInit<int>(iomodel->numberofvertices);
     85        bool *my_vertices = xNewZeroInit<bool>(iomodel->numberofvertices);
    8786
    8887        /*Start figuring out, out of the partition, which elements belong to this cpu: */
     
    9796                         will hold which vertices belong to this partition*/
    9897                        for(int j=0;j<elements_width;j++){
    99                                 my_vertices[iomodel->elements[elements_width*i+j]-1]=1;
     98                                my_vertices[iomodel->elements[elements_width*i+j]-1]=true;
    10099                        }
    101100                }
     
    109108        for(int i=0;i<numvertex_pairing;i++){
    110109                if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){
    111                         my_vertices[vertex_pairing[2*i+1]-1]=2; //to know that these elements are not on the partition
     110                        my_vertices[vertex_pairing[2*i+1]-1]=true;
    112111                }
    113112        }
     
    116115        for(int i=0;i<numvertex_pairing;i++){
    117116                if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){
    118                         my_vertices[vertex_pairing[2*i+1]-1]=2; //to know that these elements are not on the partition
     117                        my_vertices[vertex_pairing[2*i+1]-1]=true;
    119118                }
    120119        }
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r23493 r23505  
    2525
    2626/*partitioning: */
    27 void ElementsAndVerticesPartitioning(bool** pmy_elements, int** pmy_vertices, IoModel* iomodel);
    28 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices,  IoModel* iomodel, bool continuous);
     27void ElementsAndVerticesPartitioning(bool** pmy_elements,bool** pmy_vertices, IoModel* iomodel);
     28void DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices,  IoModel* iomodel);
    2929void FacesPartitioning(IoModel* iomodel);
    3030void EdgesPartitioning(IoModel* iomodel);
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/NodesPartitioning.cpp

    r18946 r23505  
    1515#include "../ModelProcessorx/ModelProcessorx.h"
    1616
    17 void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel);
    18 void  ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel);
    19 
    20 void  NodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel, bool continuous){
    21 
    22         if(continuous==true)
    23                 ContinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel);
    24         else
    25                 DiscontinuousGalerkinNodesPartitioning(pmy_nodes,my_elements, my_vertices, iomodel);
    26 }
    27 
    28 void  ContinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
    29 
    30         /*output: */
    31         bool* my_nodes=xNew<bool>(iomodel->numberofvertices);
    32         for(int i=0;i<iomodel->numberofvertices;i++) my_nodes[i]=(bool)my_vertices[i];
    33 
    34         /*Assign output pointers:*/
    35         *pmy_nodes=my_nodes;
    36 }
    37 
    38 void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements, int* my_vertices, IoModel* iomodel){
     17void  DiscontinuousGalerkinNodesPartitioning(bool** pmy_nodes,bool* my_elements,bool* my_vertices, IoModel* iomodel){
    3918
    4019        /* Each element has it own nodes (as many as vertices) + additional nodes
Note: See TracChangeset for help on using the changeset viewer.