Changeset 4508


Ignore:
Timestamp:
07/09/10 14:26:31 (15 years ago)
Author:
seroussi
Message:

fixed patch and InputToResult when no elements in a patch

Location:
issm/trunk/src/c
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/InputToResultx/InputToResultx.cpp

    r4218 r4508  
    1919
    2020        /*Go through elemnets, and ask each element to transfer the enum_type input into the results dataset, with step and time information: */
    21          
    2221        for(i=0;i<elements->Size();i++){
    2322
  • issm/trunk/src/c/modules/OutputResultsx/ElementResultsToPatch.cpp

    r4334 r4508  
    8383        #endif
    8484
    85         /*Check that results have been found*/
    86         if (numrows*numvertices==0) ISSMERROR("No results found in elements");
    87 
    8885        /*Ok, initialize Patch object: */
    8986        patch=new Patch(numrows,numvertices,numnodes);
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4506 r4508  
    12081208                input=(Input*)this->inputs->GetObjectByOffset(i);
    12091209                if (input->EnumType()==enum_type){
    1210                         found=true;
    1211                         break;
     1210                        found=true; break;
    12121211                }
    12131212        }
     1213        if (!found) ISSMERROR("Input %s not found in penta->inputs",EnumAsString(enum_type));
    12141214
    12151215        /*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4494 r4508  
    15071507                }
    15081508        }
     1509        if (!found) ISSMERROR("Input %s not found in tria->inputs",EnumAsString(enum_type));
    15091510
    15101511        /*If we don't find it, no big deal, just don't do the transfer. Otherwise, build a new Result
  • issm/trunk/src/c/objects/Patch.cpp

    r4316 r4508  
    4646                +maxnodes;   //nodes
    4747
    48         //allocate and fill with NaN:
    49         this->values=(double*)xmalloc(this->numcols*this->numrows*sizeof(double));
    50         for(i=0;i<this->numrows;i++){
    51                 for(j=0;j<this->numcols;j++){
    52                         this->values[i*this->numcols+j]=NAN;
     48        //Allocate values and fill with NaN:
     49        if (this->numcols*this->numrows==0){
     50                this->values=NULL;
     51        }
     52        else{
     53                this->values=(double*)xmalloc(this->numcols*this->numrows*sizeof(double));
     54                for(i=0;i<this->numrows;i++){
     55                        for(j=0;j<this->numcols;j++){
     56                                this->values[i*this->numcols+j]=NAN;
     57                        }
    5358                }
    5459        }
  • issm/trunk/src/c/solutions/steadystate_core.cpp

    r4331 r4508  
    4747                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum);
    4848                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum);
    49                 if(dim==3)InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);
     49                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);
    5050                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum);
    5151                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum);
     
    6161                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum);
    6262                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum);
     63                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum);
     64                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VelEnum);
    6365                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum);
    64                 if(dim==3) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum);
    6566                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum);
     67                InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MeltingRateEnum);
    6668        }
    6769}
Note: See TracChangeset for help on using the changeset viewer.