Changeset 24366
- Timestamp:
- 11/20/19 05:11:35 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r24359 r24366 280 280 if(M!=iomodel->numberofvertices) _error_("not supported yet"); 281 281 if(N!=num_inputs) _error_("sizes are not consistent"); 282 282 283 283 284 284 int tria_vertex_ids[3]; … … 2128 2128 /*stack the input for each timestep in the slice*/ 2129 2129 int offset = start_offset; 2130 while(offset < =end_offset ){2130 while(offset < end_offset ){ 2131 2131 2132 2132 if(offset==-1){ … … 2142 2142 } 2143 2143 else{ 2144 TriaInput2* input = transient_input->GetTriaInput(offset );2144 TriaInput2* input = transient_input->GetTriaInput(offset+1); 2145 2145 _assert_(input->GetInterpolation()==P1Enum); 2146 2146 this->InputServe(input); … … 2155 2155 dt = timesteps[0] - start_time; 2156 2156 } 2157 else if(offset = numtimesteps-1){2157 else if(offset == numtimesteps-1){ 2158 2158 dt = end_time - timesteps[offset]; 2159 2159 } … … 2176 2176 } 2177 2177 else{ 2178 for(int iv=0;iv<NUMVERTICES;iv++) averaged_values[iv] += dt*current_values[iv];2178 for(int iv=0;iv<NUMVERTICES;iv++) averaged_values[iv] *= dt*current_values[iv]; 2179 2179 } 2180 2180 break; … … 2189 2189 for(int iv=0;iv<NUMVERTICES;iv++){ 2190 2190 _assert_(current_values[iv]>1.e-50); 2191 averaged_values[iv] = dt*1./current_values[iv];2191 averaged_values[iv] += dt*1./current_values[iv]; 2192 2192 } 2193 2193 } … … 3843 3843 3844 3844 /*First, serarch the input: */ 3845 Input2* data=this->GetInput2(natureofdataenum); 3845 Input2* data=this->GetInput2(natureofdataenum); 3846 3846 3847 3847 /*figure out if we have the vertex id: */ … … 4759 4759 /*Get material parameters :*/ 4760 4760 rho_ice=FindParam(MaterialsRhoIceEnum); 4761 Input2* floatingmelt_input = this->GetInput2(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 4761 Input2* floatingmelt_input = this->GetInput2(BasalforcingsFloatingiceMeltingRateEnum); _assert_(floatingmelt_input); 4762 4762 Input2* gllevelset_input = this->GetInput2(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 4763 4763 Input2* scalefactor_input = NULL; 4764 4764 if(scaled==true){ 4765 scalefactor_input = this->GetInput2(MeshScaleFactorEnum); _assert_(scalefactor_input); 4765 scalefactor_input = this->GetInput2(MeshScaleFactorEnum); _assert_(scalefactor_input); 4766 4766 } 4767 4767 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 4804 4804 /*Get material parameters :*/ 4805 4805 rho_ice=FindParam(MaterialsRhoIceEnum); 4806 Input2* groundedmelt_input = this->GetInput2(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 4806 Input2* groundedmelt_input = this->GetInput2(BasalforcingsGroundediceMeltingRateEnum); _assert_(groundedmelt_input); 4807 4807 Input2* gllevelset_input = this->GetInput2(MaskGroundediceLevelsetEnum); _assert_(gllevelset_input); 4808 4808 Input2* scalefactor_input = NULL; 4809 4809 if(scaled==true){ 4810 scalefactor_input = this->GetInput2(MeshScaleFactorEnum); _assert_(scalefactor_input); 4810 scalefactor_input = this->GetInput2(MeshScaleFactorEnum); _assert_(scalefactor_input); 4811 4811 } 4812 4812 ::GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); … … 5298 5298 5299 5299 /*Compute ice thickness change: */ 5300 Input2* deltathickness_input=this->GetInput2(EsaDeltathicknessEnum); 5300 Input2* deltathickness_input=this->GetInput2(EsaDeltathicknessEnum); 5301 5301 if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!"); 5302 5302 deltathickness_input->GetInputAverage(&I); … … 5436 5436 5437 5437 /*Compute ice thickness change: */ 5438 Input2* deltathickness_input=this->GetInput2(EsaDeltathicknessEnum); 5438 Input2* deltathickness_input=this->GetInput2(EsaDeltathicknessEnum); 5439 5439 if (!deltathickness_input)_error_("delta thickness input needed to compute elastic adjustment!"); 5440 5440 deltathickness_input->GetInputAverage(&I); … … 5670 5670 5671 5671 /*Compute ice thickness change: */ 5672 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 5672 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 5673 5673 if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!"); 5674 5674 deltathickness_input->GetInputAverage(&I); … … 5806 5806 5807 5807 /*Compute ice thickness change: */ 5808 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 5808 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 5809 5809 if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!"); 5810 5810 … … 6149 6149 6150 6150 /*Compute ice thickness change: */ 6151 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 6151 Input2* deltathickness_input=this->GetInput2(SealevelriseDeltathicknessEnum); 6152 6152 if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!"); 6153 6153 deltathickness_input->GetInputAverage(&I);
Note:
See TracChangeset
for help on using the changeset viewer.