Ignore:
Timestamp:
04/16/12 14:57:18 (13 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 11994M

Location:
issm/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • TabularUnified issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp

    r10400 r11995  
    1717        double*  vertices_ungrounding             = NULL;
    1818        double*  old_floatingice                  = NULL;
    19         Vec      vec_old_floatingice              = NULL;
     19        Vector*      vec_old_floatingice              = NULL;
    2020        Element* element                          = NULL;
    2121       
     
    3939        /*Create vector with vertices initially floating and serialize*/
    4040        vec_old_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
    41         VecToMPISerial(&old_floatingice,vec_old_floatingice);
     41        old_floatingice=vec_old_floatingice->ToMPISerial();
    4242
    4343        /*Migrate grounding line : */
     
    4848
    4949        /*free ressouces: */
    50         VecFree(&vec_old_floatingice);
     50        xdelete(&vec_old_floatingice);
    5151        xfree((void**)&vertices_potentially_ungrounding);
    5252        xfree((void**)&vertices_ungrounding);
     
    5555
    5656/*FUNCTION CreateNodesOnFloatingIce {{{1*/
    57 Vec CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
     57Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
    5858
    5959        int     i,numnods;
    60         Vec   vec_nodes_on_floatingice = NULL;
     60        Vector*   vec_nodes_on_floatingice = NULL;
    6161        Node *node                     = NULL;
    6262
    6363        /*First, initialize nodes_on_floatingice, which will track which nodes have changed status: */
    6464        numnods=nodes->NumberOfNodes(configuration_type);
    65         vec_nodes_on_floatingice=NewVec(numnods);
     65        vec_nodes_on_floatingice=new Vector(numnods);
    6666
    6767        /*Loop through nodes, and fill vec_nodes_on_floatingice: */
     
    7070                if(node->InAnalysis(configuration_type)){
    7171                        if(node->IsFloating()){
    72                                 VecSetValue(vec_nodes_on_floatingice,node->Sid(),1.0,INSERT_VALUES);
     72                                vec_nodes_on_floatingice->SetValue(node->Sid(),1.0,INS_VAL);
    7373                        }
    7474                }
     
    7676
    7777        /*Assemble vector: */
    78         VecAssemblyBegin(vec_nodes_on_floatingice);
    79         VecAssemblyEnd(vec_nodes_on_floatingice);
     78        vec_nodes_on_floatingice->Assemble();
    8079
    8180        return vec_nodes_on_floatingice;
     
    8786        int      i,numberofvertices;
    8887        double*  vertices_potentially_ungrounding      = NULL;
    89         Vec      vec_vertices_potentially_ungrounding  = NULL;
     88        Vector*      vec_vertices_potentially_ungrounding  = NULL;
    9089        Element* element                               = NULL;
    9190
    9291        /*Initialize vector with number of vertices*/
    9392        numberofvertices=vertices->NumberOfVertices();
    94         vec_vertices_potentially_ungrounding=NewVec(numberofvertices); //grounded vertex that could start floating
     93        vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating
    9594
    9695        /*Fill vector vertices_potentially_floating: */
     
    101100
    102101        /*Assemble vector and serialize */
    103         VecAssemblyBegin(vec_vertices_potentially_ungrounding);
    104         VecAssemblyEnd(vec_vertices_potentially_ungrounding);
    105         VecToMPISerial(&vertices_potentially_ungrounding,vec_vertices_potentially_ungrounding);
     102        vec_vertices_potentially_ungrounding->Assemble();
     103        vertices_potentially_ungrounding=vec_vertices_potentially_ungrounding->ToMPISerial();
    106104
    107105        /*free ressouces and return: */
    108         VecFree(&vec_vertices_potentially_ungrounding);
     106        xdelete(&vec_vertices_potentially_ungrounding);
    109107        return vertices_potentially_ungrounding;
    110108}
     
    118116        double*  nodes_on_floatingice                  = NULL;
    119117        double*  elements_neighboring_floatingce      = NULL;
    120         Vec      vec_elements_neighboring_floatingice = NULL;
    121         Vec      vec_nodes_on_floatingice              = NULL;
     118        Vector*      vec_elements_neighboring_floatingice = NULL;
     119        Vector*      vec_nodes_on_floatingice              = NULL;
    122120        Node*    node                                  = NULL;
    123121        Element* element                               = NULL;
     
    130128        /*recover vec_nodes_on_floatingice*/
    131129        vec_nodes_on_floatingice=CreateNodesOnFloatingIce(nodes,analysis_type);
    132         VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
     130        nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial();
    133131
    134132        nflipped=1; //bootstrap
     
    136134               
    137135                /*Vector of size number of elements*/
    138                 vec_elements_neighboring_floatingice=NewVec(elements->NumberOfElements(),true);
     136                vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true);
    139137
    140138                /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
    141139                for(i=0;i<elements->Size();i++){
    142140                        element=(Element*)elements->GetObjectByOffset(i);
    143                         VecSetValue(vec_elements_neighboring_floatingice,element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INSERT_VALUES);
     141                        vec_elements_neighboring_floatingice->SetValue(element->Sid(),element->IsNodeOnShelfFromFlags(nodes_on_floatingice)?1.0:0.0,INS_VAL);
    144142                }
    145143
    146144                /*Assemble vector and serialize: */
    147                 VecAssemblyBegin(vec_elements_neighboring_floatingice);
    148                 VecAssemblyEnd(vec_elements_neighboring_floatingice);
    149                 VecToMPISerial(&elements_neighboring_floatingce,vec_elements_neighboring_floatingice);
     145                vec_elements_neighboring_floatingice->Assemble();
     146                elements_neighboring_floatingce=vec_elements_neighboring_floatingice->ToMPISerial();
    150147
    151148                /*Go through elements_neighboring_floatingce, and update vector of the nodes that will start floating*/
     
    157154                        }
    158155                }
    159                 VecAssemblyBegin(vec_nodes_on_floatingice);
    160                 VecAssemblyEnd(vec_nodes_on_floatingice);
     156                vec_nodes_on_floatingice->Assemble();
    161157               
    162158                MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
     
    168164
    169165                /*Assemble and serialize:*/
    170                 VecFree(&vec_elements_neighboring_floatingice);
    171                 VecToMPISerial(&nodes_on_floatingice,vec_nodes_on_floatingice);
     166                xdelete(&vec_elements_neighboring_floatingice);
     167                nodes_on_floatingice=vec_nodes_on_floatingice->ToMPISerial();
    172168        }
    173169
    174170        /*Free ressources:*/
    175         VecFree(&vec_nodes_on_floatingice);
     171        xdelete(&vec_nodes_on_floatingice);
    176172        xfree((void**)&elements_neighboring_floatingce);
    177173
Note: See TracChangeset for help on using the changeset viewer.