Changeset 25954
- Timestamp:
- 01/26/21 12:08:05 (4 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.cpp ¶
r25947 r25954 14 14 #include "../shared/io/io.h" 15 15 #include "./classes.h" 16 #include "./Inputs/TriaInput.h" 16 17 #include "./modules/modules.h" 17 18 #include "../shared/Enum/Enum.h" … … 2112 2113 2113 2114 }/*}}}*/ 2115 void FemModel::MmeToInputFromId(int id, int rootenum, int interpolationenum){ /*{{{*/ 2116 2117 TransientInput* transientinput = NULL; 2118 TransientInput* transientinput2 = NULL; 2119 Tria* element = NULL; 2120 IssmDouble value; 2121 IssmDouble* values = NULL; 2122 IssmDouble* times = NULL; 2123 int N; 2124 2125 /*find thickness dataset: */ 2126 DatasetInput* datasetinput = this->inputs->GetDatasetInput(rootenum); 2127 2128 /*Initialize new transient input: */ 2129 transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput); 2130 transientinput->GetAllTimes(×,&N); 2131 this->inputs->SetTransientInput(DummyEnum,times,N); 2132 transientinput2 = this->inputs->GetTransientInput(DummyEnum); 2133 2134 for(Object* & object : this->elements->objects){ 2135 Tria* element=xDynamicCast<Tria*>(object); 2136 2137 /*recover the right field from the mme: */ 2138 transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput); 2139 2140 /*copy values from the transientinput to the final transientinput2: */ 2141 for (int j=0;j<N;j++){ 2142 TriaInput* tria_input=transientinput->GetTriaInput(j); 2143 element->InputServe(tria_input); 2144 if(interpolationenum==P0Enum){ 2145 value=tria_input->element_values[0]; 2146 transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum); 2147 } 2148 else if(interpolationenum==P1Enum){ 2149 2150 /*Get values and lid list*/ 2151 const int numvertices = element->GetNumberOfVertices(); 2152 int *vertexlids = xNew<int>(numvertices); 2153 int *vertexsids = xNew<int>(numvertices); 2154 2155 /*Recover vertices ids needed to initialize inputs*/ 2156 element->GetVerticesLidList(&vertexlids[0]); 2157 element->GetVerticesSidList(&vertexsids[0]); 2158 values=tria_input->element_values; 2159 transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum); 2160 } 2161 } 2162 } 2163 2164 /*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/ 2165 this->inputs->ChangeEnum(DummyEnum,rootenum); 2166 2167 //reconfigure: 2168 transientinput2->Configure(this->parameters); 2169 } //}}} 2114 2170 void FemModel::OmegaAbsGradientx( IssmDouble* pJ){/*{{{*/ 2115 2171 -
TabularUnified issm/trunk-jpl/src/c/classes/FemModel.h ¶
r25947 r25954 130 130 void MinVyx(IssmDouble* presponse); 131 131 void MinVzx(IssmDouble* presponse); 132 void MmeToInputFromId(int id, int rootenum, int interpolationenum); 132 133 void DistanceToFieldValue(int fieldenum,IssmDouble fieldvalue,int distanceenum); 133 134 void ResetLevelset(); -
TabularUnified issm/trunk-jpl/src/c/cores/sealevelchange_core.cpp ¶
r25953 r25954 146 146 femmodel->parameters->FindParam(&modelid,SolidearthExternalModelidEnum); 147 147 /*replace dataset of forcings with only one, the modelid'th:*/ 148 printf("-------------- file: sealevelchange_core.cpp line: %i\n",__LINE__); 149 printf("TEMPORARY FIX: uncomment lines below!\n"); 150 //MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum); 151 //MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum); 152 //MmeToInputFromId(femmodel,modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum); 153 //MmeToInputFromId(femmodel,modelid,SolidearthExternalGeoidRateEnum, P1Enum); 154 //MmeToInputFromId(femmodel,modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum); 148 femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementNorthRateEnum, P1Enum); 149 femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementEastRateEnum, P1Enum); 150 femmodel->MmeToInputFromId(modelid,SolidearthExternalDisplacementUpRateEnum, P1Enum); 151 femmodel->MmeToInputFromId(modelid,SolidearthExternalGeoidRateEnum, P1Enum); 152 femmodel->MmeToInputFromId(modelid,SolidearthExternalBarystaticSeaLevelRateEnum, P1Enum); 155 153 } 156 154 -
TabularUnified issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp ¶
r25947 r25954 265 265 transientinput2->Configure(femmodel->parameters); 266 266 } //}}} 267 void MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum){ /*{{{*/268 269 TransientInput* transientinput = NULL;270 TransientInput* transientinput2 = NULL;271 Tria* element = NULL;272 IssmDouble value;273 IssmDouble* values = NULL;274 IssmDouble* times = NULL;275 int N;276 277 /*find thickness dataset: */278 DatasetInput* datasetinput = femmodel->inputs->GetDatasetInput(rootenum);279 280 /*Initialize new transient input: */281 transientinput = datasetinput->GetTransientInputByOffset(0); _assert_(transientinput);282 transientinput->GetAllTimes(×,&N);283 femmodel->inputs->SetTransientInput(DummyEnum,times,N);284 transientinput2 = femmodel->inputs->GetTransientInput(DummyEnum);285 286 for(Object* & object : femmodel->elements->objects){287 Tria* element=xDynamicCast<Tria*>(object);288 289 /*recover the right field from the mme: */290 transientinput = datasetinput->GetTransientInputByOffset(id); _assert_(transientinput);291 292 /*copy values from the transientinput to the final transientinput2: */293 for (int j=0;j<N;j++){294 TriaInput* tria_input=transientinput->GetTriaInput(j);295 element->InputServe(tria_input);296 if(interpolationenum==P0Enum){297 value=tria_input->element_values[0];298 transientinput2->AddTriaTimeInput( j,1,&(element->lid),&value,P0Enum);299 }300 else if(interpolationenum==P1Enum){301 302 /*Get values and lid list*/303 const int numvertices = element->GetNumberOfVertices();304 int *vertexlids = xNew<int>(numvertices);305 int *vertexsids = xNew<int>(numvertices);306 307 /*Recover vertices ids needed to initialize inputs*/308 element->GetVerticesLidList(&vertexlids[0]);309 element->GetVerticesSidList(&vertexsids[0]);310 values=tria_input->element_values;311 transientinput2->AddTriaTimeInput( j,numvertices,vertexlids,values,P1Enum);312 }313 }314 }315 316 /*wipe out existing SurfaceloadIceThicknessChangeEnum dataset:*/317 femmodel->inputs->ChangeEnum(DummyEnum,rootenum);318 319 //reconfigure:320 transientinput2->Configure(femmodel->parameters);321 } //}}}322 267 void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name){ /*{{{*/ 323 268 -
TabularUnified issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.h ¶
r25947 r25954 11 11 void InputUpdateSpecialtyCode(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,char* root); 12 12 void MmeToInput(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* variable_partition,int npart,int rootenum, int interpolationenum); 13 void MmeToInputFromId(FemModel* femmodel,int id, int rootenum, int interpolationenum);14 13 void InputScaleFromDakotax(FemModel* femmodel,IssmDouble* distributed_values,IssmDouble* partition, int npart, int nt, int name); 15 14
Note:
See TracChangeset
for help on using the changeset viewer.