Changeset 4920


Ignore:
Timestamp:
08/02/10 10:13:45 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added helement to matice

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

Legend:

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

    r4673 r4920  
    2020Matice::Matice(){
    2121        this->inputs=NULL;
     22        this->helement=NULL;
    2223        return;
    2324}
     
    2829        /*Intermediaries:*/
    2930        int    i;
     31        int    matice_eid;
    3032
    3133        /*Initialize id*/
     
    7476                }
    7577        }
    76 
    7778        /*Else*/
    7879        else ISSMERROR(" Mesh type not supported yet!");
    7980
     81        /*Hooks: */
     82        matice_eid=index+1;
     83        this->helement=new Hook(&matice_eid,1);
     84
     85        return;
     86
    8087}
    8188/*}}}*/
    8289/*FUNCTION Matice::~Matice(){{{1*/
    8390Matice::~Matice(){
     91        delete helement;
    8492        delete inputs;
    8593        return;
     
    95103        printf("   inputs:\n");
    96104        inputs->Echo();
     105        printf("   element:\n");
     106        helement->Echo();
    97107}
    98108/*}}}*/
     
    104114        printf("   inputs:\n");
    105115        inputs->DeepEcho();
     116        printf("   element:\n");
     117        helement->Echo();
    106118}               
    107119/*}}}*/
     
    136148        memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
    137149
     150        /*Marshall hooks: */
     151        helement->Marshall(&marshalled_dataset);
     152
    138153        /*Marshall inputs: */
    139154        marshalled_inputs_size=inputs->MarshallSize();
     
    152167
    153168        return sizeof(mid)
     169          +helement->MarshallSize()
    154170          +inputs->MarshallSize()
    155171          +sizeof(int); //sizeof(int) for enum type
     
    166182        /*this time, no need to get enum type, the pointer directly points to the beginning of the
    167183         *object data (thanks to DataSet::Demarshall):*/
    168 
    169184        memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
     185
     186        /*demarshall hooks: */
     187        helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    170188
    171189        /*demarshall inputs: */
     
    190208        Matice* matice=NULL;
    191209
     210        /*copy fields: */
    192211        matice->mid=this->mid;
    193         if(this->inputs){
    194                 matice->inputs=(Inputs*)this->inputs->Copy();
    195         }
    196         else{
    197                 matice->inputs=new Inputs();
    198         }
     212        matice->helement=(Hook*)this->helement->copy();
     213        if(this->inputs) matice->inputs=(Inputs*)this->inputs->Copy();
     214        else  matice->inputs=new Inputs();
     215
    199216        return matice;
    200217}
     
    202219
    203220/*Matice management*/
     221/*FUNCTION Matice::Configure {{{1*/
     222void  Matice::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     223
     224        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     225         * datasets, using internal ids and offsets hidden in hooks: */
     226        helement->configure(elementsin);
     227}
     228/*}}}*/
     229/*FUNCTION Matice::SetCurrentConfiguration {{{1*/
     230void  Matice::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){
     231
     232        /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective
     233         * datasets, using internal ids and offsets hidden in hooks: */
     234        helement->configure(elementsin);
     235}
     236/*}}}*/
    204237/*FUNCTION Matice::GetB {{{1*/
    205238double Matice::GetB(){
  • issm/trunk/src/c/objects/Materials/Matice.h

    r4685 r4920  
    1515
    1616        private:
     17                /*Id*/
    1718                int        mid;
    1819
     20                /*hooks: */
     21                Hook* helement;
     22
    1923        public:
    20                 /*WARNIN: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
     24                /*WARNING: input should not be public but it is an easy way to update B from T (using UpdateFromSolution) from Pentas*/
    2125                Inputs*  inputs;
    2226
     
    4751                /*}}}*/
    4852                /*Matice Numerics: {{{1*/
     53                void   Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
     54                void   SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin);
    4955                void   GetViscosity2d(double* pviscosity, double* pepsilon);
    5056                void   GetViscosity3d(double* pviscosity3d, double* pepsilon);
Note: See TracChangeset for help on using the changeset viewer.