Ignore:
Timestamp:
09/11/13 14:22:13 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: cleaning up Node that is not an Update object anymore, and removed unused InputUpdateFromVector functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r16042 r16125  
    17671767void  Tria::InputUpdateFromVector(IssmDouble* vector, int name, int type){
    17681768
    1769         const int   numnodes = NUMVERTICES;
    1770         int        *doflist  = NULL;
    1771         IssmDouble  values[numnodes];
    17721769
    17731770        /*Check that name is an element input*/
    17741771        if (!IsInput(name)) return;
     1772
     1773        int         numnodes;
     1774        int        *doflist = NULL;
     1775        IssmDouble *values  = NULL;
    17751776
    17761777        switch(type){
     
    18021803
    18031804        case NodesEnum:
    1804                 _assert_(this->element_type==P1Enum);
    1805                 /*Get dof list: */
     1805
     1806                /*Get number of nodes and dof list: */
     1807                numnodes = this->NumberofNodes();
     1808                values   = xNew<IssmDouble>(numnodes);
    18061809                GetDofList(&doflist,NoneApproximationEnum,GsetEnum);
    18071810
     
    18091812                for(int i=0;i<numnodes;i++){
    18101813                        values[i]=vector[doflist[i]];
    1811                         if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
    1812                 }
     1814                        if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in vector");
     1815                }
     1816
    18131817                /*Add input to the element: */
    1814                 this->inputs->AddInput(new TriaInput(name,values,P1Enum));
     1818                this->inputs->AddInput(new TriaInput(name,values,this->element_type));
    18151819
    18161820                /*Free ressources:*/
     
    18191823
    18201824        case NodeSIdEnum:
    1821                 _assert_(this->element_type==P1Enum);
    1822                 for(int i=0;i<NUMVERTICES;i++){
     1825
     1826                /*Get number of nodes and dof list: */
     1827                numnodes = this->NumberofNodes();
     1828                values   = xNew<IssmDouble>(numnodes);
     1829
     1830                for(int i=0;i<numnodes;i++){
    18231831                        values[i]=vector[nodes[i]->Sid()];
    1824                         if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in solution vector");
     1832                        if(xIsNan<IssmDouble>(values[i])) _error_("NaN found in vector");
    18251833                }
    18261834                /*Add input to the element: */
    1827                 this->inputs->AddInput(new TriaInput(name,values,P1Enum));
     1835                this->inputs->AddInput(new TriaInput(name,values,this->element_type));
    18281836                return;
    18291837
     
    18321840        }
    18331841
    1834 }
    1835 /*}}}*/
    1836 /*FUNCTION Tria::InputUpdateFromVector(int* vector, int name, int type);{{{*/
    1837 void  Tria::InputUpdateFromVector(int* vector, int name, int type){
    1838         _error_("not supported yet!");
    1839 }
    1840 /*}}}*/
    1841 /*FUNCTION Tria::InputUpdateFromVector(bool* vector, int name, int type);{{{*/
    1842 void  Tria::InputUpdateFromVector(bool* vector, int name, int type){
    1843         _error_("not supported yet!");
     1842        /*Clean-up*/
     1843        xDelete<int>(doflist);
     1844        xDelete<IssmDouble>(values);
     1845
    18441846}
    18451847/*}}}*/
     
    55745576
    55755577        gauss=new GaussTria();
    5576         for (int iv=0;iv<NUMVERTICES;iv++){
     5578        for(int iv=0;iv<NUMVERTICES;iv++){
    55775579                gauss->GaussVertex(iv);
    55785580                surfaceslopex_input->GetInputValue(&dsdx,gauss);
     
    70037005        }
    70047006
    7005 }
    7006 /*}}}*/
    7007 /*FUNCTION Tria::InputUpdateFromVectorDakota(int* vector, int name, int type);{{{*/
    7008 void  Tria::InputUpdateFromVectorDakota(int* vector, int name, int type){
    7009         _error_("not supported yet!");
    7010 }
    7011 /*}}}*/
    7012 /*FUNCTION Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type);{{{*/
    7013 void  Tria::InputUpdateFromVectorDakota(bool* vector, int name, int type){
    7014         _error_("not supported yet!");
    70157007}
    70167008/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.