Changeset 27216


Ignore:
Timestamp:
08/17/22 15:52:36 (3 years ago)
Author:
Eric.Larour
Message:

CHG: MmeToInputx needs to be its own module.

Location:
issm/branches/trunk-larour-SLPS2022/src/c
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/branches/trunk-larour-SLPS2022/src/c/Makefile.am

    r27084 r27216  
    199199        ./toolkits/ToolkitOptions.cpp \
    200200        ./modules/MmeToInputFromIdx/MmeToInputFromIdx.cpp\
     201        ./modules/MmeToInputx/MmeToInputx.cpp\
    201202        ./modules/ModelProcessorx/ModelProcessorx.cpp \
    202203        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp \
  • issm/branches/trunk-larour-SLPS2022/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp

    r27138 r27216  
    190190
    191191}       //}}}
    192 void  MmeToInputx(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,int rootenum, int interpolationenum){ /*{{{*/
    193 
    194         TransientInput* transientinput  = NULL;
    195         TransientInput* transientinput2 = NULL;
    196         Tria* element                    = NULL;
    197         IssmDouble value;
    198         IssmDouble* values               = NULL;
    199         IssmDouble* times                = NULL;
    200         int N;
    201         int id;
    202 
    203         /*find thickness dataset: */
    204         DatasetInput* datasetinput = femmodel->inputs->GetDatasetInput(rootenum);
    205 
    206         /*Initialize new transient input: */
    207         transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);
    208         transientinput->GetAllTimes(&times,&N);
    209         femmodel->inputs->SetTransientInput(DummyEnum,times,N);
    210         transientinput2 = femmodel->inputs->GetTransientInput(DummyEnum); transientinput2->Configure(femmodel->parameters);
    211 
    212         for(Object* & object : femmodel->elements->objects){
    213                 Tria*   element=xDynamicCast<Tria*>(object);
    214 
    215                 if((int)variable_partition[element->Sid()]==-1)id=0; //grab background field
    216                 else id=distributed_values[(int)variable_partition[element->Sid()]]-1; //grab partition field
    217 
    218                 /*recover the right field from the mme: */
    219                 transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);
    220 
    221                 /*copy values from the transientinput to the final transientinput2: */
    222                 for (int j=0;j<N;j++){
    223                         TriaInput* tria_input=transientinput->GetTriaInput(j);
    224                         element->InputServe(tria_input);
    225                         if(interpolationenum==P0Enum){
    226                                 value=tria_input->element_values[0];
    227                                 transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);
    228                         }
    229                         else if(interpolationenum==P1Enum){
    230 
    231                                 /*Get values and lid list*/
    232                                 const int   numvertices     = element->GetNumberOfVertices();
    233                                 int        *vertexlids      = xNew<int>(numvertices);
    234                                 int        *vertexsids      = xNew<int>(numvertices);
    235 
    236                                 /*Recover vertices ids needed to initialize inputs*/
    237                                 element->GetVerticesLidList(&vertexlids[0]);
    238                                 element->GetVerticesSidList(&vertexsids[0]);
    239                                 values=tria_input->element_values;
    240                                 transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);
    241                         }
    242                 }
    243         }
    244 
    245         /*wipe out existing SurfaceloadIceThicknessRateEnum dataset:*/
    246         femmodel->inputs->ChangeEnum(DummyEnum,rootenum);
    247 
    248 }       //}}}
    249192void  InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name){ /*{{{*/
    250193
  • issm/branches/trunk-larour-SLPS2022/src/c/modules/modules.h

    r27076 r27216  
    7373#include "./ModelProcessorx/ModelProcessorx.h"
    7474#include "./MmeToInputFromIdx/MmeToInputFromIdx.h"
     75#include "./MmeToInputx/MmeToInputx.h"
    7576#include "./ParseToolkitsOptionsx/ParseToolkitsOptionsx.h"
    7677#include "./NodalValuex/NodalValuex.h"
Note: See TracChangeset for help on using the changeset viewer.