Ignore:
Timestamp:
03/11/21 10:05:44 (4 years ago)
Author:
Eric.Larour
Message:

CHG: fixed test2001 by modifying the mass transport core. Now create inputs
directly in the core, not the MassTransportAnalysis::InputUpdateFromSolution.
Also need a new IoModel::InputToConstant routine.

File:
1 edited

Legend:

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

    r26058 r26073  
    17091709}
    17101710/*}}}*/
     1711void       Element::InputCreateP1FromConstant(Inputs* inputs,IoModel* iomodel,IssmDouble value_in,int vector_enum){/*{{{*/
     1712
     1713        const int NUM_VERTICES = this->GetNumberOfVertices();
     1714
     1715        int        vertexids[MAXVERTICES];
     1716        int        vertexlids[MAXVERTICES];
     1717        IssmDouble values[MAXVERTICES];
     1718
     1719        /*Recover vertices ids needed to initialize inputs*/
     1720        _assert_(iomodel->elements);
     1721        for(int i=0;i<NUM_VERTICES;i++){
     1722                vertexids[i] =reCast<int>(iomodel->elements[NUM_VERTICES*this->Sid()+i]); //ids for vertices are in the elements array from Matlab
     1723                vertexlids[i]=iomodel->my_vertices_lids[vertexids[i]-1];
     1724        }
     1725
     1726        for(int i=0;i<NUM_VERTICES;i++) values[i]=value_in;
     1727        this->SetElementInput(inputs,NUM_VERTICES,vertexlids,values,vector_enum);
     1728
     1729}
     1730/*}}}*/
    17111731void       Element::ControlInputCreate(IssmDouble* vector,IssmDouble* min_vector,IssmDouble* max_vector,Inputs* inputs,IoModel* iomodel,int M,int N,IssmDouble scale,int input_enum,int id){/*{{{*/
    17121732
     
    19461966        /*update input*/
    19471967        this->SetElementInput(name,constant);
     1968}
     1969/*}}}*/
     1970void       Element::InputUpdateFromConstant(IssmDouble constant, int name, int type){/*{{{*/
     1971
     1972        /*Check that name is an element input*/
     1973        if(!IsInputEnum(name)) return;
     1974
     1975        /*update input*/
     1976        this->SetElementInput(name,constant,type);
    19481977}
    19491978/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.