Changeset 4920
- Timestamp:
- 08/02/10 10:13:45 (15 years ago)
- Location:
- issm/trunk/src/c/objects/Materials
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Materials/Matice.cpp
r4673 r4920 20 20 Matice::Matice(){ 21 21 this->inputs=NULL; 22 this->helement=NULL; 22 23 return; 23 24 } … … 28 29 /*Intermediaries:*/ 29 30 int i; 31 int matice_eid; 30 32 31 33 /*Initialize id*/ … … 74 76 } 75 77 } 76 77 78 /*Else*/ 78 79 else ISSMERROR(" Mesh type not supported yet!"); 79 80 81 /*Hooks: */ 82 matice_eid=index+1; 83 this->helement=new Hook(&matice_eid,1); 84 85 return; 86 80 87 } 81 88 /*}}}*/ 82 89 /*FUNCTION Matice::~Matice(){{{1*/ 83 90 Matice::~Matice(){ 91 delete helement; 84 92 delete inputs; 85 93 return; … … 95 103 printf(" inputs:\n"); 96 104 inputs->Echo(); 105 printf(" element:\n"); 106 helement->Echo(); 97 107 } 98 108 /*}}}*/ … … 104 114 printf(" inputs:\n"); 105 115 inputs->DeepEcho(); 116 printf(" element:\n"); 117 helement->Echo(); 106 118 } 107 119 /*}}}*/ … … 136 148 memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid); 137 149 150 /*Marshall hooks: */ 151 helement->Marshall(&marshalled_dataset); 152 138 153 /*Marshall inputs: */ 139 154 marshalled_inputs_size=inputs->MarshallSize(); … … 152 167 153 168 return sizeof(mid) 169 +helement->MarshallSize() 154 170 +inputs->MarshallSize() 155 171 +sizeof(int); //sizeof(int) for enum type … … 166 182 /*this time, no need to get enum type, the pointer directly points to the beginning of the 167 183 *object data (thanks to DataSet::Demarshall):*/ 168 169 184 memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid); 185 186 /*demarshall hooks: */ 187 helement=new Hook(); helement->Demarshall(&marshalled_dataset); 170 188 171 189 /*demarshall inputs: */ … … 190 208 Matice* matice=NULL; 191 209 210 /*copy fields: */ 192 211 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 199 216 return matice; 200 217 } … … 202 219 203 220 /*Matice management*/ 221 /*FUNCTION Matice::Configure {{{1*/ 222 void 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*/ 230 void 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 /*}}}*/ 204 237 /*FUNCTION Matice::GetB {{{1*/ 205 238 double Matice::GetB(){ -
issm/trunk/src/c/objects/Materials/Matice.h
r4685 r4920 15 15 16 16 private: 17 /*Id*/ 17 18 int mid; 18 19 20 /*hooks: */ 21 Hook* helement; 22 19 23 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*/ 21 25 Inputs* inputs; 22 26 … … 47 51 /*}}}*/ 48 52 /*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); 49 55 void GetViscosity2d(double* pviscosity, double* pepsilon); 50 56 void GetViscosity3d(double* pviscosity3d, double* pepsilon);
Note:
See TracChangeset
for help on using the changeset viewer.