Changeset 25488


Ignore:
Timestamp:
08/27/20 06:03:59 (5 years ago)
Author:
bdef
Message:

CHG:avoiding to spawn hook when we spawn tria

File:
1 edited

Legend:

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

    r25445 r25488  
    34143414        tria->inputs=this->inputs;
    34153415        tria->element_type=P1Enum; //Only P1 CG for now (TO BE CHANGED)
    3416         this->SpawnTriaHook(xDynamicCast<ElementHook*>(tria),index1,index2,index3);
    34173416
    34183417        if(index1==0 && index2==1 && index3==2){
    34193418                tria->iscollapsed = 1;
     3419                if(this->nodes)tria->nodes=this->nodes;
     3420                if(this->vertices)tria->vertices=this->vertices;
    34203421        }
    34213422        else if(index1==3 && index2==4 && index3==5){
    34223423                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");
    34253428        /*Spawn material*/
    34263429        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();
    34313430
    34323431        /*Return new Tria*/
     
    46504649        int interp;
    46514650        int type;
    4652        
     4651
    46534652        /*Branch according to whether we have a transient or not input: */
    46544653        type=this->inputs->GetInputObjectEnum(name);
     
    46584657                PentaInput* pentainput2 = this->inputs->GetPentaInput(DummyEnum);
    46594658                interp=pentainput->GetInterpolation();
    4660                
     4659
    46614660                if (interp==P0Enum){
    46624661                        /*Update the value if this element belongs to the partition: */
     
    46984697
    46994698                /*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) <<
    47014700                                " should have the same number of time steps as the number of time values distributed by Dakota: " << nt << "\n");
    47024701
     
    47174716                                        /*scale P0 value  for this element, corresponding to the partition:*/
    47184717                                        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
    47204719                                        else value*=distributed_values[(int)partition[this->Sid()]*nsteps+i]; //we scale all the time steps with distributed value for each step
    47214720
     
    47294728                                        values[j]=pentainput->element_values[j];
    47304729                                        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
    47324731                                                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
    47334732                                        }
Note: See TracChangeset for help on using the changeset viewer.