Changeset 25488
- Timestamp:
- 08/27/20 06:03:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/classes/Elements/Penta.cpp ¶
r25445 r25488 3414 3414 tria->inputs=this->inputs; 3415 3415 tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED) 3416 this->SpawnTriaHook(xDynamicCast<ElementHook*>(tria),index1,index2,index3);3417 3416 3418 3417 if(index1==0 && index2==1 && index3==2){ 3419 3418 tria->iscollapsed = 1; 3419 if(this->nodes)tria->nodes=this->nodes; 3420 if(this->vertices)tria->vertices=this->vertices; 3420 3421 } 3421 3422 else if(index1==3 && index2==4 && index3==5){ 3422 3423 tria->iscollapsed = 2; 3423 } 3424 3424 if(this->nodes)tria->nodes=&this->nodes[3]; 3425 if(this->vertices)tria->vertices=&this->vertices[3]; 3426 } 3427 else _error_("Spawn supported only for surface and basal elements"); 3425 3428 /*Spawn material*/ 3426 3429 tria->material=(Material*)this->material->copy2(tria); 3427 3428 /*recover nodes, material*/3429 tria->nodes=(Node**)tria->hnodes[analysis_counter]->deliverp();3430 tria->vertices=(Vertex**)tria->hvertices->deliverp();3431 3430 3432 3431 /*Return new Tria*/ … … 4650 4649 int interp; 4651 4650 int type; 4652 4651 4653 4652 /*Branch according to whether we have a transient or not input: */ 4654 4653 type=this->inputs->GetInputObjectEnum(name); … … 4658 4657 PentaInput* pentainput2 = this->inputs->GetPentaInput(DummyEnum); 4659 4658 interp=pentainput->GetInterpolation(); 4660 4659 4661 4660 if (interp==P0Enum){ 4662 4661 /*Update the value if this element belongs to the partition: */ … … 4698 4697 4699 4698 /*double check:*/ 4700 if (nsteps!=nt && nt!=1) _error_("Penta:InputScaleFromDakota error message: transient input " << EnumToStringx(name) << 4699 if (nsteps!=nt && nt!=1) _error_("Penta:InputScaleFromDakota error message: transient input " << EnumToStringx(name) << 4701 4700 " should have the same number of time steps as the number of time values distributed by Dakota: " << nt << "\n"); 4702 4701 … … 4717 4716 /*scale P0 value for this element, corresponding to the partition:*/ 4718 4717 IssmDouble value = pentainput->element_values[0]; 4719 if(nt==1) value*=distributed_values[(int)partition[this->Sid()]]; //we scale all the time steps with the same distributed_value 4718 if(nt==1) value*=distributed_values[(int)partition[this->Sid()]]; //we scale all the time steps with the same distributed_value 4720 4719 else value*=distributed_values[(int)partition[this->Sid()]*nsteps+i]; //we scale all the time steps with distributed value for each step 4721 4720 … … 4729 4728 values[j]=pentainput->element_values[j]; 4730 4729 if(partition[this->vertices[i]->Sid()]!=-1){ 4731 if(nt==1) values[j]*=distributed_values[(int)partition[this->vertices[j]->Sid()]];//we scale all the time steps with the same distributed_value 4730 if(nt==1) values[j]*=distributed_values[(int)partition[this->vertices[j]->Sid()]];//we scale all the time steps with the same distributed_value 4732 4731 else values[j]*=distributed_values[(int)partition[this->vertices[j]->Sid()]*nsteps+i];//we scale all the time steps with distributed value for each step 4733 4732 }
Note:
See TracChangeset
for help on using the changeset viewer.