Ignore:
Timestamp:
08/19/11 18:04:03 (14 years ago)
Author:
Eric.Larour
Message:

Major rewrite of the code so that IoModel now has a parameters dataset, which gets
loaded with all the int,char and double objects in the input file.
This is a lot more flexible, as anyone can add a field to the model, and it will
automatically appear in the IoModel parameters dataset.

Not debugged with respect to nightly runs yet. Trying to get the whole change finished.

Location:
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp

    r9340 r9356  
    1616        int i;
    1717        int count;
     18        int    dim;
     19        int    numberofvertices;
     20        double heatcapacity;
     21        double referencetemperature;
    1822       
    1923        /*Output*/
    2024        Constraints* constraints = NULL;
    2125        SpcStatic*    spcstatic  = NULL;
     26
     27        /*Fetch parameters: */
     28        iomodel->parameters->FindParam(&dim,DimEnum);
     29        iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
     30        iomodel->parameters->FindParam(&heatcapacity,HeatcapacityEnum);
     31        iomodel->parameters->FindParam(&referencetemperature,ReferencetemperatureEnum);
    2232
    2333        /*Recover pointer: */
     
    2838
    2939        /*return if 2d mesh*/
    30         if (iomodel->dim==2) goto cleanup_and_return;
     40        if (dim==2) goto cleanup_and_return;
    3141
    3242        /*Fetch data: */
     
    3747
    3848        /*Create constraints from x,y,z: */
    39         for (i=0;i<iomodel->numberofvertices;i++){
     49        for (i=0;i<numberofvertices;i++){
    4050                /*keep only this partition's nodes:*/
    4151                if((iomodel->my_vertices[i])){
     
    4353                        if ((int)iomodel->spctemperature[2*i]){
    4454
    45                                 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->heatcapacity*(iomodel->spctemperature[2*i+1]-iomodel->referencetemperature),EnthalpyAnalysisEnum));
     55                                constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,heatcapacity*(iomodel->spctemperature[2*i+1]-referencetemperature),EnthalpyAnalysisEnum));
    4656                                count++;
    4757
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateNodesEnthalpy.cpp

    r9340 r9356  
    1818        int i;
    1919        bool continuous_galerkin=true;
     20        int    numberofvertices;
    2021
    2122        /*DataSets: */
    2223        Nodes*    nodes = NULL;
     24
     25        /*Fetch parameters: */
     26        iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2327       
    2428        /*Recover pointer: */
     
    3943        iomodel->FetchData(&iomodel->nodeonwater,NULL,NULL,NodeOnWaterEnum);
    4044
    41         for (i=0;i<iomodel->numberofvertices;i++){
     45        for (i=0;i<numberofvertices;i++){
    4246
    4347                if(iomodel->my_vertices[i]){
  • issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp

    r9343 r9356  
    1616void    UpdateElementsEnthalpy(Elements* elements, IoModel* iomodel,int analysis_counter,int analysis_type){
    1717
     18        int    dim;
     19        int    numberofelements;
     20
     21        /*Fetch parameters: */
     22        iomodel->parameters->FindParam(&dim,DimEnum);
     23        iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     24
    1825        /*Now, is the model 3d? otherwise, do nothing: */
    19         if (iomodel->dim==2)return;
     26        if (dim==2)return;
    2027
    2128        /*Fetch data needed: */
     
    2431        /*Update elements: */
    2532        int counter=0;
    26         for(int i=0;i<iomodel->numberofelements;i++){
     33        for(int i=0;i<numberofelements;i++){
    2734                if(iomodel->my_elements[i]){
    2835                        Element* element=(Element*)elements->GetObjectByOffset(counter);
Note: See TracChangeset for help on using the changeset viewer.