Changeset 4021


Ignore:
Timestamp:
06/03/10 15:20:44 (15 years ago)
Author:
Eric.Larour
Message:

Some debuggin for compilation purposes

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

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r4004 r4021  
    550550/*Objects methods*/
    551551/*FUNCTION DataSet::Configure{{{1*/
    552 void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters,analysis_counter,analysis_type){
     552void DataSet::Configure(DataSet* elements,DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters,int analysis_counter,int analysis_type){
    553553
    554554        vector<Object*>::iterator object;
     
    562562
    563563                        element=(Element*)(*object);
    564                         element->Configure(elements,loads,nodes,materials,parameters);
     564                        element->Configure(elements,loads,nodes,materials,parameters,analysis_counter);
    565565                }
    566566                if(EnumIsLoad((*object)->Enum())){
     
    924924
    925925                        rgb=(Rgb*)(*object);
    926                         if(rgb->InAnalysis(analysis_type))count++
     926                        if(rgb->InAnalysis(analysis_type))count++;
    927927                }
    928928        }
  • issm/trunk/src/c/DataSet/DataSet.h

    r4004 r4021  
    5858                void  FlagClones(int numberofnodes);
    5959                int   NumberOfDofs(int analysis_type);
    60                 int   NumberOfRgbs();
     60                int   NumberOfRgbs(int analysis_type);
    6161                void  SetupSpcs(DataSet* nodes,Vec yg,int analysis_type);
    6262                void  SetupMpcs(Mat Rmg,DataSet* nodes,int analysis_type);
  • issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.cpp

    r4004 r4021  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters,int analysis_type){
     12int     ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters,int analysis_counter,int analysis_type){
    1313
    1414        /*Intermediary*/
  • issm/trunk/src/c/modules/ConfigureObjectsx/ConfigureObjectsx.h

    r4009 r4021  
    99
    1010/* local prototypes: */
    11 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, Parameters* parameters,int analysis_type);
     11int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, Parameters* parameters,int analysis_counter, int analysis_type);
    1212
    1313#endif  /* _CONFIGUREOBJECTSX_H */
  • issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp

    r3913 r4021  
    1010
    1111int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofgrids,double* elements,
    12                 int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, char* meshtype,int num_procs){
     12                int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, int dim,int num_procs){
    1313
    1414        int noerr=1;
     
    3030        int  edgecut=1;
    3131
    32         if(strcmp(meshtype,"2d")==0){
     32        if(dim==2){
    3333                epart=(int*)xmalloc(numberofelements*sizeof(int));
    3434                npart=(int*)xmalloc(numberofgrids*sizeof(int));
  • issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.h

    r3067 r4021  
    88/* local prototypes: */
    99int MeshPartitionx(int** pepart, int** pnpart, int numberofelements,int numberofgrids,double* elements,
    10                 int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, char* meshtype,int numareas);
     10                int numberofelements2d,int numberofgrids2d,double* elements2d,int numlayers,int elements_width, int dim,int numareas);
    1111       
    1212#endif /* _MESHPARTITIONX_H */
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r4013 r4021  
    1313#include "../../io/io.h"
    1414#include "../../objects/objects.h"
    15 
    16 void OutputResults(DataSet* results,char* filename){
    17 
    18         int i;
    19         Result* result=NULL;
    20         FILE* fid=NULL;
    21         extern int my_rank;
    22 
    23         /* Open output file to write raw binary data: */
    24         if(my_rank==0){
    25                 fid=pfopen(filename,"wb");
    26 
    27                 for(i=0;i<results->Size();i++){
    28                         result=(Result*)results->GetObjectByOffset(i);
    29 
    30                         /*write result to disk: */
    31                         result->WriteData(fid);
    32                 }
    3315               
    34                 /*Close file: */
    35                 pfclose(fid,filename);
    36         }
     16void OutputResults(FemModel* femmodel, char* filename,int analysis_type){
    3717
    3818
    39         /*output if we have rifts: */
    40         if(numrifts){
    41                 OutputRiftsx( &riftproperties,fem_dh->loads,numrifts);
    42                 results->AddObject(new Result(results->Size()+1,0,1,"riftproperties",riftproperties));
    43         }
    44 
     19        ISSMERROR(" not supported yet!");
     20       
     21       
     22//     
     23//     
     24//      int i;
     25//      Result* result=NULL;
     26//      FILE* fid=NULL;
     27//      extern int my_rank;
     28//
     29//      /* Open output file to write raw binary data: */
     30//      if(my_rank==0){
     31//              fid=pfopen(filename,"wb");
     32//
     33//              for(i=0;i<results->Size();i++){
     34//                      result=(Result*)results->GetObjectByOffset(i);
     35//
     36//                      /*write result to disk: */
     37//                      result->WriteData(fid);
     38//              }
     39//             
     40//              /*Close file: */
     41//              pfclose(fid,filename);
     42//      }
     43//
     44//
     45//      /*output if we have rifts: */
     46//      if(numrifts){
     47//              OutputRiftsx( &riftproperties,fem_dh->loads,numrifts);
     48//              results->AddObject(new Result(results->Size()+1,0,1,"riftproperties",riftproperties));
     49//      }
     50//
    4551
    4652}
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h

    r3938 r4021  
    99
    1010/* local prototypes: */
    11 void OutputResults(DataSet* results,char* filename);
     11void OutputResults(FemModel* femmodel, char* filename,int analysis_type);
    1212
    1313#endif  /* _OUTPUTRESULTS_H */
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r4013 r4021  
    3333
    3434/*Object management*/
    35 /*FUNCTION Beam::Configure{{{1*/
    36 void  Beam::Configure(DataSet* elementsin,DataSet* loadsin, DataSet* nodesin, DataSet* materialsin, Parameters* parametersin,int analysis_counter){
    37 
    38         int i;
    39        
    40         /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
    41          * datasets, using internal ids and offsets hidden in hooks: */
    42         hnodes.configure(nodesin);
    43         hmatice.configure(materialsin);
    44         hmatpar.configure(materialsin);
    45 
    46         /*point parameters to real dataset: */
    47         this->parameters=parametersin;
    48 
    49 }
    50 /*}}}*/
    5135/*FUNCTION Beam::copy{{{1*/
    5236Object* Beam::copy() {
    53        
    54         return new Beam(this->id,&this->hnodes,&this->hmatice,&this->hmatpar,this->parameters,this->inputs);
    55 
     37
     38        int i;
     39        Beam* beam=NULL;
     40
     41        beam=new Beam();
     42
     43        /*copy fields: */
     44        beam->id=this->id;
     45        if(this->inputs){
     46                beam->inputs=(Inputs*)this->inputs->Copy();
     47        }
     48        else{
     49                beam->inputs=new Inputs();
     50        }
     51        /*point parameters: */
     52        beam->parameters=this->parameters;
     53
     54        /*pointers: */
     55        beam->nodes=(Node**)xmalloc(2*sizeof(Node*));
     56        for(i=0;i<2;i++)beam->nodes[i]=this->nodes[i];
     57        beam->matice=this->matice;
     58        beam->matpar=this->matpar;
     59
     60        return beam;
    5661}
    5762/*}}}*/
     
    5964void Beam::DeepEcho(void){
    6065
     66        int i;
     67
    6168        printf("Beam:\n");
    6269        printf("   id: %i\n",id);
    63         hnodes.DeepEcho();
    64         hmatice.DeepEcho();
    65         hmatpar.DeepEcho();
     70        for(i=0;i<2;i++){
     71                nodes[i]->DeepEcho();
     72        }
     73        matice->DeepEcho();
     74        matpar->DeepEcho();
    6675        printf("   parameters\n");
    6776        parameters->DeepEcho();
     
    7483/*FUNCTION Beam::Demarshall{{{1*/
    7584void  Beam::Demarshall(char** pmarshalled_dataset){
    76 
    77         char* marshalled_dataset=NULL;
    78         int   i;
    79 
    80         /*recover marshalled_dataset: */
    81         marshalled_dataset=*pmarshalled_dataset;
    82 
    83         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    84          *object data (thanks to DataSet::Demarshall):*/
    85         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    86 
    87         /*demarshall hooks: */
    88         hnodes.Demarshall(&marshalled_dataset);
    89         hmatice.Demarshall(&marshalled_dataset);
    90         hmatpar.Demarshall(&marshalled_dataset);
    91 
    92         /*demarshall inputs: */
    93         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    94 
    95         /*parameters: may not exist even yet, so let Configure handle it: */
    96         this->parameters=NULL;
    97 
    98         /*return: */
    99         *pmarshalled_dataset=marshalled_dataset;
    100         return;
     85        ISSMERROR("not supported yet!");
    10186}
    10287/*}}}*/
     
    10489void Beam::Echo(void){
    10590
     91        int i;
     92
    10693        printf("Beam:\n");
    10794        printf("   id: %i\n",id);
    108         hnodes.Echo();
    109         hmatice.Echo();
    110         hmatpar.Echo();
     95        for(i=0;i<2;i++){
     96                nodes[i]->DeepEcho();
     97        }
     98        matice->DeepEcho();
     99        matpar->DeepEcho();
    111100        printf("   parameters\n");
    112101        parameters->Echo();
     
    128117/*FUNCTION Beam::Marshall{{{1*/
    129118void  Beam::Marshall(char** pmarshalled_dataset){
    130 
    131         char* marshalled_dataset=NULL;
    132         int   enum_type=0;
    133         char* marshalled_inputs=NULL;
    134         int   marshalled_inputs_size;
    135 
    136         /*recover marshalled_dataset: */
    137         marshalled_dataset=*pmarshalled_dataset;
    138 
    139         /*get enum type of Beam: */
    140         enum_type=BeamEnum;
    141        
    142         /*marshall enum: */
    143         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    144        
    145         /*marshall Beam data: */
    146         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    147 
    148         /*Marshall hooks: */
    149         hnodes.Marshall(&marshalled_dataset);
    150         hmatice.Marshall(&marshalled_dataset);
    151         hmatpar.Marshall(&marshalled_dataset);
    152 
    153         /*Marshall inputs: */
    154         marshalled_inputs_size=inputs->MarshallSize();
    155         marshalled_inputs=inputs->Marshall();
    156         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    157         marshalled_dataset+=marshalled_inputs_size;
    158        
    159         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    160 
    161         xfree((void**)&marshalled_inputs);
    162 
    163         *pmarshalled_dataset=marshalled_dataset;
    164         return;
     119        ISSMERROR("not supported yet!");
    165120}
    166121/*}}}*/
    167122/*FUNCTION Beam::MarshallSize{{{1*/
    168123int   Beam::MarshallSize(){
    169        
    170         return sizeof(id)
    171                 +hnodes.MarshallSize()
    172                 +hmatice.MarshallSize()
    173                 +hmatpar.MarshallSize()
    174                 +inputs->MarshallSize()
    175                 +sizeof(int); //sizeof(int) for enum type
     124        ISSMERROR("not supported yet!");
    176125}
    177126/*}}}*/
     
    207156        double gauss[numgrids][numgrids]={{1,0},{0,1}};
    208157
    209         /*dynamic objects pointed to by hooks: */
    210         Node**  nodes=NULL;
    211         Matpar* matpar=NULL;
    212         Matice* matice=NULL;
    213        
    214158        /*Get dof list on which we will plug the pressure values: */
    215159        GetDofList1(&doflist[0]);
    216 
    217         /*recover objects from hooks: */
    218         nodes=(Node**)hnodes.deliverp();
    219         matpar=(Matpar*)hmatpar.delivers();
    220         matice=(Matice*)hmatice.delivers();
    221160
    222161        /*Get node data: */
     
    288227        double one0,one1;
    289228       
    290         /*dynamic objects pointed to by hooks: */
    291         Node**  nodes=NULL;
    292 
    293         /*recover objects from hooks: */
    294         nodes=(Node**)hnodes.deliverp();
    295 
    296229        connectivity[0]=nodes[0]->GetConnectivity();
    297230        connectivity[1]=nodes[1]->GetConnectivity();
     
    387320        bool onsurface;
    388321        int  connectivity[2];
    389 
    390         /*dynamic objects pointed to by hooks: */
    391         Node**  nodes=NULL;
    392         Matpar* matpar=NULL;
    393         Matice* matice=NULL;
    394 
    395         /*recover objects from hooks: */
    396         nodes=(Node**)hnodes.deliverp();
    397         matpar=(Matpar*)hmatpar.delivers();
    398         matice=(Matice*)hmatice.delivers();
    399322
    400323        /*recover doflist: */
     
    510433        int numberofdofspernode;
    511434       
    512         /*dynamic objects pointed to by hooks: */
    513         Node**  nodes=NULL;
    514 
    515         /*recover objects from hooks: */
    516         nodes=(Node**)hnodes.deliverp();
    517        
    518435        for(i=0;i<2;i++){
    519436                nodes[i]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
     
    531448void  Beam::GetDofList1(int* doflist){
    532449
    533         /*dynamic objects pointed to by hooks: */
    534         Node**  nodes=NULL;
    535 
    536         /*recover objects from hooks: */
    537         nodes=(Node**)hnodes.deliverp();
    538        
    539450        int i;
    540451        for(i=0;i<2;i++){
     
    564475/*FUNCTION Beam::GetMatPar{{{1*/
    565476void* Beam::GetMatPar(){
    566 
    567         /*dynamic objects pointed to by hooks: */
    568         Matpar* matpar=NULL;
    569 
    570         /*recover objects from hooks: */
    571         matpar=(Matpar*)hmatpar.delivers();
    572477
    573478        return matpar;
     
    591496        Node** pnodes=NULL;
    592497
    593         /*dynamic objects pointed to by hooks: */
    594         Node**  nodes=NULL;
    595        
    596498        /*recover nodes: */
    597499        pnodes=(Node**)vpnodes;
    598500
    599         /*recover objects from hooks: */
    600         nodes=(Node**)hnodes.deliverp();
    601        
    602501        for(i=0;i<3;i++){
    603502                pnodes[i]=nodes[i];
     
    677576        /*Check that name is an element input*/
    678577        if (!IsInput(name)) return;
    679         Node**  nodes=NULL;
    680 
    681578        switch(type){
    682579
     
    687584
    688585                        /*Get values on the 6 vertices*/
    689                         nodes=(Node**)hnodes.deliverp();
    690586                        for (int i=0;i<2;i++){
    691587                                values[i]=vector[nodes[i]->GetVertexDof()];
     
    780676        bool     found      = false;
    781677        int      count      = 0;
    782         Node   **nodes      = NULL;
    783678        double  *this_patch = NULL;
    784679
     
    801696                count=*pcount;
    802697
    803                 /*Recover nodes: */
    804                 nodes=(Node**)hnodes.deliverp();
    805 
    806698                /*set this_patch to point at the beginning of the patches row, where we will plug our information :*/
    807699                this_patch=patches+numcols*count;
  • issm/trunk/src/c/objects/Elements/Beam.h

    r4011 r4021  
    1414class Inputs;
    1515class IoModel;
     16class Node;
     17class Matice;
     18class Matpar;
    1619
    1720#include "../../shared/Exceptions/exceptions.h"
     
    2629                int id;
    2730
    28                 Hook hnodes;  //hook to 2 nodes
    29                 Hook hmatice; //hook to 1 matice
    30                 Hook hmatpar; //hook to 1 matpar
     31                Node**  nodes; //2 nodes
     32                Matice* matice;
     33                Matpar* matpar;
    3134               
    3235                Parameters* parameters; //pointer to solution parameters
     
    3942                /*}}}*/
    4043                /*object management: {{{1*/
     44                void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters,int analysis_counter);
    4145                void  Echo();
    4246                void  DeepEcho();
     
    4852                bool  IsInput(int name);
    4953                int   MyRank();
    50                 void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters,int analysis_counter);
    5154                Object* copy();
    5255                void  SetClone(int* minranks);
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4015 r4021  
    7878
    7979        //collpase flags
    80         collapse=(bool*)xcalloc(nummodels*sizeof(bool));
    81 
    82 }
    83 /*}}}*/
    84 /*FUNCTION Penta::Update(IoModel* iomodel,int analysis_counter) {{{1*/
    85 Penta::Update(IoModel* iomodel,int analysis_counter){
     80        collapse=(bool*)xcalloc(nummodels,sizeof(bool));
     81
     82}
     83/*}}}*/
     84/*FUNCTION Penta::Update(IoModel* iomodel,int analysis_counter,int analysis_type) {{{1*/
     85void Penta::Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type){
    8686
    8787        /*Intermediaries*/
     
    107107
    108108        /*hooks: */
    109         this->SettHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
     109        this->SetHookNodes(penta_node_ids,analysis_counter); this->nodes=NULL; //set hook to nodes, for this analysis type
    110110
    111111        //intialize inputs, and add as many inputs per element as requested:
     
    227227Object* Penta::copy() {
    228228
     229        int i;
     230
    229231        Penta* penta=NULL;
    230232
     
    243245
    244246        /*now deal with hooks and objects: */
    245         penta->InitHookNodes(this->nummodels);
    246         for(i=0;i<this->nummodels;i++)penta->hnodes[i].copy(&this->hnodes[i]);
     247        penta->InitHookNodes(this->numanalyses);
     248        for(i=0;i<this->numanalyses;i++)penta->hnodes[i].copy(&this->hnodes[i]);
    247249        penta->hmatice.copy(&this->hmatice);
    248250        penta->hmatpar.copy(&this->hmatpar);
     
    294296
    295297        memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    296         memcpy(&nummodels,marshalled_dataset,sizeof(nummodels));marshalled_dataset+=sizeof(nummodels);
     298        memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    297299
    298300        /*allocate dynamic memory: */
    299         collapse=(bool*)xmalloc(nummodels*sizeof(bool));
    300         InitHookNodes(nummodels);
     301        collapse=(bool*)xmalloc(numanalyses*sizeof(bool));
     302        InitHookNodes(numanalyses);
    301303
    302304        /*demarshall hooks: */
    303         for(i=0;i<nummodels;i++)hnodes[i].Demarshall(&marshalled_dataset);
     305        for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
    304306        hmatice.Demarshall(&marshalled_dataset);
    305307        hmatpar.Demarshall(&marshalled_dataset);
     
    316318
    317319        /*demarshall internal parameters: */
    318         memcpy(collapse,marshalled_dataset,nummodels*sizeof(bool));marshalled_dataset+=nummodels*sizeof(bool);
     320        memcpy(collapse,marshalled_dataset,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
    319321
    320322        /*parameters: may not exist even yet, so let Configure handle it: */
     
    347349        inputs->DeepEcho();
    348350        printf("   collapse: \n   ");
    349         for(i=0;i<nummodels;i++)printf("%s|",value?"true":"false");
     351        for(i=0;i<numanalyses;i++)printf("%s|",collapse[i]?"true":"false");
    350352        return;
    351353}
     
    384386        /*marshall Penta data: */
    385387        memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    386         memcpy(marshalled_dataset,&nummodels,sizeof(nummodels));marshalled_dataset+=sizeof(nummodels);
     388        memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    387389
    388390        /*Marshall hooks: */
    389         for(i=0;i<nummodels;i++)hnodes[i].Marshall(&marshalled_dataset);
     391        for(i=0;i<numanalyses;i++)hnodes[i].Marshall(&marshalled_dataset);
    390392        hmatice.Marshall(&marshalled_dataset);
    391393        hmatpar.Marshall(&marshalled_dataset);
     
    399401
    400402        /*marshall internal parameters: */
    401         memcpy(marshalled_dataset,collapse,nummodels*sizeof(bool));marshalled_dataset+=nummodels*sizeof(bool);
     403        memcpy(marshalled_dataset,collapse,numanalyses*sizeof(bool));marshalled_dataset+=numanalyses*sizeof(bool);
    402404
    403405        /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
     
    415417        int hnodes_size=0;;
    416418
    417         for(i=0;i<nummodels;i++)hnodes_size+=hnodes[i].MarshallSize;
     419        for(i=0;i<numanalyses;i++)hnodes_size+=hnodes[i].MarshallSize();
    418420
    419421        return sizeof(id)
     
    423425                +hneighbors.MarshallSize()
    424426                +inputs->MarshallSize()
    425                 +nummodels*sizeof(bool)
     427                +numanalyses*sizeof(bool)
    426428                +sizeof(int); //sizeof(int) for enum type
    427429}
     
    429431/*FUNCTION Penta::SpawnTria {{{1*/
    430432void*  Penta::SpawnTria(int g0, int g1, int g2){
     433
     434        int i;
    431435
    432436        /*out of grids g0,g1 and g2 from Penta, build a tria element: */
     
    460464/*FUNCTION Penta::SpawnBeam {{{1*/
    461465void* Penta::SpawnBeam(int g0, int g1){
     466
     467        int i;
    462468
    463469        /*out of grids g0,g1 and g2 from Penta, build a beam element: */
     
    11731179                else ISSMERROR("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet");
    11741180        }
    1175         else if (analysis_type==SlopecomputeAnalysisEnum){
     1181        else if (analysis_type==SlopeComputeAnalysisEnum){
    11761182                CreateKMatrixSlopeCompute( Kgg,analysis_type,sub_analysis_type);
    11771183        }
     
    16671673
    16681674                /*build friction object, used later on: */
    1669                 friction=new Friction("2d",inputs,matpar);
     1675                friction=new Friction("2d",inputs,matpar,analysis_type);
    16701676
    16711677                for(i=0;i<numgrids2d;i++){
     
    22502256                else ISSMERROR("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet");
    22512257        }
    2252         else if (analysis_type==SlopecomputeAnalysisEnum){
     2258        else if (analysis_type==SlopeComputeAnalysisEnum){
    22532259                CreatePVectorSlopeCompute( pg,analysis_type,sub_analysis_type);
    22542260        }
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4015 r4021  
    4343                Penta();
    4444                Penta(int penta_id,int i, IoModel* iomodel,int nummodels);
     45                void Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type);
    4546                ~Penta();
    4647                /*}}}*/
    4748                /*FUNCTION object management {{{1*/
    4849                void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters,int analysis_counter);
    49                 void Update(IoModel* iomodel,int analysis_counter,int analysis_type);
    5050                Object* copy();
    5151                void  DeepEcho();
  • issm/trunk/src/c/objects/Elements/PentaHook.cpp

    r3984 r4021  
    2424PentaHook::PentaHook(){
    2525        numanalyses=UNDEF;
    26         this->hooks=NULL;
     26        this->hnodes=NULL;
    2727}
    2828/*}}}*/
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r4013 r4021  
    3636void  Sing::Configure(DataSet* elementsin,DataSet* loadsin, DataSet* nodesin, DataSet* materialsin, Parameters* parametersin,int analysis_counter){
    3737
    38         int i;
    39        
    40         /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
    41          * datasets, using internal ids and offsets hidden in hooks: */
    42         hnodes.configure(nodesin);
    43         hmatice.configure(materialsin);
    44         hmatpar.configure(materialsin);
    45 
    46         /*point parameters to real dataset: */
    47         this->parameters=parametersin;
     38        ISSMERROR(" not supported yet!");
    4839
    4940}
     
    5142/*FUNCTION Sing::copy {{{1*/
    5243Object* Sing::copy() {
    53        
    54         return new Sing(this->id,&this->hnodes,&this->hmatice,&this->hmatpar,this->parameters,this->inputs);
    55 
     44
     45        int i;
     46        Sing* sing=NULL;
     47
     48        sing=new Sing();
     49
     50        /*copy fields: */
     51        sing->id=this->id;
     52        if(this->inputs){
     53                sing->inputs=(Inputs*)this->inputs->Copy();
     54        }
     55        else{
     56                sing->inputs=new Inputs();
     57        }
     58        /*point parameters: */
     59        sing->parameters=this->parameters;
     60
     61        /*pointers: */
     62        sing->node=this->node;
     63        sing->matice=this->matice;
     64        sing->matpar=this->matpar;
     65
     66        return sing;
    5667}
    5768/*}}}*/
     
    6172        printf("Sing:\n");
    6273        printf("   id: %i\n",id);
    63         hnodes.DeepEcho();
    64         hmatice.DeepEcho();
    65         hmatpar.DeepEcho();
     74        node->DeepEcho();
     75        matice->DeepEcho();
     76        matpar->DeepEcho();
    6677        printf("   parameters\n");
    6778        parameters->DeepEcho();
     
    7485/*FUNCTION Sing::Demarshall {{{1*/
    7586void  Sing::Demarshall(char** pmarshalled_dataset){
    76 
    77         char* marshalled_dataset=NULL;
    78 
    79         /*recover marshalled_dataset: */
    80         marshalled_dataset=*pmarshalled_dataset;
    81 
    82         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    83          *object data (thanks to DataSet::Demarshall):*/
    84         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    85 
    86         /*demarshall hooks: */
    87         hnodes.Demarshall(&marshalled_dataset);
    88         hmatice.Demarshall(&marshalled_dataset);
    89         hmatpar.Demarshall(&marshalled_dataset);
    90 
    91         /*demarshall inputs: */
    92         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    93 
    94         /*parameters: may not exist even yet, so let Configure handle it: */
    95         this->parameters=NULL;
    96 
    97         /*return: */
    98         *pmarshalled_dataset=marshalled_dataset;
    99         return;
     87        ISSMERROR(" not supported yet!");
    10088}
    10189/*}}}*/
     
    10694        printf("Sing:\n");
    10795        printf("   id: %i\n",id);
    108         hnodes.Echo();
    109         hmatice.Echo();
    110         hmatpar.Echo();
     96        node->Echo();
     97        matice->Echo();
     98        matpar->Echo();
    11199        printf("   parameters\n");
    112100        parameters->Echo();
     
    126114/*FUNCTION Sing::Marshall {{{1*/
    127115void  Sing::Marshall(char** pmarshalled_dataset){
    128 
    129         char* marshalled_dataset=NULL;
    130         int   enum_type=0;
    131         char* marshalled_inputs=NULL;
    132         int   marshalled_inputs_size;
    133 
    134         /*recover marshalled_dataset: */
    135         marshalled_dataset=*pmarshalled_dataset;
    136 
    137         /*get enum type of Sing: */
    138         enum_type=SingEnum;
    139        
    140         /*marshall enum: */
    141         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    142        
    143         /*marshall Sing data: */
    144         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    145        
    146         /*Marshall hooks: */
    147         hnodes.Marshall(&marshalled_dataset);
    148         hmatice.Marshall(&marshalled_dataset);
    149         hmatpar.Marshall(&marshalled_dataset);
    150 
    151         /*Marshall inputs: */
    152         marshalled_inputs_size=inputs->MarshallSize();
    153         marshalled_inputs=inputs->Marshall();
    154         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    155         marshalled_dataset+=marshalled_inputs_size;
    156 
    157         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    158 
    159        
    160         xfree((void**)&marshalled_inputs);
    161 
    162         *pmarshalled_dataset=marshalled_dataset;
    163         return;
     116        ISSMERROR(" not supported yet!");
    164117}
    165118/*}}}*/
    166119/*FUNCTION Sing::MashallSize {{{1*/
    167120int   Sing::MarshallSize(){
    168 
    169         return sizeof(id)
    170                 +hnodes.MarshallSize()
    171                 +hmatice.MarshallSize()
    172                 +hmatpar.MarshallSize()
    173                 +inputs->MarshallSize()
    174                 +sizeof(int); //sizeof(int) for enum type
     121        ISSMERROR(" not supported yet!");
    175122}
    176123/*}}}*/
     
    202149        double rho_ice,g;
    203150
    204         /*dynamic objects pointed to by hooks: */
    205         Matpar* matpar=NULL;
    206         Matice* matice=NULL;
    207 
    208151        /*Get dof list on which we will plug the pressure values: */
    209152        GetDofList1(&dof);
    210 
    211         /*recover objects from hooks: */
    212         matpar=(Matpar*)hmatpar.delivers();
    213         matice=(Matice*)hmatice.delivers();
    214153
    215154        /*pressure is lithostatic: */
     
    263202        int    connectivity;
    264203
    265         /*dynamic objects pointed to by hooks: */
    266         Node**  node=NULL;
    267 
    268         /*recover objects from hooks: */
    269         node=(Node**)hnodes.deliverp();
    270 
    271204        /*Find connectivity of the node and divide Ke_gg by this connectivity*/
    272         connectivity=node[0]->GetConnectivity();
     205        connectivity=node->GetConnectivity();
    273206        Ke_gg[0][0]=1/(double)connectivity;
    274207        Ke_gg[1][1]=1/(double)connectivity;
     
    314247        int       connectivity;
    315248
    316         /*dynamic objects pointed to by hooks: */
    317         Node**  node=NULL;
    318         Matpar* matpar=NULL;
    319         Matice* matice=NULL;
    320 
    321         /*recover objects from hooks: */
    322         node=(Node**)hnodes.deliverp();
    323         matpar=(Matpar*)hmatpar.delivers();
    324         matice=(Matice*)hmatice.delivers();
    325 
    326249        inputs->GetParameterValue(&slope[0],SurfaceSlopeXEnum);
    327250        inputs->GetParameterValue(&slope[1],SurfaceSlopeYEnum);
     
    330253
    331254        //Get connectivity of the node
    332         connectivity=node[0]->GetConnectivity();
     255        connectivity=node->GetConnectivity();
    333256
    334257        //compute slope2
     
    379302        int numberofdofspernode;
    380303       
    381         /*dynamic objects pointed to by hooks: */
    382         Node**  nodes=NULL;
    383 
    384         /*recover objects from hooks: */
    385         nodes=(Node**)hnodes.deliverp();
    386        
    387         nodes[0]->GetDofList(&doflist_per_node[0],&numberofdofspernode);
     304        node->GetDofList(&doflist_per_node[0],&numberofdofspernode);
    388305        for(i=0;i<numberofdofspernode;i++){
    389306                doflist[i]=doflist_per_node[i];
     
    398315void  Sing::GetDofList1(int* doflist){
    399316
    400         /*dynamic objects pointed to by hooks: */
    401         Node**  nodes=NULL;
    402 
    403         /*recover objects from hooks: */
    404         nodes=(Node**)hnodes.deliverp();
    405        
    406317        int i;
    407         doflist[0]=nodes[0]->GetDofList1();
     318        doflist[0]=node->GetDofList1();
    408319
    409320}
     
    415326void* Sing::GetMatPar(){
    416327
    417         /*dynamic objects pointed to by hooks: */
    418         Matpar* matpar=NULL;
    419 
    420         /*recover objects from hooks: */
    421         matpar=(Matpar*)hmatpar.delivers();
    422 
    423328        return matpar;
    424329}
     
    429334        Node** pnodes=NULL;
    430335
    431         /*dynamic objects pointed to by hooks: */
    432         Node**  nodes=NULL;
    433        
    434336        /*recover nodes: */
    435337        pnodes=(Node**)vpnodes;
    436338
    437         /*recover objects from hooks: */
    438         nodes=(Node**)hnodes.deliverp();
    439        
    440         pnodes[0]=nodes[0];
     339        pnodes[0]=node;
    441340}
    442341/*}}}*/
     
    503402        /*Check that name is an element input*/
    504403        if (!IsInput(name)) return;
    505         Node*  node=NULL;
    506404
    507405        switch(type){
     
    513411
    514412                        /*Get values on the 6 vertices*/
    515                         node=(Node*)this->hnodes.delivers();
    516413                        value=vector[node->GetVertexDof()];
    517414
     
    602499        bool     found      = false;
    603500        int      count      = 0;
    604         Node   **nodes      = NULL;
    605501        double  *this_patch = NULL;
    606502
     
    623519                count=*pcount;
    624520
    625                 /*Recover nodes: */
    626                 nodes=(Node**)hnodes.deliverp();
    627 
    628521                /*set this_patch to point at the beginning of the patches row, where we will plug our information :*/
    629522                this_patch=patches+numcols*count;
     
    633526
    634527                /*Fill in vertices ids: */
    635                 for(i=0;i<1;i++) this_patch[2+i]=nodes[i]->GetVertexId(); //vertices id start at column 3 of the patch.
     528                for(i=0;i<1;i++) this_patch[2+i]=node->GetVertexId(); //vertices id start at column 3 of the patch.
    636529
    637530                /*We found the input, get it to fill the interpolation type, and the nodal values:*/
  • issm/trunk/src/c/objects/Elements/Sing.h

    r4011 r4021  
    1313class Inputs;
    1414class IoModel;
     15class Node;
     16class Matice;
     17class Matpar;
    1518
    1619#include "../../include/include.h"
     
    2629                int id;
    2730
    28                 Hook hnodes;  //hook to 1 nodes
    29                 Hook hmatice; //hook to 1 matice
    30                 Hook hmatpar; //hook to 1 matpar
     31                Node* node;
     32                Matice* matice;
     33                Matpar* matpar;
    3134               
    3235                Parameters* parameters; //pointer to solution parameters
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4015 r4021  
    2828        this->inputs=NULL;
    2929        this->parameters=NULL;
    30         this->collapse=NULL;
    3130}
    3231/*}}}*/
     
    3534        delete inputs;
    3635        this->parameters=NULL;
    37         xfree((void**)&collapse);
    3836}
    3937/*}}}*/
     
    5654
    5755        this->InitHookNodes(nummodels);this->nodes=NULL;
    58         this->InitHookNodes(tria_node_ids); this->nodes=NULL;
    5956        this->InitHookMatice(tria_matice_id);this->matice=NULL;
    6057        this->InitHookMatpar(tria_matpar_id);this->matpar=NULL;
     
    6663/*}}}*/
    6764/*FUNCTION Tria::Update(IoModel* iomodel,int analysis_counter,int analysis_type){{{1*/
    68 Tria::Update(IoModel* iomodel,int analysis_counter,int analysis_type){ //i is the element index
     65void Tria::Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type){ //i is the element index
    6966
    7067        /*Intermediaries*/
     
    8582
    8683        /*Recover nodes ids needed to initialize the node hook.*/
    87         if (iomodel->analysis_type==Prognostic2AnalysisEnum || iomodel->analysis_type==Balancedthickness2AnalysisEnum){
     84        if (analysis_type==Prognostic2AnalysisEnum || analysis_type==Balancedthickness2AnalysisEnum){
    8885                /*Discontinuous Galerkin*/
    8986                tria_node_ids[0]=iomodel->nodecounter+3*index+1;
     
    214211Object* Tria::copy() {
    215212
     213        int i;
    216214        Tria* tria=NULL;
    217215
     
    231229
    232230        /*now deal with hooks and objects: */
    233         tria->InitHookNodes(this->nummodels);
    234         for(i=0;i<this->nummodels;i++)tria->hnodes[i].copy(&this->hnodes[i]);
     231        tria->InitHookNodes(this->numanalyses);
     232        for(i=0;i<this->numanalyses;i++)tria->hnodes[i].copy(&this->hnodes[i]);
    235233        tria->hmatice.copy(&this->hmatice);
    236234        tria->hmatpar.copy(&this->hmatpar);
     
    279277        memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    280278        memcpy(&interpolation_type,marshalled_dataset,sizeof(interpolation_type));marshalled_dataset+=sizeof(interpolation_type);
    281         memcpy(&nummodels,marshalled_dataset,sizeof(nummodels));marshalled_dataset+=sizeof(nummodels);
     279        memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    282280
    283281        /*allocate dynamic memory: */
    284         InitHookNodes(nummodels);
     282        InitHookNodes(numanalyses);
    285283
    286284        /*demarshall hooks: */
    287         for(i=0;i<nummodels;i++)hnodes[i].Demarshall(&marshalled_dataset);
     285        for(i=0;i<numanalyses;i++)hnodes[i].Demarshall(&marshalled_dataset);
    288286        hmatice.Demarshall(&marshalled_dataset);
    289287        hmatpar.Demarshall(&marshalled_dataset);
     
    362360        memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    363361        memcpy(marshalled_dataset,&interpolation_type,sizeof(interpolation_type));marshalled_dataset+=sizeof(interpolation_type);
    364         memcpy(marshalled_dataset,&nummodels,sizeof(nummodels));marshalled_dataset+=sizeof(nummodels);
     362        memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    365363
    366364        /*Marshall hooks: */
    367         for(i=0;i<nummodels;i++)hnodes[i].Marshall(&marshalled_dataset);
     365        for(i=0;i<numanalyses;i++)hnodes[i].Marshall(&marshalled_dataset);
    368366        hmatice.Marshall(&marshalled_dataset);
    369367        hmatpar.Marshall(&marshalled_dataset);
     
    389387        int hnodes_size=0;;
    390388
    391         for(i=0;i<nummodels;i++)hnodes_size+=hnodes[i].MarshallSize;
    392 
    393        
     389        for(i=0;i<numanalyses;i++)hnodes_size+=hnodes[i].MarshallSize();
     390
    394391        return sizeof(id)
    395392                +hnodes_size
     
    403400/*FUNCTION Tria::SpawnBeam {{{1*/
    404401void* Tria::SpawnBeam(int g0, int g1){
     402
     403        int i;
    405404
    406405        /*out of grids g0,g1 and g2 from Tria, build a beam element: */
     
    15341533        /*build friction object, used later on: */
    15351534        if (drag_type!=2)ISSMERROR(" non-viscous friction not supported yet!");
    1536         friction=new Friction("2d",inputs,matpar);
     1535        friction=new Friction("2d",inputs,matpar,analysis_type);
    15371536
    15381537        /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
     
    23002299                else ISSMERROR("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet");
    23012300        }
    2302         else if (analysis_type==SlopecomputeAnalysisEnum){
     2301        else if (analysis_type==SlopeComputeAnalysisEnum){
    23032302                CreatePVectorSlopeCompute( pg,analysis_type,sub_analysis_type);
    23042303        }
     
    31963195        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    31973196        if (drag_type!=2)ISSMERROR(" non-viscous friction not supported yet!");
    3198         friction=new Friction("3d",inputs,matpar);
     3197        friction=new Friction("3d",inputs,matpar,analysis_type);
    31993198       
    32003199        /* Ice/ocean heat exchange flux on ice shelf base */
     
    42684267        /*Build frictoin element, needed later: */
    42694268        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    4270         friction=new Friction("2d",inputs,matpar);
     4269        friction=new Friction("2d",inputs,matpar,analysis_type);
    42714270
    42724271        /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
     
    44234422        /*Build frictoin element, needed later: */
    44244423        inputs->GetParameterValue(&drag_type,DragTypeEnum);
    4425         friction=new Friction("2d",inputs,matpar);
     4424        friction=new Friction("2d",inputs,matpar,analysis_type);
    44264425
    44274426        /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4004 r4021  
    3737                /*FUNCTION constructors, destructors {{{1*/
    3838                Tria();
    39                 Tria(int tria_id,int i, IoModel* iomodel);
     39                Tria(int tria_id,int i, IoModel* iomodel,int nummodels);
     40                void  Update(int index,IoModel* iomodel,int analysis_counter,int analysis_type);
    4041                ~Tria();
    4142                /*}}}*/
    4243                /*FUNCTION object management {{{1*/
    4344                void  Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters,int analysis_counter);
    44                 void  Update(IoModel* iomodel,int analysis_counter,int analysis_type);
    4545                Object* copy();
    4646                void  DeepEcho();
  • issm/trunk/src/c/objects/Elements/TriaHook.cpp

    r3984 r4021  
    2424TriaHook::TriaHook(){
    2525        numanalyses=UNDEF;
    26         this->hooks=NULL;
     26        this->hnodes=NULL;
    2727}
    2828/*}}}*/
  • issm/trunk/src/c/objects/Loads/Icefront.cpp

    r4007 r4021  
    4141
    4242        /*First, retrieve element index and element type: */
    43         if (strcmp(iomodel->meshtype,"2d")==0){
     43        if (iomodel->dim==2){
    4444                segment_width=4;
    4545        }
     
    5656        icefront_node_ids[1]=(int)*(iomodel->pressureload+segment_width*i+1);
    5757
    58         if (iomodel->sub_analysis_type==HorizAnalysisEnum){
     58        if (analysis_type==DiagnosticHorizAnalysisEnum){
    5959                if ((int)*(iomodel->elements_type+2*element+0)==MacAyealFormulationEnum){ //this is a collapsed 3d element, icefront will be 2d
    6060                        icefront_type=SegmentIcefrontEnum;
     
    6767                else ISSMERROR(" element type %i not supported yet",(int)*(iomodel->elements_type+2*element+0));
    6868        }
    69         else if (iomodel->sub_analysis_type==StokesAnalysisEnum){
     69        else if (analysis_type==DiagnosticStokesAnalysisEnum){
    7070                //We have a Stokes element, so we need a 3d Icefront
    7171                icefront_type=QuadIceFrontEnum;
     
    108108        /*copy fields: */
    109109        icefront->id=this->id;
    110         icefront->analysis=this->analysis;
     110        icefront->analysis_type=this->analysis_type;
    111111        if(this->inputs){
    112112                icefront->inputs=(Inputs*)this->inputs->Copy();
     
    122122        icefront->helement.copy(&this->helement);
    123123        icefront->hmatpar.copy(&this->hmatpar);
    124 
    125         /*recover objects: */
    126         icefront->nodes=(Node**)icefront->hnodes.deliverp();
    127         icefront->element=(Element*)icefront->helement.delivers();
    128         icefront->matpar=(Matpar*)icefront->hmatpar.delivers();
    129124
    130125        return icefront;
  • issm/trunk/src/c/objects/Loads/Numericalflux.cpp

    r4007 r4021  
    129129        /*copy fields: */
    130130        numericalflux->id=this->id;
    131         numericalflux->analysis=this->analysis;
     131        numericalflux->analysis_type=this->analysis_type;
    132132        if(this->inputs){
    133133                numericalflux->inputs=(Inputs*)this->inputs->Copy();
     
    141141        /*now deal with hooks and objects: */
    142142        numericalflux->hnodes.copy(&this->hnodes);
    143         numericalflux->helement.copy(&this->helement);
    144 
    145         /*recover objects: */
    146         numericalflux->nodes=(Node**)numericalflux->hnodes.deliverp();
    147         numericalflux->element=(Element*)numericalflux->helement.delivers();
     143        numericalflux->helements.copy(&this->helements);
    148144
    149145        return numericalflux;
  • issm/trunk/src/c/objects/Loads/Pengrid.cpp

    r4007 r4021  
    7676        /*copy fields: */
    7777        pengrid->id=this->id;
    78         pengrid->analysis=this->analysis;
     78        pengrid->analysis_type=this->analysis_type;
    7979        if(this->inputs){
    8080                pengrid->inputs=(Inputs*)this->inputs->Copy();
     
    8787
    8888        /*now deal with hooks and objects: */
    89         pengrid->hnode.copy(&this->hnodes);
     89        pengrid->hnode.copy(&this->hnode);
    9090        pengrid->helement.copy(&this->helement);
    9191        pengrid->hmatpar.copy(&this->hmatpar);
    92 
    93         /*recover objects: */
    94         pengrid->node=(Node**)pengrid->hnode.deliverp();
    95         pengrid->element=(Element*)pengrid->helement.delivers();
    96         pengrid->matpar=(Matpar*)pengrid->hmatpar.delivers();
    9792
    9893        //let's not forget internals
     
    456451
    457452        //recover slope: */
    458         penta->inputs->GetParameterValue(&slope[0],node,BedSlopexEnum);
    459         penta->inputs->GetParameterValue(&slope[1],node,BedSlopeyEnum);
     453        penta->inputs->GetParameterValue(&slope[0],node,BedSlopeXEnum);
     454        penta->inputs->GetParameterValue(&slope[1],node,BedSlopeYEnum);
    460455       
    461456        /*recover parameters: */
  • issm/trunk/src/c/objects/Loads/Penpair.cpp

    r4007 r4021  
    5656        /*copy fields: */
    5757        penpair->id=this->id;
    58         penpair->analysis=this->analysis;
     58        penpair->analysis_type=this->analysis_type;
    5959
    6060        /*now deal with hooks and objects: */
    6161        penpair->hnodes.copy(&this->hnodes);
    62 
    63         /*recover objects: */
    64         penpair->nodes=(Node**)penpair->hnodes.deliverp();
    6562
    6663        return penpair;
  • issm/trunk/src/c/objects/Loads/Riftfront.cpp

    r4003 r4021  
    103103        /*copy fields: */
    104104        riftfront->id=this->id;
    105         riftfront->analysis=this->analysis;
     105        riftfront->analysis_type=this->analysis_type;
    106106        if(this->inputs){
    107107                riftfront->inputs=(Inputs*)this->inputs->Copy();
     
    115115        /*now deal with hooks and objects: */
    116116        riftfront->hnodes.copy(&this->hnodes);
    117         riftfront->helement.copy(&this->helement);
     117        riftfront->helements.copy(&this->helements);
    118118        riftfront->hmatpar.copy(&this->hmatpar);
    119 
    120         /*recover objects: */
    121         riftfront->nodes=(Node**)riftfront->hnodes.deliverp();
    122         riftfront->element=(Element*)riftfront->helement.delivers();
    123         riftfront->matpar=(Matpar*)riftfront->hmatpar.delivers();
    124119
    125120        return riftfront;
  • issm/trunk/src/c/objects/Materials/Matice.cpp

    r3984 r4021  
    4242        double matice_B;
    4343        double matice_n;
     44        int    num_vertices;
    4445
    4546        /*intermediary: */
     
    4748
    4849        /*2d or 3d? */
    49         if(strcmp(iomodel->meshtype,"2d")==0){
     50        if(iomodel->dim==2){
    5051                num_vertices=3; //tria elements
    5152        }
    52         else if(strcmp(iomodel->meshtype,"3d")==0){
     53        else if(iomodel->dim==3){
    5354                num_vertices=6; //penta elements
    5455        }
  • issm/trunk/src/c/objects/Node.cpp

    r4002 r4021  
    6767
    6868        /*indexing:*/
    69         DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node
     69        DistributeNumDofs(&numdofs,analysis_type); //number of dofs per node
    7070
    7171        this->indexing.Init(numdofs);
     
    7474        vertex_id=this->id; //node and vertex have the same id, as we are running galerkin continuous, with same number of nodes and vertices.
    7575
    76         if (strcmp(iomodel->meshtype,"3d")==0){
     76        if (iomodel->dim==3){
    7777                if (isnan(iomodel->uppernodes[i])){
    7878                        upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves.
     
    9393
    9494        /*Diagnostic Horiz*/
    95         if (iomodel->analysis_type==DiagnosticAnalysisEnum && iomodel->sub_analysis_type==HorizAnalysisEnum){
    96                 if (strcmp(iomodel->meshtype,"3d")==0){
     95        if (analysis_type==DiagnosticHorizAnalysisEnum){
     96                if (iomodel->dim==3){
    9797                        /*We have a  3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
    9898                        if (!iomodel->deadgrids) ISSMERROR("iomodel->deadgrids is NULL");
     
    113113
    114114        /*Diagnostic Stokes*/
    115         if (iomodel->analysis_type==DiagnosticAnalysisEnum && iomodel->sub_analysis_type==StokesAnalysisEnum){
     115        if (analysis_type==DiagnosticStokesAnalysisEnum){
    116116                /*On a 3d mesh, in stokes formualtions, only stokes grids are free, the others are frozen: */
    117117                if (!iomodel->borderstokes) ISSMERROR("iomodel->borderstokes is NULL");
     
    130130
    131131        /*Diagnostic Hutter*/
    132         if (iomodel->analysis_type==DiagnosticAnalysisEnum && iomodel->sub_analysis_type==HutterAnalysisEnum){
     132        if (analysis_type==DiagnosticHutterAnalysisEnum){
    133133                /*Spc all nodes that are not Hutter*/
    134134                if (!iomodel->gridonhutter) ISSMERROR("iomodel->gridonhutter is NULL");
     
    142142        /*Prognostic/ Melting/ Slopecompute/ Balancedvelocities/ Balancedthickness*/
    143143        if (
    144                                 iomodel->analysis_type==PrognosticAnalysisEnum ||
    145                                 iomodel->analysis_type==MeltingAnalysisEnum ||
    146                                 iomodel->analysis_type==SlopecomputeAnalysisEnum ||
    147                                 iomodel->analysis_type==BalancedvelocitiesAnalysisEnum ||
    148                                 iomodel->analysis_type==BalancedthicknessAnalysisEnum
     144                                analysis_type==PrognosticAnalysisEnum ||
     145                                analysis_type==MeltingAnalysisEnum ||
     146                                analysis_type==SlopeComputeAnalysisEnum ||
     147                                analysis_type==BalancedvelocitiesAnalysisEnum ||
     148                                analysis_type==BalancedthicknessAnalysisEnum
    149149                                ){
    150                 if (strcmp(iomodel->meshtype,"3d")==0){
     150                if (iomodel->dim==3){
    151151                        /*On a 3d mesh, we may have collapsed elements, hence dead grids. Freeze them out: */
    152152                        if (!iomodel->gridonbed) ISSMERROR("iomodel->gridonbed is NULL");
     
    183183
    184184        /*indexing:*/
    185         DistributeNumDofs(&numdofs,iomodel->analysis_type,iomodel->sub_analysis_type); //number of dofs per node
     185        DistributeNumDofs(&numdofs,analysis_type); //number of dofs per node
    186186
    187187        this->indexing.Init(numdofs);
     
    191191        vertex_id=i+1; //matlab indexing
    192192
    193         if (strcmp(iomodel->meshtype,"3d")==0){
     193        if (iomodel->dim==3){
    194194                if (isnan(iomodel->uppernodes[i])){
    195195                        upper_node_id=this->id; //nodes on surface do not have upper nodes, only themselves.
  • issm/trunk/src/c/shared/Dofs/DistributeNumDofs.cpp

    r3775 r4021  
    77#include "../shared.h"
    88
    9 int DistributeNumDofs(int *pnumdofs,int analysis_type,int sub_analysis_type){
     9int DistributeNumDofs(int *pnumdofs,int analysis_type){
    1010
    1111        int numdofs=2; //default numdofs
     
    1313
    1414        /*ok, according to analysis type: */
    15         if (analysis_type==ControlAnalysisEnum){
    16                 if (sub_analysis_type==HorizAnalysisEnum){
    17                         numdofs=2;
    18                 }
    19                 else if (sub_analysis_type==VertAnalysisEnum){
    20                         numdofs=1;
    21                 }
    22                 else if (sub_analysis_type==StokesAnalysisEnum){
    23                         numdofs=4;
    24                 }
    25                 else if (sub_analysis_type==HutterAnalysisEnum){
    26                         numdofs=2;
    27                 }
     15        if (analysis_type==DiagnosticHorizAnalysisEnum){
     16                numdofs=2;
    2817        }
    29         else if (analysis_type==DiagnosticAnalysisEnum){
    30                 if (sub_analysis_type==HorizAnalysisEnum){
    31                         numdofs=2;
    32                 }
    33                 else if (sub_analysis_type==VertAnalysisEnum){
    34                         numdofs=1;
    35                 }
    36                 else if (sub_analysis_type==StokesAnalysisEnum){
    37                         numdofs=4;
    38                 }
    39                 else if (sub_analysis_type==HutterAnalysisEnum){
    40                         numdofs=2;
    41                 }
     18        else if (analysis_type==DiagnosticVertAnalysisEnum){
     19                numdofs=1;
    4220        }
    43         else if (analysis_type==SlopecomputeAnalysisEnum){
     21        else if (analysis_type==DiagnosticStokesAnalysisEnum){
     22                numdofs=4;
     23        }
     24        else if (analysis_type==DiagnosticHutterAnalysisEnum){
     25                numdofs=2;
     26        }
     27        else if (analysis_type==SlopeComputeAnalysisEnum){
    4428                numdofs=1;
    4529        }
  • issm/trunk/src/c/shared/Dofs/dofs.h

    r465 r4021  
    77
    88double* dofsetgen(int numdofs,int* doflist,int dofspernode,int totaldofs);
    9 int DistributeNumDofs(int *pnumdofs,int analysis_type,int sub_analysis_type);
     9int DistributeNumDofs(int *pnumdofs,int analysis_type);
    1010
    1111
  • issm/trunk/src/c/solutions/diagnostic.cpp

    r4015 r4021  
    3838        double   start_init, finish_init;
    3939
    40         int analyses[5]={DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticStokesAnalysisEnum,DiagnosticHutterAnalysisEnum,SlopecomputeAnalysisEnum};
     40        int analyses[5]={DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticStokesAnalysisEnum,DiagnosticHutterAnalysisEnum,SlopeComputeAnalysisEnum};
    4141
    4242        MODULEBOOT();
     
    9595
    9696                _printf_("write results to disk:\n");
    97                 OutputResults(femmodel,outputfilename);
     97                OutputResults(femmodel,outputfilename,DiagnosticAnalysisEnum);
    9898        }
    9999        else{
  • issm/trunk/src/c/solutions/solutions.h

    r4015 r4021  
    1313
    1414/*cores: */
    15 Results* gradjcompute_core(Model* model);
    16 void* diagnostic_core(Model* model);
    17 Results* prognostic_core(Model* model);
    18 Results* prognostic2_core(Model* model);
    19 Results* balancedthickness_core(Model* model);
    20 Results* balancedthickness2_core(Model* model);
    21 Results* balancedvelocities_core(Model* model);
    22 Results* slopecompute_core(Model* model);
    23 Results* control_core(Model* model);
    24 Results* steadystate_core(Model* model);
    25 Results* transient_core(Model* model);
    26 Results* transient_core_2d(Model* model);
    27 Results* transient_core_3d(Model* model);
    28 Results* thermal_core(Model* model);
     15Results* gradjcompute_core(FemModel* model);
     16void* diagnostic_core(FemModel* model);
     17Results* prognostic_core(FemModel* model);
     18Results* prognostic2_core(FemModel* model);
     19Results* balancedthickness_core(FemModel* model);
     20Results* balancedthickness2_core(FemModel* model);
     21Results* balancedvelocities_core(FemModel* model);
     22Results* slopecompute_core(FemModel* model);
     23Results* control_core(FemModel* model);
     24Results* steadystate_core(FemModel* model);
     25Results* transient_core(FemModel* model);
     26Results* transient_core_2d(FemModel* model);
     27Results* transient_core_3d(FemModel* model);
     28Results* thermal_core(FemModel* model);
    2929void slope_core(FemModel* fem,int sub_analysis_type);
    3030
     
    5151void WriteLockFile(char* filename);
    5252
    53 void ControlInitialization(Model* model);
    54 void ControlRestart(Model* model,double* param_g);
     53void ControlInitialization(FemModel* model);
     54void ControlRestart(FemModel* model,double* param_g);
    5555
    5656void CreateFemModel(FemModel* femmodel,ConstDataHandle MODEL,int analysis_type,int sub_analysis_type);
  • issm/trunk/src/c/toolkits/metis/metisincludes.h

    r586 r4021  
    99#include <metis.h>
    1010
    11 extern "C" void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
     11void METIS_PartMeshNodal(int *, int *, idxtype *, int *, int *, int *, int *, idxtype *, idxtype *);
    1212
    1313#endif
Note: See TracChangeset for help on using the changeset viewer.