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.

File:
1 edited

Legend:

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

    r9340 r9356  
    1717        /*Intermediary*/
    1818        int i,j,k,n;
     19        int    dim;
     20        int    numberofelements;
     21        int    numberofvertices;
    1922
    2023        /*DataSets: */
     
    2225        Vertices*     vertices = NULL;
    2326        Materials*    materials = NULL;
     27
     28        /*Fetch parameters: */
     29        iomodel->parameters->FindParam(&dim,DimEnum);
     30        iomodel->parameters->FindParam(&numberofelements,NumberOfElementsEnum);
     31        iomodel->parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    2432
    2533        /*Did we already create the elements? : */
     
    4654       
    4755        /*Create elements and materials: */
    48         for (i=0;i<iomodel->numberofelements;i++){
     56        for (i=0;i<numberofelements;i++){
    4957
    5058                if(iomodel->my_elements[i]){
    5159
    5260                        /*Create and add tria element to elements dataset: */
    53                         if(iomodel->dim==2)
     61                        if(dim==2)
    5462                         elements->AddObject(new Tria(i+1,i,i,iomodel,nummodels));
    5563                        else
     
    7381
    7482        /*Add new constrant material property tgo materials, at the end: */
    75         materials->AddObject(new Matpar(iomodel->numberofelements+1,iomodel));//put it at the end of the materials
     83        materials->AddObject(new Matpar(numberofelements+1,iomodel));//put it at the end of the materials
    7684       
    7785        /*Create vertices: */
     
    8290        iomodel->FetchData(&iomodel->thickness,NULL,NULL,ThicknessEnum);
    8391       
    84         for (i=0;i<iomodel->numberofvertices;i++){
     92        for (i=0;i<numberofvertices;i++){
    8593
    8694                /*vertices and nodes (same number, as we are running continuous galerkin formulation: */
Note: See TracChangeset for help on using the changeset viewer.