Changeset 3399


Ignore:
Timestamp:
04/05/10 14:44:05 (15 years ago)
Author:
Mathieu Morlighem
Message:

minor bug fix for now

Location:
issm/trunk/src/c/objects
Files:
2 edited

Legend:

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

    r3396 r3399  
    311311        /*go pickup the correct objects, ids and offsets :*/
    312312        subnum=numindices;
     313        if(subnum<1) ISSMERROR("Trying to spawn an empty ElementProperties!");
    313314
    314315        subobjects=(Object**)xmalloc(subnum*sizeof(Object*));
     
    316317        suboffsets=(int*)xmalloc(subnum*sizeof(int));
    317318
    318         if(subnum){
    319                 for(i=0;i<subnum;i++){
    320                         subobjects[i]=this->objects[indices[i]];
    321                         subids[i]=this->ids[indices[i]];
    322                         suboffsets[i]=this->offsets[indices[i]];
    323                 }
    324         }
    325         else ISSMERROR("Trying to spawn an empty ElementProperties!");
     319        for(i=0;i<subnum;i++){
     320                subobjects[i]=this->objects[indices[i]];
     321                subids[i]=this->ids[indices[i]];
     322                suboffsets[i]=this->offsets[indices[i]];
     323        }
    326324
    327325        return new Hook(subobjects,subids,suboffsets,subnum);
  • issm/trunk/src/c/objects/Tria.cpp

    r3389 r3399  
    233233        //if (id==1) printf("WARNING if QMU: no hydrostatic equilibrium is applied here (conflict with prognostic, which does not have matpar)\n");
    234234        //For now
    235         inputs->Recover("thickness",&this->properties.h[0],1,dofs,3,(void**)nodes);
     235        if(this->properties.h) inputs->Recover("thickness",&this->properties.h[0],1,dofs,3,(void**)nodes);
    236236        //Later
    237237        /*
     
    249249        }
    250250        */
    251         inputs->Recover("surface",&this->properties.s[0],1,dofs,3,(void**)nodes);
    252         inputs->Recover("bed",&this->properties.b[0],1,dofs,3,(void**)nodes);
    253         inputs->Recover("drag",&this->properties.k[0],1,dofs,3,(void**)nodes);
    254         inputs->Recover("melting",&this->properties.melting[0],1,dofs,3,(void**)nodes);
    255         inputs->Recover("accumulation",&this->properties.accumulation[0],1,dofs,3,(void**)nodes);
    256         inputs->Recover("geothermalflux",&this->properties.geothermalflux[0],1,dofs,3,(void**)nodes);
     251        if (this->properties.s)              inputs->Recover("surface",&this->properties.s[0],1,dofs,3,(void**)nodes);
     252        if (this->properties.b)              inputs->Recover("bed",&this->properties.b[0],1,dofs,3,(void**)nodes);
     253        if (this->properties.k)              inputs->Recover("drag",&this->properties.k[0],1,dofs,3,(void**)nodes);
     254        if (this->properties.melting)        inputs->Recover("melting",&this->properties.melting[0],1,dofs,3,(void**)nodes);
     255        if (this->properties.accumulation)   inputs->Recover("accumulation",&this->properties.accumulation[0],1,dofs,3,(void**)nodes);
     256        if (this->properties.geothermalflux) inputs->Recover("geothermalflux",&this->properties.geothermalflux[0],1,dofs,3,(void**)nodes);
    257257       
    258258        //Update material if necessary
Note: See TracChangeset for help on using the changeset viewer.