Changeset 4343


Ignore:
Timestamp:
06/30/10 11:39:55 (15 years ago)
Author:
Mathieu Morlighem
Message:

fixed InputExtrude

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4328 r4343  
    42324232        Input* original_input=NULL;
    42334233
    4234         /*Extrude the original input: */
    4235         original_input=(Input*)this->inputs->GetInput(enum_type);
    4236         original_input->Extrude();
    4237 
    42384234        /*recover parameters: */
    42394235        inputs->GetParameterValue(&onbed,ElementOnBedEnum);
     
    42434239        if(onbed==1 & onsurface==0){
    42444240
    4245                 /*this element is on the bed. We are going to, follow the upper element until we reach the surface. At each upper element,
    4246                  * we'll add the input of the lower element*/
    4247 
    4248                 penta=this;
     4241                /*OK, we are on bed. we will follow the steps:
     4242                 * 1: find input and extrude it.
     4243                 * 2: follow the upper element until we reach the surface
     4244                 * 3: for each element, we will add a copy of the extruded input*/
     4245
     4246                /*Step1: Extrude the original input: */
    42494247                original_input=(Input*)this->inputs->GetInput(enum_type);
    42504248                if(!original_input) ISSMERROR("%s%s"," could not find input with enum:",EnumAsString(enum_type));
    4251 
     4249                original_input->Extrude();
     4250
     4251                /*Step 2: this input has been extruded for this element, now follow the upper element*/
     4252                penta=this;
    42524253                for(;;){
    42534254
    42544255                        /* get upper Penta*/
    42554256                        penta=penta->GetUpperElement();
    4256 
    4257                         /*Add input of the basal element*/
     4257                        ISSMASSERT(penta->Id()!=this->id);
     4258
     4259                        /*Add input of the basal element to penta->inputs*/
    42584260                        Input* copy=NULL;
    42594261                        copy=(Input*)original_input->copy();
    4260                         inputs->AddObject((Input*)copy);
    4261 
     4262                        penta->inputs->AddInput((Input*)copy);
    42624263
    42634264                        /*Stop if we have reached the surface*/
    42644265                        if (penta->IsOnSurface()) break;
    4265                         ISSMASSERT(penta->Id()!=this->id);
    42664266
    42674267                }
Note: See TracChangeset for help on using the changeset viewer.