Changeset 23585


Ignore:
Timestamp:
01/01/19 21:09:23 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: AMR now uses a lot more of the model processor functions. In some cases, we now have to pass the flag isAMR so that fields from iomodel are not loaded

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

Legend:

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

    r22265 r23585  
    1212        _error_("not implemented yet");
    1313}/*}}}*/
    14 void AdjointBalancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void AdjointBalancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515        _error_("not implemented yet");
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/AdjointBalancethickness2Analysis.h

    r22265 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.cpp

    r22265 r23585  
    1212        _error_("not implemented yet");
    1313}/*}}}*/
    14 void AdjointBalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void AdjointBalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515        _error_("not implemented yet");
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/AdjointBalancethicknessAnalysis.h

    r22265 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.cpp

    r23066 r23585  
    1212           _error_("not implemented yet");
    1313}/*}}}*/
    14 void AdjointHorizAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void AdjointHorizAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515           _error_("not implemented yet");
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/AdjointHorizAnalysis.h

    r19002 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/Analysis.h

    r20065 r23585  
    3636                virtual void CreateConstraints(Constraints* constraints,IoModel* iomodel)=0;
    3737                virtual void CreateLoads(Loads* loads, IoModel* iomodel)=0;
    38                 virtual void CreateNodes(Nodes* nodes,IoModel* iomodel)=0;
     38                virtual void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false)=0;
    3939                virtual int  DofsPerNode(int** doflist,int domaintype,int approximation)=0;
    4040                virtual void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type)=0;
  • TabularUnified issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp

    r23066 r23585  
    1515
    1616}/*}}}*/
    17 void Balancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     17void Balancethickness2Analysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1818
    1919        int finiteelement = P1Enum;
  • TabularUnified issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.h

    r22178 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp

    r23532 r23585  
    5151        }
    5252}/*}}}*/
    53 void BalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     53void BalancethicknessAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    5454
    5555        int  stabilization;
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.cpp

    r18057 r23585  
    1515           _error_("not implemented yet");
    1616}/*}}}*/
    17 void BalancethicknessSoftAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     17void BalancethicknessSoftAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1818           _error_("not implemented yet");
    1919}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancethicknessSoftAnalysis.h

    r18057 r23585  
    1616                void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
    1717                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
    18                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     18                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1919                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    2020                void CreateLoads(Loads* loads, IoModel* iomodel);
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp

    r23066 r23585  
    1515        /*No loads*/
    1616}/*}}}*/
    17 void BalancevelocityAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     17void BalancevelocityAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1818
    1919        /*Check in 3d*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp

    r23066 r23585  
    3030
    3131}/*}}}*/
    32 void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     32void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    3333
    3434        int finiteelement;
  • TabularUnified issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.h

    r19386 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp

    r21074 r23585  
    1010void DepthAverageAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    1111}/*}}}*/
    12 void DepthAverageAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     12void DepthAverageAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1313
    1414        ::CreateNodes(nodes,iomodel,DepthAverageAnalysisEnum,P1Enum);
  • TabularUnified issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.h

    r18929 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp

    r23475 r23585  
    8787        /*No loads */
    8888}/*}}}*/
    89 void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     89void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    9090
    9191        int finiteelement;
  • TabularUnified issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.h

    r21721 r23585  
    1616                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1717                void CreateLoads(Loads* loads, IoModel* iomodel);
    18                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     18                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1919                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    2020                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/EnumToAnalysis.h

    r18057 r23585  
    1111                void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
    1212                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
    13                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     13                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1414                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1515                void CreateLoads(Loads* loads, IoModel* iomodel);
  • TabularUnified issm/trunk-jpl/src/c/analyses/EsaAnalysis.cpp

    r23066 r23585  
    1212        /*No loads*/
    1313}/*}}}*/
    14 void EsaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void EsaAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515        ::CreateNodes(nodes,iomodel,EsaAnalysisEnum,P1Enum);
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/EsaAnalysis.h

    r21261 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp

    r23380 r23585  
    1515        return;
    1616}/*}}}*/
    17 void ExtrapolationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     17void ExtrapolationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1818        int finiteelement=P1Enum;
    1919        if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.h

    r20117 r23585  
    1515        void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616        void CreateLoads(Loads* loads, IoModel* iomodel);
    17         void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17        void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818        int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919        void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp

    r21111 r23585  
    1010void ExtrudeFromBaseAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    1111}/*}}}*/
    12 void ExtrudeFromBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     12void ExtrudeFromBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1313
    1414        ::CreateNodes(nodes,iomodel,ExtrudeFromBaseAnalysisEnum,P1Enum);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.h

    r20665 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp

    r21111 r23585  
    1010void ExtrudeFromTopAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    1111}/*}}}*/
    12 void ExtrudeFromTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     12void ExtrudeFromTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1313
    1414        ::CreateNodes(nodes,iomodel,ExtrudeFromTopAnalysisEnum,P1Enum);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.h

    r20666 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp

    r23532 r23585  
    4646        iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase");
    4747}/*}}}*/
    48 void FreeSurfaceBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     48void FreeSurfaceBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    4949
    5050        if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
  • TabularUnified issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.h

    r18929 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp

    r23532 r23585  
    4646        iomodel->DeleteData(nodeonsurface,"md.mesh.vertexonsurface");
    4747}/*}}}*/
    48 void FreeSurfaceTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     48void FreeSurfaceTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    4949
    5050        if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
  • TabularUnified issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.h

    r18929 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.cpp

    r23507 r23585  
    1414        /*No loads*/
    1515}/*}}}*/
    16 void GLheightadvectionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     16void GLheightadvectionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1717
    1818        /*First fetch data: */
  • TabularUnified issm/trunk-jpl/src/c/analyses/GLheightadvectionAnalysis.h

    r22911 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/GiaIvinsAnalysis.cpp

    r22969 r23585  
    1212        /*No loads*/
    1313}/*}}}*/
    14 void GiaIvinsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void GiaIvinsAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515        ::CreateNodes(nodes,iomodel,GiaIvinsAnalysisEnum,P1Enum);
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/GiaIvinsAnalysis.h

    r21532 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp

    r23546 r23585  
    7171}/*}}}*/
    7272
    73 void HydrologyDCEfficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     73void HydrologyDCEfficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    7474
    7575        /*Now, do we really want DC?*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.h

    r23528 r23585  
    1717                void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
    1818                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
    19                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     19                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    2020                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    2121                void CreateLoads(Loads* loads, IoModel* iomodel);
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp

    r23546 r23585  
    115115
    116116}/*}}}*/
    117 void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     117void HydrologyDCInefficientAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    118118
    119119        /*Fetch parameters: */
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.h

    r22902 r23585  
    1717                void UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum);
    1818                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
    19                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     19                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    2020                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    2121                void CreateLoads(Loads* loads, IoModel* iomodel);
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.cpp

    r23156 r23585  
    1616
    1717}/*}}}*/
    18 void HydrologyPismAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     18void HydrologyPismAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1919        return;
    2020}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyPismAnalysis.h

    r23020 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.cpp

    r23532 r23585  
    6565
    6666}/*}}}*/
    67 void HydrologyShaktiAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     67void HydrologyShaktiAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    6868
    6969        /*Fetch parameters: */
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyShaktiAnalysis.h

    r23020 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp

    r23066 r23585  
    2020        /*No loads*/
    2121}/*}}}*/
    22 void HydrologyShreveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     22void HydrologyShreveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    2323
    2424        /*Fetch parameters: */
  • TabularUnified issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp

    r22919 r23585  
    1414        /*No loads*/
    1515}/*}}}*/
    16 void L2ProjectionBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     16void L2ProjectionBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1717
    1818        if(iomodel->domaintype==Domain3DEnum){
  • TabularUnified issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp

    r22856 r23585  
    1414        /*No loads*/
    1515}/*}}}*/
    16 void L2ProjectionEPLAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     16void L2ProjectionEPLAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1717        /*Now, do we really want DC?*/
    1818        int  hydrology_model;
  • TabularUnified issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp

    r23380 r23585  
    2020        return;
    2121}/*}}}*/
    22 void LevelsetAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     22void LevelsetAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    2323        int finiteelement;
    2424        iomodel->FindConstant(&finiteelement,"md.levelset.fe");
  • TabularUnified issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.h

    r22987 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/LoveAnalysis.cpp

    r22004 r23585  
    1010void LoveAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    1111}/*}}}*/
    12 void LoveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     12void LoveAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1313}/*}}}*/
    1414int  LoveAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/LoveAnalysis.h

    r22004 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r23532 r23585  
    9090        iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase");
    9191}/*}}}*/
    92 void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     92void MasstransportAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    9393
    9494        /*Fetch parameters: */
     
    102102        if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
    103103        if(stabilization!=3){
    104                 ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1Enum);
     104                ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1Enum,isamr);
    105105        }
    106106        else{
    107                 ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1DGEnum);
     107                ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1DGEnum,isamr);
    108108        }
    109109        iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
  • TabularUnified issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp

    r23532 r23585  
    2828
    2929}/*}}}*/
    30 void MeltingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     30void MeltingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    3131
    3232        if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface");
  • TabularUnified issm/trunk-jpl/src/c/analyses/MeltingAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp

    r23066 r23585  
    1212        /*No loads*/
    1313}/*}}}*/
    14 void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void SealevelriseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515        ::CreateNodes(nodes,iomodel,SealevelriseAnalysisEnum,P1Enum);
    1616}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.h

    r19984 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp

    r23540 r23585  
    1515        /*No loads*/
    1616}/*}}}*/
    17 void SmbAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     17void SmbAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1818        ::CreateNodes(nodes,iomodel,SmbAnalysisEnum,P1Enum);
    1919}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/SmbAnalysis.h

    r19528 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/SmoothAnalysis.cpp

    r23066 r23585  
    1010void SmoothAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/
    1111}/*}}}*/
    12 void SmoothAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     12void SmoothAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1313
    1414        ::CreateNodes(nodes,iomodel,SmoothAnalysisEnum,P1Enum);
  • TabularUnified issm/trunk-jpl/src/c/analyses/SmoothAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

    r23576 r23585  
    496496        }
    497497}/*}}}*/
    498 void StressbalanceAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     498void StressbalanceAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    499499
    500500        /*Intermediary*/
     
    537537                        iomodel->FindConstant(&finiteelement,"md.flowequation.fe_FS");
    538538                }
    539                 iomodel->FetchData(3,"md.flowequation.borderSSA","md.flowequation.vertex_equation","md.stressbalance.referential");
    540                 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderFS");
    541                 ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,finiteelement,approximation);
    542                 iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.vertex_equation",
     539                if(!isamr){
     540                        iomodel->FetchData(3,"md.flowequation.borderSSA","md.flowequation.vertex_equation","md.stressbalance.referential");
     541                        if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderFS");
     542                }
     543                ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,finiteelement,isamr,approximation);
     544                if(!isamr){
     545                        iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.vertex_equation",
    543546                                        "md.stressbalance.referential","md.flowequation.borderFS");
     547                }
    544548        }
    545549        else{
     
    556560                        for(int i=0;i<iomodel->numberofelements;i++) approximations[iomodel->numberofvertices+i] = FSvelocityEnum;
    557561                        for(int i=0;i<iomodel->numberofvertices;i++) approximations[iomodel->numberofvertices+iomodel->numberofelements+i] = FSpressureEnum;
    558                         ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,MINIcondensedEnum,0,approximations);
     562                        ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,MINIcondensedEnum,isamr,0,approximations);
    559563                        xDelete<int>(approximations);
    560564
     
    575579                        int* approximations = xNew<int>(iomodel->numberofvertices);
    576580                        for(int i=0;i<iomodel->numberofvertices;i++) approximations[i] = IoCodeToEnumVertexEquation(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]));
    577                         ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,P1Enum,0,approximations);
     581                        ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,P1Enum,isamr,0,approximations);
    578582                        xDelete<int>(approximations);
    579583                }
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.h

    r23199 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp

    r23576 r23585  
    7676
    7777}/*}}}*/
    78 void StressbalanceSIAAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     78void StressbalanceSIAAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    7979
    8080        /*Intermediaries*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp

    r23532 r23585  
    7474
    7575}/*}}}*/
    76 void StressbalanceVerticalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     76void StressbalanceVerticalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    7777
    7878        /*return if not 3d mesh*/
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.h

    r22535 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp

    r23532 r23585  
    9191
    9292}/*}}}*/
    93 void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     93void ThermalAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    9494
    9595        int finiteelement;
  • TabularUnified issm/trunk-jpl/src/c/analyses/ThermalAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp

    r20690 r23585  
    1212        return;
    1313}/*}}}*/
    14 void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/
     14void UzawaPressureAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr){/*{{{*/
    1515
    1616        int finiteelement;
  • TabularUnified issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.h

    r18930 r23585  
    1515                void CreateConstraints(Constraints* constraints,IoModel* iomodel);
    1616                void CreateLoads(Loads* loads, IoModel* iomodel);
    17                 void CreateNodes(Nodes* nodes,IoModel* iomodel);
     17                void CreateNodes(Nodes* nodes,IoModel* iomodel,bool isamr=false);
    1818                int  DofsPerNode(int** doflist,int domaintype,int approximation);
    1919                void UpdateElements(Elements* elements,IoModel* iomodel,int analysis_counter,int analysis_type);
  • TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp

    r23576 r23585  
    26092609        int newnumberofvertices = -1;
    26102610        int newnumberofelements = -1;
    2611         bool* my_elements                       = NULL;
    2612         int* my_vertices                        = NULL;
     2611
    26132612        int elementswidth       = this->GetElementsWidth();//just tria elements in this version
    26142613        int amrtype,basalforcing_model;
     
    26202619                #if defined(_HAVE_NEOPZ_) && !defined(_HAVE_AD_)
    26212620                case AmrNeopzEnum: this->ReMeshNeopz(&newnumberofvertices,&newnumberofelements,&newx,&newy,&newz,&newelementslist); break;
    2622                                                                  #endif
     2621                #endif
    26232622
    26242623                #if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_)
     
    26292628        }
    26302629
     2630        /*Create iomodel for model processing*/
     2631        IoModel* iomodel = new IoModel();
     2632        this->parameters->FindParam(&iomodel->domaintype,DomainTypeEnum);
     2633        this->parameters->FindParam(&iomodel->domaindim ,DomainDimensionEnum);
     2634        this->parameters->FindParam(&iomodel->meshelementtype,MeshElementtypeEnum);
     2635        iomodel->numberofvertices = newnumberofvertices;
     2636        iomodel->numberofelements = newnumberofelements;
     2637        iomodel->elements         = newelementslist;
     2638        iomodel->AddConstant(new IoConstant(0,"md.rifts.numrifts"));
     2639        iomodel->AddConstant(new IoConstant(false,"md.transient.isoceancoupling"));
     2640        bool temp; int tempint;
     2641        this->parameters->FindParam(&temp,FlowequationIsSIAEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isSIA"));
     2642        this->parameters->FindParam(&temp,FlowequationIsSSAEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isSSA"));
     2643        this->parameters->FindParam(&temp,FlowequationIsL1L2Enum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isL1L2"));
     2644        this->parameters->FindParam(&temp,FlowequationIsHOEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isHO"));
     2645        this->parameters->FindParam(&temp,FlowequationIsFSEnum); iomodel->AddConstant(new IoConstant(temp,"md.flowequation.isFS"));
     2646        this->parameters->FindParam(&tempint,MasstransportStabilizationEnum); iomodel->AddConstant(new IoConstant(tempint,"md.masstransport.stabilization"));
     2647        iomodel->AddConstant(new IoConstant(P1Enum,"md.flowequation.fe_SSA"));
     2648
    26312649        /*Partitioning the new mesh. Maybe ElementsAndVerticesPartitioning.cpp could be modified to set this without iomodel.*/
    2632         this->ElementsAndVerticesPartitioning(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,&my_elements,&my_vertices);
    2633 
    2634         /*Create vertices*/
    2635         Vertices* new_vertices=new Vertices();
    2636         this->CreateVertices(newnumberofvertices,newnumberofelements,elementswidth,newelementslist,my_vertices,newx,newy,newz,new_vertices);
     2650        ::ElementsAndVerticesPartitioning(iomodel);
    26372651
    26382652        /*Creating elements*/
    26392653        /*Just Tria in this version*/
    26402654        Elements* new_elements=new Elements();
    2641         this->CreateElements(newnumberofelements,elementswidth,newelementslist,my_elements,new_elements);
     2655        this->CreateElements(newnumberofelements,elementswidth,newelementslist,iomodel->my_elements,new_elements);
     2656
     2657        /*Create vertices*/
     2658        Vertices* new_vertices=new Vertices();
     2659        CreateNumberNodeToElementConnectivity(iomodel);
     2660        ::CreateVertices(new_elements,new_vertices,iomodel,TransientSolutionEnum,true);
     2661        for(int i=0;i<new_vertices->Size();i++){
     2662                Vertex *vertex=(Vertex*)new_vertices->GetObjectByOffset(i);
     2663                int     sid = vertex->Sid();
     2664                vertex->x=newx[sid];
     2665                vertex->y=newy[sid];
     2666                vertex->z=newz[sid];
     2667        }
    26422668
    26432669        /*Creating materials*/
    26442670        Materials* new_materials=new Materials();
    2645         this->CreateMaterials(newnumberofelements,my_elements,new_materials);
     2671        this->CreateMaterials(newnumberofelements,iomodel->my_elements,new_materials);
    26462672
    26472673        /*Creating nodes and constraints*/
    26482674        /*Just SSA (2D) and P1 in this version*/
    2649         Constraints** new_constraints_list = xNew<Constraints*>(this->nummodels);
    2650         Nodes** new_nodes_list = xNew<Nodes*>(this->nummodels);
     2675        Constraints **new_constraints_list = xNew<Constraints*>(this->nummodels);
     2676        Nodes       **new_nodes_list      = xNew<Nodes*>(this->nummodels);
    26512677
    26522678        this->analysis_counter=-1;
    26532679        for(int i=0;i<this->nummodels;i++){//create nodes for each analysis in analysis_type_list
     2680
     2681                int analysis_enum = this->analysis_type_list[i];
     2682                if(VerboseMProcessor()) _printf0_("   creating datasets for analysis " << EnumToStringx(analysis_enum) << "\n");
    26542683
    26552684                if(this->loads_list[i]->Size()!=0) _error_("not supported yet");
     
    26572686                new_nodes_list[i] = new Nodes();
    26582687
    2659                 int analysis_enum = this->analysis_type_list[i];
    2660 
    26612688                /*As the domain is 2D, it is not necessary to create nodes for this analysis*/
    26622689                if(analysis_enum==StressbalanceVerticalAnalysisEnum) continue;
    2663 
    2664                 this->CreateNodes(newnumberofvertices,my_vertices,analysis_enum,new_nodes_list[i]);
    2665                 this->UpdateElements(newnumberofelements,newelementslist,my_elements,i,new_elements);
     2690                Analysis* analysis = EnumToAnalysis(analysis_enum);
     2691                analysis->CreateNodes(new_nodes_list[i],iomodel,true);
     2692                delete analysis;
     2693                this->UpdateElements(newnumberofelements,newelementslist,iomodel->my_elements,i,new_elements);
    26662694                this->CreateConstraints(new_vertices,analysis_enum,new_constraints_list[i]);
    26672695
     
    27482776        /*Cleanup*/
    27492777        xDelete<IssmDouble>(newz);
    2750         xDelete<int>(my_vertices);
    2751         xDelete<bool>(my_elements);
     2778        /*Delete iomodel, but make sure to not erase some pointers*/
     2779        iomodel->elements = NULL;
     2780        delete iomodel;
    27522781}
    27532782/*}}}*/
     
    31643193}
    31653194/*}}}*/
    3166 void FemModel::CreateVertices(int newnumberofvertices,int newnumberofelements,int elementswidth,int* newelementslist,int* my_vertices,IssmDouble* newx,IssmDouble* newy,IssmDouble* newz,Vertices* vertices){/*{{{*/
    3167 
    3168         /*newelementslist is in Matlab indexing*/
    3169 
    3170         /*Creating connectivity table*/
    3171         int* connectivity=NULL;
    3172         connectivity=xNewZeroInit<int>(newnumberofvertices);
    3173 
    3174         for(int i=0;i<newnumberofelements;i++){
    3175                 for(int j=0;j<elementswidth;j++){
    3176                         int vertexid = newelementslist[elementswidth*i+j];
    3177                         _assert_(vertexid>0 && vertexid-1<newnumberofvertices);//Matlab indexing
    3178                         connectivity[vertexid-1]+=1;//Matlab to C indexing
    3179                 }
    3180         }
    3181 
    3182         /*Create vertex and insert in vertices*/
    3183         for(int i=0;i<newnumberofvertices;i++){
    3184                 if(my_vertices[i]){
    3185                         Vertex *newvertex=new Vertex();
    3186                         newvertex->id=i+1;
    3187                         newvertex->sid=i;
    3188                         newvertex->pid=UNDEF;
    3189                         newvertex->x=newx[i];
    3190                         newvertex->y=newy[i];
    3191                         newvertex->z=newz[i];
    3192                         newvertex->domaintype=Domain2DhorizontalEnum;
    3193                         newvertex->sigma=0.;
    3194                         newvertex->connectivity=connectivity[i];
    3195                         newvertex->clone=false;//itapopo check this
    3196                         vertices->AddObject(newvertex);
    3197                 }
    3198         }
    3199 
    3200         xDelete<int>(connectivity);
    3201 }
    3202 /*}}}*/
    32033195void FemModel::CreateElements(int newnumberofelements,int elementswidth,int* newelementslist,bool* my_elements,Elements* elements){/*{{{*/
    32043196
     
    32613253}
    32623254/*}}}*/
    3263 void FemModel::CreateNodes(int newnumberofvertices,int* my_vertices,int analysis_enum,Nodes* nodes){/*{{{*/
    3264 
    3265         int lid=0;
    3266         for(int j=0;j<newnumberofvertices;j++){
    3267                 if(my_vertices[j]){
    3268 
    3269                         Node* newnode=new Node();
    3270 
    3271                         /*id: */
    3272                         newnode->id=j+1;
    3273                         newnode->sid=j;
    3274                         newnode->lid=lid++;
    3275                         newnode->analysis_enum=analysis_enum;
    3276 
    3277                         /*Initialize coord_system: Identity matrix by default*/
    3278                         for(int k=0;k<3;k++) for(int l=0;l<3;l++) newnode->coord_system[k][l]=0.0;
    3279                         for(int k=0;k<3;k++) newnode->coord_system[k][k]=1.0;
    3280 
    3281                         /*indexing:*/
    3282                         newnode->indexingupdate=true;
    3283 
    3284                         Analysis* analysis=EnumToAnalysis(analysis_enum);
    3285                         int *doftypes=NULL;
    3286                         int numdofs=analysis->DofsPerNode(&doftypes,Domain2DhorizontalEnum,SSAApproximationEnum);
    3287                         newnode->indexing.Init(numdofs,false,doftypes);
    3288                         xDelete<int>(doftypes);
    3289                         delete analysis;
    3290                         if(analysis_enum==StressbalanceAnalysisEnum)
    3291                                 newnode->SetApproximation(SSAApproximationEnum);
    3292                         else
    3293                                 newnode->SetApproximation(0);
    3294 
    3295                         /*Stressbalance Horiz*/
    3296                         if(analysis_enum==StressbalanceAnalysisEnum){
    3297                                 // itapopo this code is rarely used.
    3298                                 /*Coordinate system provided, convert to coord_system matrix*/
    3299                                 //XZvectorsToCoordinateSystem(&this->coord_system[0][0],&iomodel->Data(StressbalanceReferentialEnum)[j*6]);
    3300                                 //_assert_(sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]) >1.e-4);
    3301 
    3302                         }
    3303                         nodes->AddObject(newnode);
    3304                 }
    3305         }
    3306 }
    3307 /*}}}*/
    33083255void FemModel::GetMesh(Vertices* femmodel_vertices, Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, int** pelementslist){/*{{{*/
    33093256
     
    35923539        }
    35933540        return;
    3594 }
    3595 /*}}}*/
    3596 void FemModel::ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices){/*{{{*/
    3597 
    3598         /*newelementslist come in Matlab indexing*/
    3599 
    3600         int *epart                      = NULL; //element partitioning.
    3601         int *npart                      = NULL; //node partitioning.
    3602         int *index                      = NULL; //elements in C indexing
    3603         int edgecut                     = 1;
    3604         int numflag                     = 0;
    3605         int etype                       = 1;
    3606         int my_rank                     = IssmComm::GetRank();
    3607         int numprocs            = IssmComm::GetSize();
    3608         bool *my_elements = NULL;
    3609         int *my_vertices  = NULL;
    3610 
    3611         _assert_(newnumberofvertices>0);
    3612         _assert_(newnumberofelements>0);
    3613         epart=xNew<int>(newnumberofelements);
    3614         npart=xNew<int>(newnumberofvertices);
    3615    index=xNew<int>(elementswidth*newnumberofelements);
    3616 
    3617         for (int i=0;i<newnumberofelements;i++){
    3618         for (int j=0;j<elementswidth;j++){
    3619         *(index+elementswidth*i+j)=(*(newelementslist+elementswidth*i+j))-1; //-1 for C indexing in Metis
    3620       }
    3621    }
    3622 
    3623         /*Partition using Metis:*/
    3624         if (numprocs>1){
    3625 #ifdef _HAVE_METIS_
    3626                 METIS_PartMeshNodalPatch(&newnumberofelements,&newnumberofvertices, index, &etype, &numflag, &numprocs, &edgecut, epart, npart);
    3627 #else
    3628                 _error_("metis has not beed installed. Cannot run with more than 1 cpu");
    3629 #endif
    3630         }
    3631         else if (numprocs==1){
    3632                 /*METIS does not know how to deal with one cpu only!*/
    3633                 for (int i=0;i<newnumberofelements;i++) epart[i]=0;
    3634                 for (int i=0;i<newnumberofvertices;i++) npart[i]=0;
    3635         }
    3636         else _error_("At least one processor is required");
    3637 
    3638         my_vertices=xNew<int>(newnumberofvertices);
    3639         my_elements=xNew<bool>(newnumberofelements);
    3640         for(int i=0;i<newnumberofvertices;i++) my_vertices[i]=0;
    3641         for(int i=0;i<newnumberofelements;i++) my_elements[i]=false;
    3642 
    3643         /*Start figuring out, out of the partition, which elements belong to this cpu: */
    3644         for(int i=0;i<newnumberofelements;i++){
    3645                 /*!All elements have been partitioned above, only deal with elements for this cpu: */
    3646                 if(my_rank==epart[i]){
    3647                         my_elements[i]=true;
    3648                         /*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use
    3649                          *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing)
    3650                          into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices
    3651                          will hold which vertices belong to this partition*/
    3652                         for(int j=0;j<elementswidth;j++){
    3653                                 _assert_(newelementslist[elementswidth*i+j]-1<newnumberofvertices);//newelementslist is in Matlab indexing
    3654                                 my_vertices[newelementslist[elementswidth*i+j]-1]=1;//newelementslist is in Matlab indexing
    3655                         }
    3656                 }
    3657         }
    3658 
    3659         /*Assign output pointers:*/
    3660         *pmy_elements=my_elements;
    3661         *pmy_vertices=my_vertices;
    3662 
    3663         /*Free ressources:*/
    3664         xDelete<int>(epart);
    3665         xDelete<int>(npart);
    3666         xDelete<int>(index);
    36673541}
    36683542/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/classes/FemModel.h

    r23546 r23585  
    179179                void GetMeshOnPartition(Vertices* femmodel_vertices,Elements* femmodel_elements,IssmDouble** px, IssmDouble** py, IssmDouble** pz, int** pelementslist,int** psidtoindex);
    180180                void GetGroundediceLevelSet(IssmDouble** pmasklevelset);
    181                 void CreateVertices(int newnumberofvertices,int newnumberofelements,int elementswidth,int* newelementslist,int* my_vertices,IssmDouble* newx,IssmDouble* newy,IssmDouble* newz,Vertices* vertices);
    182181                void CreateElements(int newnumberofelements,int elementswidth,int* newelementslist,bool* my_elements,Elements* elements);
    183182                void CreateMaterials(int newnumberofelements,bool* my_elements,Materials* materials);
    184                 void CreateNodes(int newnumberofvertices,int* my_vertices,int analysis_enum,Nodes* nodes);
    185183                void CreateConstraints(Vertices* newfemmodel_vertices,int analysis_enum,Constraints* newfemmodel_constraints);
    186184                void GetInputs(int* pnumP0inputs,IssmDouble** pP0inputs,int** pP0input_enums,int** pP0input_interp,int* pnumP1inputs,IssmDouble** pP1inputs,int** pP1input_enums,int** pP1input_interp);
    187185                void InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements);
    188186                void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int analysis_counter,Elements* newelements);
    189                 void ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices);
    190187                void WriteMeshInResults(void);
    191188                void WriteErrorEstimatorsInResults(void);
  • TabularUnified issm/trunk-jpl/src/c/classes/Node.cpp

    r23561 r23585  
    2121}
    2222/*}}}*/
    23 Node::Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int in_approximation){/*{{{*/
     23Node::Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int in_approximation,bool isamr){/*{{{*/
    2424
    2525        /*Intermediary*/
     
    5151        else
    5252         this->approximation=0;
     53
     54        /*Stop here if AMR*/
     55        if(isamr) return;
    5356
    5457        /*Stressbalance Horiz*/
  • TabularUnified issm/trunk-jpl/src/c/classes/Node.h

    r23561 r23585  
    4141                /*Node constructors, destructors*/
    4242                Node();
    43                 Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int approximation_in);
     43                Node(int node_id,int node_sid,int node_lid,int node_pid,int io_index,bool isclone,IoModel* iomodel,int analysis_enum,int approximation_in,bool isamr);
    4444                ~Node();
    4545
  • TabularUnified issm/trunk-jpl/src/c/classes/Vertex.cpp

    r23523 r23585  
    2020}
    2121/*}}}*/
    22 Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,int vertex_pid,bool vertex_clone, IoModel* iomodel){/*{{{*/
     22Vertex::Vertex(int vertex_id, int vertex_sid,int vertex_lid,int vertex_pid,bool vertex_clone, IoModel* iomodel,bool isamr){/*{{{*/
    2323
    2424        /*Checks in debugging mode*/
     
    2626
    2727        /*IDs*/
    28         this->id  = vertex_id;
    29         this->sid = vertex_sid;
    30         this->pid = vertex_pid;
    31         this->lid = vertex_lid;
     28        this->id    = vertex_id;
     29        this->sid   = vertex_sid;
     30        this->pid   = vertex_pid;
     31        this->lid   = vertex_lid;
    3232        this->clone = vertex_clone;
    3333
    34         /*Coordinates*/
    35         _assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z"));
    36         this->x            = iomodel->Data("md.mesh.x")[vertex_sid];
    37         this->y            = iomodel->Data("md.mesh.y")[vertex_sid];
    38         this->z            = iomodel->Data("md.mesh.z")[vertex_sid];
     34        /*Properties from iomodel*/
     35        _assert_(iomodel->numbernodetoelementconnectivity);
     36        this->connectivity = iomodel->numbernodetoelementconnectivity[vertex_sid];
    3937        this->domaintype   = iomodel->domaintype;
    40         if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
    41                 this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
    42                 this->longitude    = iomodel->Data("md.mesh.long")[vertex_sid];
    43         }
    44 
    45         switch(iomodel->domaintype){
    46                 case Domain3DEnum:
    47                         _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
    48                         this->sigma = (iomodel->Data("md.mesh.z")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
    49                         break;
    50                 case Domain3DsurfaceEnum:
    51                         _assert_(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long") && iomodel->Data("md.mesh.r"));
     38
     39        /*Coordinates, only if not AMR*/
     40        if(!isamr){
     41                _assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z"));
     42                this->x            = iomodel->Data("md.mesh.x")[vertex_sid];
     43                this->y            = iomodel->Data("md.mesh.y")[vertex_sid];
     44                this->z            = iomodel->Data("md.mesh.z")[vertex_sid];
     45                if(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long")){
    5246                        this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
    5347                        this->longitude    = iomodel->Data("md.mesh.long")[vertex_sid];
    54                         this->R            = iomodel->Data("md.mesh.r")[vertex_sid];
    55                         break;
    56                 case Domain2DhorizontalEnum:
    57                         this->sigma = 0.;
    58                         break;
    59                 case Domain2DverticalEnum:
    60                         _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
    61                         this->sigma = (iomodel->Data("md.mesh.y")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
    62                         break;
    63         }
    64 
    65         _assert_(iomodel->numbernodetoelementconnectivity);
    66         this->connectivity = iomodel->numbernodetoelementconnectivity[vertex_sid];
     48                }
     49
     50                switch(iomodel->domaintype){
     51                        case Domain3DEnum:
     52                                _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
     53                                this->sigma = (iomodel->Data("md.mesh.z")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
     54                                break;
     55                        case Domain3DsurfaceEnum:
     56                                _assert_(iomodel->Data("md.mesh.lat") && iomodel->Data("md.mesh.long") && iomodel->Data("md.mesh.r"));
     57                                this->latitute     = iomodel->Data("md.mesh.lat")[vertex_sid];
     58                                this->longitude    = iomodel->Data("md.mesh.long")[vertex_sid];
     59                                this->R            = iomodel->Data("md.mesh.r")[vertex_sid];
     60                                break;
     61                        case Domain2DhorizontalEnum:
     62                                this->sigma = 0.;
     63                                break;
     64                        case Domain2DverticalEnum:
     65                                _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness"));
     66                                this->sigma = (iomodel->Data("md.mesh.y")[vertex_sid]-iomodel->Data("md.geometry.base")[vertex_sid])/(iomodel->Data("md.geometry.thickness")[vertex_sid]);
     67                                break;
     68                }
     69        }
     70        else{
     71                this->x         = 0.;
     72                this->y         = 0.;
     73                this->z         = 0.;
     74                this->latitute  = 0.;
     75                this->longitude = 0.;
     76                this->R         = 0.;
     77                this->sigma     = 0.;
     78        }
    6779
    6880}/*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/classes/Vertex.h

    r23522 r23585  
    3737                /*Vertex constructors, destructors {{{*/
    3838                Vertex();
    39                 Vertex(int id, int sid,int lid,int pid,bool clone, IoModel* iomodel);
     39                Vertex(int id, int sid,int lid,int pid,bool clone, IoModel* iomodel,bool isamr);
    4040                ~Vertex();
    4141                /*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r23582 r23585  
    77#include "../../shared/shared.h"
    88#include "./ModelProcessorx.h"
     9
     10#define MAXCONNECTIVITY 5
     11
     12bool IsVertexInRank(int* vertices_ranks,int* vertices_proc_count,int vid,int rank){/*{{{*/
     13
     14        /*See if node is already in partition*/
     15        for(int k=0;k<vertices_proc_count[vid];k++){
     16                if(vertices_ranks[MAXCONNECTIVITY*vid+k] == rank) return true;
     17        }
     18
     19        return false;
     20}/*}}}*/
     21int  VertexMasterRank(int* vertices_ranks,int vid){/*{{{*/
     22        return vertices_ranks[MAXCONNECTIVITY*vid+0];
     23}/*}}}*/
     24void AddVertexToRank(int* vertices_ranks,int* vertices_proc_count,int vid,int rank){/*{{{*/
     25
     26        /*See if node is already in partition, return if this is the case*/
     27        if(IsVertexInRank(vertices_ranks,vertices_proc_count,vid,rank)) return;
     28
     29        /*This rank has not been marked for this node just yet so go ahead and add it*/
     30        vertices_ranks[MAXCONNECTIVITY*vid+vertices_proc_count[vid]] = rank;
     31        vertices_proc_count[vid]++;
     32}/*}}}*/
    933
    1034void CreateElements(Elements* elements,IoModel* iomodel,const int nummodels){/*{{{*/
     
    235259
    236260}/*}}}*/
    237 void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type){/*{{{*/
    238 
    239         /*Fetch parameters: */
    240         bool isoceancoupling;
    241         iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
    242 
    243         /*Fetch data that will be used by the Vertex Constructor*/
    244         iomodel->FetchData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
    245         if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
    246         else iomodel->FetchDataToInput(elements,"md.mesh.scale_factor",MeshScaleFactorEnum,1.);
    247         if (isoceancoupling) iomodel->FetchData(2,"md.mesh.lat","md.mesh.long");
    248         if (solution_type!=LoveSolutionEnum) CreateNumberNodeToElementConnectivity(iomodel);
    249 
    250         const int MAXCONNECTIVITY = 5;
    251         int*      epart = iomodel->epart;
     261void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type,bool isamr){/*{{{*/
     262
     263
     264        /*Get element partitionning*/
     265        int* epart = iomodel->epart;
    252266
    253267        /*Determine element width*/
     
    271285        int* vertices_proc_count = xNewZeroInit<int>(iomodel->numberofvertices);
    272286
    273         /*Create vector of size total nbv, initialized with -1, that will keep track of local ids*/
    274         int* vertices_lids  = xNew<int>(iomodel->numberofvertices);
    275         for(int i=0;i<iomodel->numberofvertices;i++) vertices_lids[i] = -1;
    276 
    277287        /*Go through all elements and mark all vertices for all partitions*/
    278         int  lid = 0;
    279288        for(int i=0;i<iomodel->numberofelements;i++){
    280289                for(int j=0;j<elements_width;j++){
    281 
    282290                        /*Get current vertex sid*/
    283291                        int vid = iomodel->elements[elements_width*i+j]-1;
    284 
    285                         /*See if it has already been marked*/
    286                         bool found = false;
    287                         for(int k=0;k<vertices_proc_count[vid];k++){
    288                                 if(vertices_ranks[MAXCONNECTIVITY*vid+k] == epart[i]){
    289                                         found = true;
    290                                         break;
    291                                 }
    292                         }
    293 
    294                         /*On go below if this vertex has not been seen yet in this partition*/
    295                         if(!found){
    296                                 /*This rank has not been marked for this vertex just yet so go ahead and mark it*/
    297                                 vertices_ranks[MAXCONNECTIVITY*vid+vertices_proc_count[vid]] = epart[i];
    298                                 vertices_proc_count[vid]++;
    299 
    300                                 /*Keep track of local ids!*/
    301                                 if(epart[i]==my_rank){
    302                                         vertices_lids[vid] = lid;
    303                                         lid++;
    304                                 }
    305 
    306                                 /*Make sure we don't go too far in the table*/
    307                                 if(vertices_proc_count[vid]>MAXCONNECTIVITY) _error_("need to increase MAXCONNECTIVITY (this is hard coded, contact ISSM developer)");
    308                         }
     292                        AddVertexToRank(vertices_ranks,vertices_proc_count,vid,epart[i]);
     293                }
     294        }
     295
     296        /*Create vector of size total numnodes, initialized with -1, that will keep track of local ids*/
     297        int  lid = 0;
     298        int* vertices_lids  = xNew<int>(iomodel->numberofvertices);
     299        for(int i=0;i<iomodel->numberofvertices;i++){
     300                if(IsVertexInRank(vertices_ranks,vertices_proc_count,i,my_rank)){
     301                        vertices_lids[i] = lid++;
     302                }
     303                else{
     304                        vertices_lids[i] = -1;
    309305                }
    310306        }
     
    377373                }
    378374        }
    379         xDelete<int>(vertices_proc_count);
    380375
    381376        /*Final step: prepare pids (parallel ids), first count number of masters for each proc*/
     
    401396        xDelete<int>(rank_offsets);
    402397
    403         /*Go ahead and create vertices now that we have all we need*/
    404         for(int i=0;i<iomodel->numberofvertices;i++){
    405                 if(vertices_lids[i]!=-1){
    406                         bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
    407                         vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],vertices_pids[i],isclone,iomodel));
    408                 }
    409         }
    410         xDelete<int>(vertices_ranks);
     398        /*Create Vertices, depending on the constructor type: */
     399        if(solution_type!=LoveSolutionEnum) CreateNumberNodeToElementConnectivity(iomodel);
     400        if(!isamr){
     401                bool isoceancoupling;
     402                iomodel->FindConstant(&isoceancoupling,"md.transient.isoceancoupling");
     403
     404                iomodel->FetchData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
     405                if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
     406                else iomodel->FetchDataToInput(elements,"md.mesh.scale_factor",MeshScaleFactorEnum,1.);
     407                if (isoceancoupling) iomodel->FetchData(2,"md.mesh.lat","md.mesh.long");
     408
     409                for(int i=0;i<iomodel->numberofvertices;i++){
     410                        if(vertices_lids[i]!=-1){
     411                                bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
     412                                vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],vertices_pids[i],isclone,iomodel,isamr));
     413                        }
     414                }
     415
     416                /*Free data: */
     417                iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
     418                if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
     419                if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long");
     420        }
     421        else{
     422                for(int i=0;i<iomodel->numberofvertices;i++){
     423                        if(vertices_lids[i]!=-1){
     424                                bool isclone = (vertices_ranks[MAXCONNECTIVITY*i+0]!=my_rank);
     425                                vertices->AddObject(new Vertex(i+1,i,vertices_lids[i],vertices_pids[i],isclone,iomodel,isamr));
     426                        }
     427                }
     428        }
     429
    411430        xDelete<int>(vertices_lids);
    412431        xDelete<int>(vertices_pids);
    413432
     433        /*Final step, create my_vertices*/
     434        _assert_(!iomodel->my_vertices);
     435        iomodel->my_vertices = xNew<bool>(iomodel->numberofvertices);
     436        for(int i=0;i<iomodel->numberofvertices;i++){
     437                if(IsVertexInRank(vertices_ranks,vertices_proc_count,i,my_rank)){
     438                        iomodel->my_vertices[i] = true;
     439                }
     440                else{
     441                        iomodel->my_vertices[i] = false;
     442                }
     443        }
     444
    414445        /*Free data: */
    415         iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset");
    416         if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r");
    417         if (isoceancoupling) iomodel->DeleteData(2,"md.mesh.lat","md.mesh.long");
    418 
     446        xDelete<int>(vertices_ranks);
     447        xDelete<int>(vertices_proc_count);
     448
     449        /*Assign communicators*/
    419450        vertices->common_send=common_send;
    420451        vertices->common_recv=common_recv;
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateNodes.cpp

    r23584 r23585  
    3333}/*}}}*/
    3434
    35 void CreateNodes(Nodes* nodes, IoModel* iomodel,int analysis,int finite_element,int approximation,int* approximations){
     35void CreateNodes(Nodes* nodes, IoModel* iomodel,int analysis,int finite_element,bool isamr,int approximation,int* approximations){
    3636
    3737        /*Intermediaries*/
     
    538538        }/*}}}*/
    539539        /*Vertex pairing for stressbalance{{{*/
    540         if(analysis==StressbalanceAnalysisEnum || analysis==StressbalanceVerticalAnalysisEnum){
     540        if(!isamr & (analysis==StressbalanceAnalysisEnum || analysis==StressbalanceVerticalAnalysisEnum)){
    541541                int *vertex_pairing = NULL;
    542542                int  numvertex_pairing;
    543543                iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing");
     544                _assert_(numvertex_pairing==0 || finite_element==P1Enum);
     545                for(int i=0;i<numvertex_pairing;i++){
     546                        int nid1 = vertex_pairing[2*i+0]-1;
     547                        int nid2 = vertex_pairing[2*i+1]-1;
     548                        for(int j=0;j<nodes_proc_count[nid1];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid2,nodes_ranks[MAXCONNECTIVITY*nid1+j]);
     549                        for(int j=0;j<nodes_proc_count[nid2];j++) AddNodeToRank(nodes_ranks,nodes_proc_count,nid1,nodes_ranks[MAXCONNECTIVITY*nid2+j]);
     550                }
     551                xDelete<int>(vertex_pairing);
     552        }
     553        if(!isamr & analysis==MasstransportAnalysisEnum){
     554                int *vertex_pairing = NULL;
     555                int  numvertex_pairing;
     556                iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
    544557                _assert_(numvertex_pairing==0 || finite_element==P1Enum);
    545558                for(int i=0;i<numvertex_pairing;i++){
     
    657670                        int io_index = 0;
    658671                        if(i<iomodel->numberofvertices) io_index = i;
    659                         Node* node=new Node(i+1,i,nodes_lids[i],nodes_pids[i],io_index,isclone,iomodel,analysis,nodes_approx[i]);
     672                        Node* node=new Node(i+1,i,nodes_lids[i],nodes_pids[i],io_index,isclone,iomodel,analysis,nodes_approx[i],isamr);
    660673                        if(finite_element==MINIcondensedEnum || finite_element==P1bubblecondensedEnum){
    661674                                /*Bubble function is collapsed, needs to constrain it, maybe this is not the best place to do this, but that's life!*/
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp

    r23582 r23585  
    8181        }
    8282
    83         /*Create my_vertices and my_elements, used by each partition */
     83        /*Create my_elements, used by each partition */
    8484        bool *my_elements = xNewZeroInit<bool>(iomodel->numberofelements);
    85         bool *my_vertices = xNewZeroInit<bool>(iomodel->numberofvertices);
    8685
    8786        /*Start figuring out, out of the partition, which elements belong to this cpu: */
     
    8988
    9089                /*!All elements have been partitioned above, only deal with elements for this cpu: */
    91                 if(my_rank==epart[i]){
    92                         my_elements[i]=true;
    93                         /*Now that we are here, we can also start building the list of vertices belonging to this cpu partition: we use
    94                          *the  element index to do this. For each element n, we know index[n][0:2] holds the indices (matlab indexing)
    95                          into the vertices coordinates. If we start plugging 1 into my_vertices for each index[n][i] (i=0:2), then my_vertices
    96                          will hold which vertices belong to this partition*/
    97                         for(int j=0;j<elements_width;j++){
    98                                 my_vertices[iomodel->elements[elements_width*i+j]-1]=true;
    99                         }
    100                 }
     90                if(my_rank==epart[i]) my_elements[i]=true;
    10191        }
    102 
    103         /*We might have vertex_pairing in which case, some vertices have to be
    104          * cloned: penpair has 2 nodes that are poointing toward 2 vertices.
    105          * The 2 vertices must be in the same cpu as the penpair (only do this in non AMR mode, i.e. fid!=NULL)*/
    106         //if(!iomodel->dummy){
    107                 int *vertex_pairing = NULL;
    108                 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing");
    109                 for(int i=0;i<numvertex_pairing;i++){
    110                         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]=true;
    112                         }
    113                 }
    114                 xDelete<int>(vertex_pairing);
    115                 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing");
    116                 for(int i=0;i<numvertex_pairing;i++){
    117                         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]=true;
    119                         }
    120                 }
    121                 xDelete<int>(vertex_pairing);
    122         //}
    12392
    12493        /*Assign pointers to iomodel*/
    12594        iomodel->epart      =epart;
    12695        iomodel->my_elements=my_elements;
    127         iomodel->my_vertices=my_vertices;
    12896}
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r23582 r23585  
    1414void CreateElements(Elements* elements,IoModel* iomodel,int nummodels);
    1515void CreateMaterials(Elements* elements,Materials* materials,IoModel* iomodel,int nummodels);
    16 void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type);
     16void CreateVertices(Elements* elements,Vertices* vertices,IoModel* iomodel,int solution_type,bool isamr=false);
    1717void CreateParameters(Parameters*parameters,IoModel* iomodel,char* rootpath,FILE* toolkitfile,const int solution_type);
    1818void CreateParametersAutodiff(Parameters* parameters,IoModel* iomodel);
     
    2424void UpdateElementsAndMaterialsDakota(Elements* elements,Materials* materials, IoModel* iomodel);
    2525void UpdateElementsTransient(Elements* elements,Parameters* parameters,IoModel* iomodel);
    26 void CreateNodes(Nodes*nodes, IoModel* iomodel,int analysis,int finite_element,int approximation=NoneApproximationEnum,int* approximations=NULL);
     26void CreateNodes(Nodes*nodes, IoModel* iomodel,int analysis,int finite_element,bool isamr=false,int approximation=NoneApproximationEnum,int* approximations=NULL);
    2727
    2828/*partitioning: */
Note: See TracChangeset for help on using the changeset viewer.