Changeset 15485
- Timestamp:
- 07/11/13 15:44:54 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r15483 r15485 241 241 ElementMatrix* Tria::CreateMassMatrix(void){ 242 242 243 /*constants: */244 const int numdof=NDOF1*NUMVERTICES;245 246 243 /* Intermediaries */ 247 244 IssmDouble D,Jdet; 248 245 IssmDouble xyz_list[NUMVERTICES][3]; 249 IssmDouble basis[numdof]; 250 GaussTria *gauss = NULL; 251 252 /*Initialize Element matrix*/ 253 ElementMatrix* Ke=new ElementMatrix(nodes,NUMVERTICES,this->parameters,NoneApproximationEnum); 254 246 247 /*Fetch number of nodes and dof for this finite element*/ 248 int numnodes = this->NumberofNodes(); 249 int numdof = numnodes*NDOF2; 250 251 /*Initialize Element matrix and vectors*/ 252 ElementMatrix* Ke = new ElementMatrix(nodes,numnodes,this->parameters,NoneApproximationEnum); 253 IssmDouble* basis = xNew<IssmDouble>(numdof); 254 255 /*Retrieve all inputs and parameters*/ 255 256 GetVerticesCoordinates(&xyz_list[0][0],vertices,NUMVERTICES); 256 257 257 258 /* Start looping on the number of gaussian points: */ 258 gauss=new GaussTria(2);259 GaussTria* gauss=new GaussTria(2); 259 260 for(int ig=gauss->begin();ig<gauss->end();ig++){ 260 261 261 262 gauss->GaussPoint(ig); 262 263 263 GetNodalFunctions( &basis[0],gauss);264 GetNodalFunctions(basis,gauss); 264 265 GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss); 265 266 D=gauss->weight*Jdet; 266 267 267 TripleMultiply( &basis[0],1,3,1,268 TripleMultiply(basis,1,numnodes,1, 268 269 &D,1,1,0, 269 &basis[0],1,3,0,270 basis,1,numnodes,0, 270 271 &Ke->values[0],1); 271 272 } … … 273 274 /*Clean up and return*/ 274 275 delete gauss; 276 xDelete<IssmDouble>(basis); 275 277 return Ke; 276 278 } … … 2781 2783 int numdof = numnodes*NDOF2; 2782 2784 2783 /*Initialize Element matrix , vectors and Gaussian points*/2785 /*Initialize Element matrix and vectors*/ 2784 2786 ElementMatrix* Ke = new ElementMatrix(nodes,numnodes,this->parameters,MacAyealApproximationEnum); 2785 2787 IssmDouble* B = xNew<IssmDouble>(3*numdof); … … 2797 2799 2798 2800 /* Start looping on the number of gaussian points: */ 2799 GaussTria* 2801 GaussTria* gauss = new GaussTria(2); 2800 2802 for(int ig=gauss->begin();ig<gauss->end();ig++){ 2801 2803
Note:
See TracChangeset
for help on using the changeset viewer.