Changeset 14761


Ignore:
Timestamp:
04/25/13 15:25:53 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: elements and loads now have a pointer to vertices, this change is necessary because we are implementing quadratic elements and the number of nodes is not the same as the number of vertices. Vertices coordinates must be retrieved from the vertices, not the nodes

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

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Elements.cpp

    r14476 r14761  
    4747
    4848                element=dynamic_cast<Element*>((*object));
    49                 element->Configure(elements,loads,nodes,materials,parameters);
     49                element->Configure(elements,loads,nodes,vertices,materials,parameters);
    5050
    5151        }
  • issm/trunk-jpl/src/c/classes/objects/Elements/Element.h

    r14650 r14761  
    2727                virtual        ~Element(){};
    2828
    29                 virtual void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
     29                virtual void   Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
    3030                virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
    3131                virtual void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum)=0;
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.cpp

    r14735 r14761  
    2727Penta::Penta(){
    2828
    29         int i;
    30 
    31         this->nodes=NULL;
    32         this->material=NULL;
    33         this->matpar=NULL;
    34         this->verticalneighbors=NULL;
    35         this->inputs=NULL;
    36         this->parameters=NULL;
    37         this->results=NULL;
    38         for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
     29        this->nodes             = NULL;
     30        this->vertices          = NULL;
     31        this->material          = NULL;
     32        this->matpar            = NULL;
     33        this->verticalneighbors = NULL;
     34        this->inputs            = NULL;
     35        this->parameters        = NULL;
     36        this->results           = NULL;
     37        for(int i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
    3938}
    4039/*}}}*/
     
    8483
    8584        /*initialize pointers:*/
    86         this->nodes=NULL;
    87         this->material=NULL;
    88         this->matpar=NULL;
    89         this->verticalneighbors=NULL;
     85        this->nodes             = NULL;
     86        this->vertices          = NULL;
     87        this->material          = NULL;
     88        this->matpar            = NULL;
     89        this->verticalneighbors = NULL;
    9090}
    9191/*}}}*/
     
    107107        penta->hnodes=new Hook*[penta->numanalyses];
    108108        for(i=0;i<penta->numanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy();
     109        penta->hvertices=(Hook*)this->hvertices->copy();
    109110        penta->hmaterial=(Hook*)this->hmaterial->copy();
    110111        penta->hmatpar=(Hook*)this->hmatpar->copy();
     
    132133        penta->nodes=xNew<Node*>(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
    133134        for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i];
     135        penta->vertices=(Vertex**)penta->hvertices->deliverp();
    134136        penta->material=(Material*)penta->hmaterial->delivers();
    135137        penta->matpar=(Matpar*)penta->hmatpar->delivers();
     
    373375/*}}}*/
    374376                /*FUNCTION Penta::Configure {{{*/
    375 void  Penta::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     377void  Penta::Configure(Elements* elementsin, Loads* loadsin, Nodes* nodesin,Vertices* verticesin, Materials* materialsin, Parameters* parametersin){
    376378
    377379        int analysis_counter;
     
    386388         * datasets, using internal ids and offsets hidden in hooks: */
    387389        if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
     390        this->hvertices->configure(verticesin);
    388391        this->hmaterial->configure(materialsin);
    389392        this->hmatpar->configure(materialsin);
     
    393396        if (this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
    394397        else this->nodes=NULL;
    395         this->material=(Material*)this->hmaterial->delivers();
    396         this->matpar=(Matpar*)this->hmatpar->delivers();
    397         this->verticalneighbors=(Penta**)this->hneighbors->deliverp();
     398        this->vertices          = (Vertex**)this->hvertices->deliverp();
     399        this->material          = (Material*)this->hmaterial->delivers();
     400        this->matpar            = (Matpar*)this->hmatpar->delivers();
     401        this->verticalneighbors = (Penta**)this->hneighbors->deliverp();
    398402
    399403        /*point parameters to real dataset: */
     
    28492853        /*recover nodes, material and matpar: */
    28502854        tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();
     2855        tria->vertices=(Vertex**)tria->hvertices->deliverp();
    28512856        tria->matpar=(Matpar*)tria->hmatpar->delivers();
    28522857
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h

    r14650 r14761  
    3434                int          sid;
    3535
    36                 Node       **nodes;                       // 6 nodes
     36                Node       **nodes;                       // set of nodes
     37                Vertex     **vertices;                    // 6 vertices
    3738                Material    *material;                    // 1 material ice
    3839                Matpar      *matpar;                      // 1 material parameter
     
    7879                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    7980                void   ComputeStressTensor();
    80                 void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     81                void   Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    8182                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    8283                void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
  • issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.cpp

    r13909 r14761  
    2424PentaHook::PentaHook(){
    2525        numanalyses=UNDEF;
    26         this->hnodes=NULL;
    27         this->hmaterial=NULL;
    28         this->hmatpar=NULL;
    29         this->hneighbors=NULL;
     26        this->hnodes     = NULL;
     27        this->hvertices  = NULL;
     28        this->hmaterial  = NULL;
     29        this->hmatpar    = NULL;
     30        this->hneighbors = NULL;
    3031}
    3132/*}}}*/
     
    3940        }
    4041        delete [] this->hnodes;
     42        delete hvertices;
    4143        delete hmaterial;
    4244        delete hmatpar;
     
    4446}
    4547/*}}}*/
    46 /*FUNCTION PentaHook::PentaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
    47 PentaHook::PentaHook(int in_numanalyses,int material_id, IoModel* iomodel){
     48/*FUNCTION PentaHook::PentaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
     49PentaHook::PentaHook(int in_numanalyses,int element_id, IoModel* iomodel){
    4850
    4951        /*intermediary: */
    5052        int matpar_id;
     53        int material_id;
     54        int penta_vertex_ids[3];
    5155
    52         /*retrieve parameters: */
     56        /*retrieve material_id: */
    5357        iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
    5458
    55         this->numanalyses=in_numanalyses;
    56         this->hnodes=new Hook*[in_numanalyses];
    57         this->hmaterial=new Hook(&material_id,1);
    58         this->hmatpar=new Hook(&matpar_id,1);
    59         this->hneighbors=NULL;
     59        /*retrive material_id*/
     60        material_id = element_id;
     61
     62        /*retrieve vertices ids*/
     63        for(int i=0;i<6;i++){
     64                penta_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[6*(element_id-1)+i]);
     65        }
     66
     67
     68        this->numanalyses = in_numanalyses;
     69        this->hnodes      = new Hook*[in_numanalyses];
     70        this->hvertices   = new Hook(&penta_vertex_ids[0],6);
     71        this->hmaterial   = new Hook(&material_id,1);
     72        this->hmatpar     = new Hook(&matpar_id,1);
     73        this->hneighbors  = NULL;
    6074
    6175        //Initialize hnodes as NULL
     
    99113        // do not spawn hmaterial. material will be taken care of by Penta
    100114        triahook->hmaterial=NULL;
     115        triahook->hvertices=(Hook*)this->hvertices->Spawn(indices,3);
    101116        triahook->hmatpar=(Hook*)this->hmatpar->copy();
    102117}
  • issm/trunk-jpl/src/c/classes/objects/Elements/PentaHook.h

    r13909 r14761  
    1414        public:
    1515                int    numanalyses;   //number of analysis types
    16                 Hook **hnodes;        // 6 nodes for each analysis type
     16                Hook **hnodes;        // set of nodes for each analysis type
     17                Hook  *hvertices;     // 6 vertices for each analysis type
    1718                Hook  *hmaterial;     // 1 ice material
    1819                Hook  *hmatpar;       // 1 material parameter
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r14757 r14761  
    3131        int i;
    3232
    33         this->nodes=NULL;
    34         this->material=NULL;
    35         this->matpar=NULL;
     33        this->nodes    = NULL;
     34        this->vertices = NULL;
     35        this->material = NULL;
     36        this->matpar   = NULL;
    3637        for(i=0;i<3;i++)this->horizontalneighborsids[i]=UNDEF;
    37         this->inputs=NULL;
    38         this->parameters=NULL;
    39         this->results=NULL;
     38        this->inputs     = NULL;
     39        this->parameters = NULL;
     40        this->results    = NULL;
    4041
    4142}
     
    6263
    6364                /*initialize pointers:*/
    64                 this->nodes=NULL;
    65                 this->material=NULL;
    66                 this->matpar=NULL;
     65                this->nodes    = NULL;
     66                this->vertices = NULL;
     67                this->material = NULL;
     68                this->matpar   = NULL;
    6769
    6870}
     
    9193        tria->hnodes=new Hook*[tria->numanalyses];
    9294        for(i=0;i<tria->numanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy();
     95        tria->hvertices=(Hook*)this->hvertices->copy();
    9396        tria->hmaterial=(Hook*)this->hmaterial->copy();
    9497        tria->hmatpar=(Hook*)this->hmatpar->copy();
     
    115118        tria->nodes=xNew<Node*>(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes.
    116119        for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i];
     120        tria->vertices=(Vertex**)tria->hvertices->deliverp();
    117121        tria->material=(Material*)tria->hmaterial->delivers();
    118122        tria->matpar=(Matpar*)tria->hmatpar->delivers();
     
    887891/*}}}*/
    888892/*FUNCTION Tria::Configure {{{*/
    889 void  Tria::Configure(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
     893void  Tria::Configure(Elements* elementsin, Loads* loadsin,Nodes* nodesin,Vertices *verticesin,Materials* materialsin, Parameters* parametersin){
    890894
    891895        /*go into parameters and get the analysis_counter: */
     
    899903         * datasets, using internal ids and offsets hidden in hooks: */
    900904        if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin);
     905        this->hvertices->configure(verticesin);
    901906        this->hmaterial->configure(materialsin);
    902907        this->hmatpar->configure(materialsin);
     
    905910        if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();
    906911        else this->nodes=NULL;
    907         this->material=(Material*)this->hmaterial->delivers();
    908         this->matpar=(Matpar*)this->hmatpar->delivers();
     912        this->vertices = (Vertex**)this->hvertices->deliverp();
     913        this->material = (Material*)this->hmaterial->delivers();
     914        this->matpar   = (Matpar*)this->hmatpar->delivers();
    909915
    910916        /*point parameters to real dataset: */
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.h

    r14757 r14761  
    3232                int          sid;
    3333
    34                 Node       **nodes;                       // 3 nodes
     34                Node       **nodes;                       // nodes
     35                Vertex     **vertices;                    // 3 vertices
    3536                Material    *material;                    // 1 material ice
    3637                Matpar      *matpar;                      // 1 material parameter
     
    7475                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    7576                void   ComputeStressTensor();
    76                 void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
     77                void   Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters);
    7778                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    7879                void   SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
  • issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.cpp

    r13622 r14761  
    2424TriaHook::TriaHook(){
    2525        numanalyses=UNDEF;
    26         this->hnodes=NULL;
    27         this->hmaterial=NULL;
    28         this->hmatpar=NULL;
     26        this->hnodes    = NULL;
     27        this->hvertices = NULL;
     28        this->hmaterial = NULL;
     29        this->hmatpar   = NULL;
    2930}
    3031/*}}}*/
     
    3637                if (this->hnodes[i]) delete this->hnodes[i];
    3738        }
    38         delete [] this->hnodes;
     39        delete [] hnodes;
     40        delete hvertices;
    3941        delete hmaterial;
    4042        delete hmatpar;
     
    4244}
    4345/*}}}*/
    44 /*FUNCTION TriaHook::TriaHook(int in_numanalyses,int material_id, int matpar_id){{{*/
    45 TriaHook::TriaHook(int in_numanalyses,int material_id, IoModel* iomodel){
     46/*FUNCTION TriaHook::TriaHook(int in_numanalyses,int element_id, int matpar_id){{{*/
     47TriaHook::TriaHook(int in_numanalyses,int element_id, IoModel* iomodel){
    4648
    4749        /*intermediary: */
    4850        int matpar_id;
     51        int material_id;
     52        int tria_vertex_ids[3];
    4953
    50         /*retrieve parameters: */
     54        /*retrieve material_id: */
    5155        iomodel->Constant(&matpar_id,MeshNumberofelementsEnum); matpar_id++;
    5256
    53         this->numanalyses=in_numanalyses;
    54         this->hnodes= new Hook*[in_numanalyses];
    55         this->hmaterial=new Hook(&material_id,1);
    56         this->hmatpar=new Hook(&matpar_id,1);
     57        /*retrive material_id*/
     58        material_id = element_id;
     59
     60        /*retrieve vertices ids*/
     61        for(int i=0;i<3;i++){
     62                tria_vertex_ids[i]=reCast<int>(iomodel->Data(MeshElementsEnum)[3*(element_id-1)+i]);
     63        }
     64
     65        this->numanalyses = in_numanalyses;
     66        this->hnodes      = new Hook*[in_numanalyses];
     67        this->hvertices   = new Hook(&tria_vertex_ids[0],3);
     68        this->hmaterial   = new Hook(&material_id,1);
     69        this->hmatpar     = new Hook(&matpar_id,1);
    5770
    5871        //Initialize hnodes as NULL
  • issm/trunk-jpl/src/c/classes/objects/Elements/TriaHook.h

    r13623 r14761  
    1212
    1313        public:
    14                 int    numanalyses; //number of analysis types
    15                 Hook** hnodes; // 3 nodes for each analysis type
    16                 Hook*  hmaterial; // 1 ice material
    17                 Hook*  hmatpar; // 1 material parameter
     14                int    numanalyses;   //number of analysis types
     15                Hook **hnodes;        // nodes for each analysis type
     16                Hook  *hvertices;     // 3 vertices
     17                Hook  *hmaterial;     // 1 ice material
     18                Hook  *hmatpar;       // 1 material parameter
    1819
    1920                /*FUNCTION constructors, destructors {{{*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.cpp

    r14688 r14761  
    3232        this->hnodes=NULL;
    3333        this->nodes= NULL;
     34        this->hvertices=NULL;
     35        this->vertices= NULL;
    3436        this->helement=NULL;
    3537        this->element= NULL;
     
    5153        int  icefront_mparid;
    5254        int  icefront_node_ids[NUMVERTICESQUA]; //initialize with largest size
     55        int  icefront_vertex_ids[NUMVERTICESQUA]; //initialize with largest size
    5356        int  icefront_fill;
    5457
     
    7477                icefront_node_ids[0]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
    7578                icefront_node_ids[1]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
     79                icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
     80                icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
    7681        }
    7782        else if (in_icefront_type==PattynIceFrontEnum || in_icefront_type==StokesIceFrontEnum){
     
    8085                icefront_node_ids[2]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
    8186                icefront_node_ids[3]=iomodel->nodecounter+reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
     87                icefront_vertex_ids[0]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+0));
     88                icefront_vertex_ids[1]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+1));
     89                icefront_vertex_ids[2]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+2));
     90                icefront_vertex_ids[3]=reCast<int>(*(iomodel->Data(DiagnosticIcefrontEnum)+segment_width*i+3));
    8291        }
    8392        else _error_("in_icefront_type " << EnumToStringx(in_icefront_type) << " not supported yet!");
     
    97106        /*Hooks: */
    98107        this->hnodes=new Hook(icefront_node_ids,num_nodes);
     108        this->hvertices=new Hook(icefront_vertex_ids,num_nodes);
    99109        this->helement=new Hook(&icefront_eid,1);
    100110        this->hmatpar=new Hook(&icefront_mparid,1);
     
    106116
    107117        //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this.
    108         this->parameters=NULL;
    109         this->nodes= NULL;
    110         this->element= NULL;
    111         this->matpar= NULL;
     118        this->parameters = NULL;
     119        this->nodes      = NULL;
     120        this->vertices   = NULL;
     121        this->element    = NULL;
     122        this->matpar     = NULL;
    112123}
    113124
     
    118129        this->parameters=NULL;
    119130        delete hnodes;
     131        delete hvertices;
    120132        delete helement;
    121133        delete hmatpar;
     
    130142        _printLine_("   analysis_type: " << EnumToStringx(analysis_type));
    131143        hnodes->Echo();
     144        hvertices->Echo();
    132145        helement->Echo();
    133146        hmatpar->Echo();
     
    145158        _printLine_("   analysis_type: " << EnumToStringx(analysis_type));
    146159        hnodes->DeepEcho();
     160        hvertices->DeepEcho();
    147161        helement->DeepEcho();
    148162        hmatpar->DeepEcho();
     
    183197
    184198        /*now deal with hooks and objects: */
    185         icefront->hnodes=(Hook*)this->hnodes->copy();
    186         icefront->helement=(Hook*)this->helement->copy();
    187         icefront->hmatpar=(Hook*)this->hmatpar->copy();
     199        icefront->hnodes    = (Hook*)this->hnodes->copy();
     200        icefront->hvertices = (Hook*)this->hvertices->copy();
     201        icefront->helement  = (Hook*)this->helement->copy();
     202        icefront->hmatpar   = (Hook*)this->hmatpar->copy();
    188203
    189204        /*corresponding fields*/
    190         icefront->nodes  =(Node**)icefront->hnodes->deliverp();
    191         icefront->element=(Element*)icefront->helement->delivers();
    192         icefront->matpar =(Matpar*)icefront->hmatpar->delivers();
     205        icefront->nodes    = (Node**)icefront->hnodes->deliverp();
     206        icefront->vertices = (Vertex**)icefront->hvertices->deliverp();
     207        icefront->element  = (Element*)icefront->helement->delivers();
     208        icefront->matpar   = (Matpar*)icefront->hmatpar->delivers();
    193209
    194210        return icefront;
     
    204220         * datasets, using internal ids and offsets hidden in hooks: */
    205221        hnodes->configure(nodesin);
     222        hvertices->configure(verticesin);
    206223        helement->configure(elementsin);
    207224        hmatpar->configure(materialsin);
    208225
    209226        /*Initialize hooked fields*/
    210         this->nodes  =(Node**)hnodes->deliverp();
    211         this->element=(Element*)helement->delivers();
    212         this->matpar =(Matpar*)hmatpar->delivers();
     227        this->nodes    = (Node**)hnodes->deliverp();
     228        this->vertices = (Vertex**)hvertices->deliverp();
     229        this->element  = (Element*)helement->delivers();
     230        this->matpar   = (Matpar*)hmatpar->delivers();
    213231
    214232        /*point parameters to real dataset: */
  • issm/trunk-jpl/src/c/classes/objects/Loads/Icefront.h

    r13925 r14761  
    2626
    2727                /*hooks: */
    28                 Hook* hnodes;
    29                 Hook* helement;
    30                 Hook* hmatpar;
     28                Hook *hnodes;
     29                Hook *hvertices;
     30                Hook *helement;
     31                Hook *hmatpar;
    3132
    3233                /*Corresponding fields*/
    3334                Matpar   *matpar;
    3435                Node    **nodes;
     36                Vertex  **vertices;
    3537                Element  *element;
    3638
    3739                /*inputs and parameters: */
    38                 Inputs* inputs;
    39                 Parameters* parameters;
     40                Inputs     *inputs;
     41                Parameters *parameters;
    4042
    4143                /*Icefront constructors, destructors: {{{*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.cpp

    r14688 r14761  
    2626/*FUNCTION Numericalflux::Numericalflux(){{{*/
    2727Numericalflux::Numericalflux(){
    28         this->inputs=NULL;
    29         this->parameters=NULL;
    30         this->helement=NULL;
    31         this->element=NULL;
    32         this->hnodes=NULL;
    33         this->nodes=NULL;
     28        this->inputs     = NULL;
     29        this->parameters = NULL;
     30        this->helement   = NULL;
     31        this->element    = NULL;
     32        this->hnodes     = NULL;
     33        this->hvertices  = NULL;
     34        this->nodes      = NULL;
    3435}
    3536/*}}}*/
     
    4849        int   numericalflux_elem_ids[2];
    4950        int   numericalflux_mparid;
     51        int   numericalflux_vertex_ids[2];
    5052        int   numericalflux_node_ids[4];
    5153        int   numericalflux_type;
     
    8385        i1=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+0]);
    8486        i2=reCast<int>(iomodel->Data(MeshEdgesEnum)[4*i+1]);
    85 
     87        numericalflux_vertex_ids[0]=i1;
     88        numericalflux_vertex_ids[1]=i2;
     89
     90        /*2: Get node ids*/
    8691        if (numericalflux_type==InternalEnum){
    8792
     
    126131
    127132        /*Hooks: */
    128         this->hnodes  =new Hook(numericalflux_node_ids,num_nodes);
    129         this->helement=new Hook(numericalflux_elem_ids,1); // take only the first element for now
     133        this->hnodes    =new Hook(numericalflux_node_ids,num_nodes);
     134        this->hvertices =new Hook(numericalflux_vertex_ids,2);
     135        this->helement  =new Hook(numericalflux_elem_ids,1); // take only the first element for now
    130136
    131137        //intialize  and add as many inputs per element as requested:
     
    145151        delete helement;
    146152        delete hnodes;
     153        delete hvertices;
    147154}
    148155/*}}}*/
     
    155162        _printLine_("   analysis_type: " << EnumToStringx(analysis_type));
    156163        hnodes->Echo();
     164        hvertices->Echo();
    157165        helement->Echo();
    158166        _printLine_("   parameters: " << parameters);
     
    167175        _printLine_("   analysis_type: " << EnumToStringx(analysis_type));
    168176        hnodes->DeepEcho();
     177        hvertices->DeepEcho();
    169178        helement->DeepEcho();
    170179        _printLine_("   parameters");
     
    210219
    211220        /*now deal with hooks and objects: */
    212         numericalflux->hnodes=(Hook*)this->hnodes->copy();
    213         numericalflux->helement=(Hook*)this->helement->copy();
     221        numericalflux->hnodes    = (Hook*)this->hnodes->copy();
     222        numericalflux->hvertices = (Hook*)this->hvertices->copy();
     223        numericalflux->helement  = (Hook*)this->helement->copy();
    214224
    215225        /*corresponding fields*/
    216         numericalflux->nodes  =(Node**)numericalflux->hnodes->deliverp();
    217         numericalflux->element=(Element*)numericalflux->helement->delivers();
     226        numericalflux->nodes    = (Node**)numericalflux->hnodes->deliverp();
     227        numericalflux->vertices = (Vertex**)numericalflux->hvertices->deliverp();
     228        numericalflux->element  = (Element*)numericalflux->helement->delivers();
    218229
    219230        return numericalflux;
     
    228239         * datasets, using internal ids and offsets hidden in hooks: */
    229240        hnodes->configure(nodesin);
     241        hvertices->configure(verticesin);
    230242        helement->configure(elementsin);
    231243
    232244        /*Initialize hooked fields*/
    233         this->nodes  =(Node**)hnodes->deliverp();
    234         this->element=(Element*)helement->delivers();
     245        this->nodes    = (Node**)hnodes->deliverp();
     246        this->vertices = (Vertex**)hvertices->deliverp();
     247        this->element  = (Element*)helement->delivers();
    235248
    236249        /*point parameters to real dataset: */
    237250        this->parameters=parametersin;
    238 
    239251}
    240252/*}}}*/
  • issm/trunk-jpl/src/c/classes/objects/Loads/Numericalflux.h

    r13925 r14761  
    2626                Hook *helement;
    2727                Hook *hnodes;
     28                Hook *hvertices;
    2829
    2930                /*Corresponding fields*/
    3031                Element     *element;
     32                Vertex     **vertices;
    3133                Node       **nodes;
    3234                Parameters  *parameters;
     
    3941                /*}}}*/
    4042                /*Object virtual functions definitions:{{{ */
    41                 void  Echo();
    42                 void  DeepEcho();
    43                 int   Id();
    44                 int   ObjectEnum();
    45                 Object* copy();
     43                void    Echo();
     44                void    DeepEcho();
     45                int     Id();
     46                int     ObjectEnum();
     47                Object *copy();
    4648                /*}}}*/
    4749                /*Update virtual functions resolution: {{{*/
    48                 void    InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
    49                 void    InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
    50                 void    InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
    51                 void    InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
    52                 void    InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
    53                 void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
    54                 void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
    55                 void    InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
    56                 void    InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
    57                 void    InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
    58                 void    InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
    59                 void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
     50                void InputUpdateFromVector(IssmDouble* vector, int name, int type){/*Do nothing*/}
     51                void InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
     52                void InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
     53                void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){/*Do nothing*/}
     54                void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){/*Do nothing*/}
     55                void InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
     56                void InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
     57                void InputUpdateFromConstant(IssmDouble constant, int name){/*Do nothing*/};
     58                void InputUpdateFromConstant(int constant, int name){/*Do nothing*/};
     59                void InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
     60                void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
     61                void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
    6062                /*}}}*/
    6163                /*Load virtual functions definitions: {{{*/
    62                 void  Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    63                 void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
    64                 void  CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
    65                 void  CreatePVector(Vector<IssmDouble>* pf);
    66                 void  GetNodesSidList(int* sidlist);
    67                 int   GetNumberOfNodes(void);
    68                 void  CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
    69                 bool  IsPenalty(void);
    70                 void  PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
    71                 void  PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
    72                 void  PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
    73                 void  SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
    74                 bool  InAnalysis(int analysis_type);
     64                void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     65                void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
     66                void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs);
     67                void CreatePVector(Vector<IssmDouble>* pf);
     68                void GetNodesSidList(int* sidlist);
     69                int  GetNumberOfNodes(void);
     70                void CreateJacobianMatrix(Matrix<IssmDouble>* Jff){_error_("Not implemented yet");};
     71                bool IsPenalty(void);
     72                void PenaltyCreateJacobianMatrix(Matrix<IssmDouble>* Jff,IssmDouble kmax){_error_("Not implemented yet");};
     73                void PenaltyCreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* kfs, IssmDouble kmax);
     74                void PenaltyCreatePVector(Vector<IssmDouble>* pf, IssmDouble kmax);
     75                void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int set1_enum,int set2_enum);
     76                bool InAnalysis(int analysis_type);
    7577                /*}}}*/
    7678                /*Numericalflux management:{{{*/
    77                 void  GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
     79                void           GetNormal(IssmDouble* normal,IssmDouble xyz_list[4][3]);
    7880                ElementMatrix* CreateKMatrixPrognostic(void);
    7981                ElementMatrix* CreateKMatrixPrognosticInternal(void);
  • issm/trunk-jpl/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp

    r13798 r14761  
    1414
    1515        /*Intermediary*/
     16        int i;
    1617        int noerr=1;
    17         int i;
    18         Element* element=NULL;
    19         Load* load=NULL;
    20         Node* node=NULL;
    21         Material* material=NULL;
    2218        int configuration_type;
     19        Element  *element  = NULL;
     20        Load     *load     = NULL;
     21        Node     *node     = NULL;
     22        Material *material = NULL;
    2323
    2424        /*Get analysis type: */
     
    2828        for (i=0;i<elements->Size();i++){
    2929                element=dynamic_cast<Element*>(elements->GetObjectByOffset(i));
    30                 element->Configure(elements,loads,nodes,materials,parameters);
     30                element->Configure(elements,loads,nodes,vertices,materials,parameters);
    3131        }
    3232        if(VerboseMProcessor()) _pprintLine_("      Configuring loads...");
Note: See TracChangeset for help on using the changeset viewer.