Ignore:
Timestamp:
09/19/12 09:32:34 (12 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 13393

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src

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

    r12706 r13395  
    1414
    1515        int      i, migration_style,analysis_type;
    16         double*  vertices_potentially_ungrounding = NULL;
    17         double*  vertices_ungrounding             = NULL;
    18         double*  old_floatingice                  = NULL;
    19         Vector*      vec_old_floatingice              = NULL;
     16        IssmDouble*  vertices_potentially_ungrounding = NULL;
     17        IssmDouble*  vertices_ungrounding             = NULL;
     18        IssmDouble*  old_floatingice                  = NULL;
     19        Vector<IssmDouble>*      vec_old_floatingice              = NULL;
    2020        Element* element                          = NULL;
    2121       
     
    2727
    2828        if(migration_style==NoneEnum) return;
    29         if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error2_(EnumToStringx(migration_style) << " not supported yet!");
     29        if(migration_style!=AgressiveMigrationEnum && migration_style!=SoftMigrationEnum) _error_(EnumToStringx(migration_style) << " not supported yet!");
    3030
    3131        if(migration_style==SoftMigrationEnum){
     
    4949        /*free ressouces: */
    5050        xdelete(&vec_old_floatingice);
    51         xDelete<double>(vertices_potentially_ungrounding);
    52         xDelete<double>(vertices_ungrounding);
    53         xDelete<double>(old_floatingice);
     51        xDelete<IssmDouble>(vertices_potentially_ungrounding);
     52        xDelete<IssmDouble>(vertices_ungrounding);
     53        xDelete<IssmDouble>(old_floatingice);
    5454}
    5555
    5656/*FUNCTION CreateNodesOnFloatingIce {{{*/
    57 Vector* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
     57Vector<IssmDouble>* CreateNodesOnFloatingIce(Nodes* nodes,int configuration_type){
    5858
    5959        int     i,numnods;
    60         Vector*   vec_nodes_on_floatingice = NULL;
     60        Vector<IssmDouble>*   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=new Vector(numnods);
     65        vec_nodes_on_floatingice=new Vector<IssmDouble>(numnods);
    6666
    6767        /*Loop through nodes, and fill vec_nodes_on_floatingice: */
     
    8282/*%}}}*/
    8383/*FUNCTION PotentialSheetUngrounding {{{*/
    84 double*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){
     84IssmDouble*    PotentialSheetUngrounding(Elements* elements,Vertices* vertices,Parameters* parameters){
    8585
    8686        int      i,numberofvertices;
    87         double*  vertices_potentially_ungrounding      = NULL;
    88         Vector*      vec_vertices_potentially_ungrounding  = NULL;
     87        IssmDouble*  vertices_potentially_ungrounding      = NULL;
     88        Vector<IssmDouble>*      vec_vertices_potentially_ungrounding  = NULL;
    8989        Element* element                               = NULL;
    9090
    9191        /*Initialize vector with number of vertices*/
    9292        numberofvertices=vertices->NumberOfVertices();
    93         vec_vertices_potentially_ungrounding=new Vector(numberofvertices); //grounded vertex that could start floating
     93        vec_vertices_potentially_ungrounding=new Vector<IssmDouble>(numberofvertices); //grounded vertex that could start floating
    9494
    9595        /*Fill vector vertices_potentially_floating: */
     
    109109/*}}}*/
    110110/*FUNCTION PropagateFloatingiceToGroundedNeighbors {{{*/
    111 double*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,double* vertices_potentially_ungrounding){
     111IssmDouble*    PropagateFloatingiceToGroundedNeighbors(Elements* elements,Nodes* nodes,Vertices* vertices,Parameters* parameters,IssmDouble* vertices_potentially_ungrounding){
    112112
    113113        int      i,analysis_type;
    114114        int      numberofvertices;
    115115        int      nflipped,local_nflipped;
    116         double*  nodes_on_floatingice                  = NULL;
    117         double*  elements_neighboring_floatingce      = NULL;
    118         Vector*      vec_elements_neighboring_floatingice = NULL;
    119         Vector*      vec_nodes_on_floatingice              = NULL;
     116        IssmDouble*  nodes_on_floatingice                  = NULL;
     117        IssmDouble*  elements_neighboring_floatingce      = NULL;
     118        Vector<IssmDouble>*      vec_elements_neighboring_floatingice = NULL;
     119        Vector<IssmDouble>*      vec_nodes_on_floatingice              = NULL;
    120120        Node*    node                                  = NULL;
    121121        Element* element                               = NULL;
     
    134134               
    135135                /*Vector of size number of elements*/
    136                 vec_elements_neighboring_floatingice=new Vector(elements->NumberOfElements(),true);
     136                vec_elements_neighboring_floatingice=new Vector<IssmDouble>(elements->NumberOfElements(),true);
    137137
    138138                /*Figure out if any of the nodes of the element will be floating -> elements neighbouting the floating ice*/
     
    150150                for(i=0;i<elements->Size();i++){
    151151                        element=(Element*)elements->GetObjectByOffset(i);
    152                         if(elements_neighboring_floatingce[element->Sid()]){
     152                        if(reCast<int,IssmDouble>(elements_neighboring_floatingce[element->Sid()])){
    153153                                local_nflipped+=element->UpdatePotentialSheetUngrounding(vertices_potentially_ungrounding,vec_nodes_on_floatingice,nodes_on_floatingice);
    154154                        }
     
    164164
    165165                /*Avoid leaks: */
    166                 xDelete<double>(elements_neighboring_floatingce);
    167                 xDelete<double>(nodes_on_floatingice);
     166                xDelete<IssmDouble>(elements_neighboring_floatingce);
     167                xDelete<IssmDouble>(nodes_on_floatingice);
    168168
    169169                /*Assemble and serialize:*/
     
    174174        /*Free ressources:*/
    175175        xdelete(&vec_nodes_on_floatingice);
    176         xDelete<double>(elements_neighboring_floatingce);
     176        xDelete<IssmDouble>(elements_neighboring_floatingce);
    177177
    178178        return nodes_on_floatingice;
Note: See TracChangeset for help on using the changeset viewer.