Changeset 5731 for issm/trunk/src/c/objects/Elements/Penta.cpp
- Timestamp:
- 09/09/10 15:54:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Penta.cpp
r5729 r5731 4265 4265 void Penta::GetParameterValue(double* pvalue,Node* node,int enumtype){ 4266 4266 4267 /*Output*/ 4268 double value; 4269 4270 /*Intermediaries*/ 4271 const int numnodes=6; 4272 int grid=-1; 4273 int i; 4274 double gauss[numnodes][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}}; 4275 4276 /*go through 3 nodes (all nodes for tria) and identify 1st and 2nd nodes: */ 4267 GaussPenta* gauss=new GaussPenta(); 4268 4277 4269 ISSMASSERT(nodes); 4278 for(i=0;i<numnodes;i++){ 4279 if (node==nodes[i]){ 4280 grid=i; 4281 break; 4282 } 4283 } 4284 4285 /*Check that the node has been found*/ 4286 if (grid==-1) ISSMERROR("Node pointer not found in Penta's nodes"); 4287 4288 /*Get Parameter value on node*/ 4289 inputs->GetParameterValue(pvalue,&gauss[grid][0],enumtype); 4290 return; 4291 4270 gauss->GaussVertex(this->GetNodeIndex(node)); 4271 4272 inputs->GetParameterValue(pvalue,gauss,enumtype); 4292 4273 } 4293 4274 /*}}}*/ … … 4337 4318 const int numdofpervertex=2; 4338 4319 const int numdof=numdofpervertex*NUMVERTICES; 4339 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4320 GaussPenta* gauss; 4340 4321 int* doflist=NULL; 4341 4322 double values[numdof]; … … 4358 4339 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 4359 4340 /*P1 element only for now*/ 4341 gauss=new GaussPenta(); 4360 4342 for(i=0;i<NUMVERTICES;i++){ 4361 4343 4362 4344 /*Recover vx and vy*/ 4363 inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum); 4364 inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum); 4345 gauss->GaussVertex(i); 4346 inputs->GetParameterValue(&vx,gauss,VxEnum); 4347 inputs->GetParameterValue(&vy,gauss,VyEnum); 4365 4348 values[i*numdofpervertex+0]=vx; 4366 4349 values[i*numdofpervertex+1]=vy; … … 4371 4354 4372 4355 /*Free ressources:*/ 4356 delete gauss; 4373 4357 xfree((void**)&doflist); 4374 4358 } … … 4381 4365 const int numdofpervertex=2; 4382 4366 const int numdof=numdofpervertex*NUMVERTICES; 4383 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4367 GaussPenta* gauss=NULL; 4384 4368 int* doflist=NULL; 4385 4369 double values[numdof]; … … 4392 4376 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 4393 4377 /*P1 element only for now*/ 4378 gauss=new GaussPenta(); 4394 4379 for(i=0;i<NUMVERTICES;i++){ 4395 4380 4396 4381 /*Recover vx and vy*/ 4397 inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum); 4398 inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum); 4382 gauss->GaussVertex(i); 4383 inputs->GetParameterValue(&vx,gauss,VxEnum); 4384 inputs->GetParameterValue(&vy,gauss,VyEnum); 4399 4385 values[i*numdofpervertex+0]=vx; 4400 4386 values[i*numdofpervertex+1]=vy; … … 4405 4391 4406 4392 /*Free ressources:*/ 4393 delete gauss; 4407 4394 xfree((void**)&doflist); 4408 4395 } … … 4415 4402 const int numdofpervertex=1; 4416 4403 const int numdof=numdofpervertex*NUMVERTICES; 4417 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4404 GaussPenta* gauss=NULL; 4418 4405 int* doflist=NULL; 4419 4406 double values[numdof]; … … 4425 4412 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 4426 4413 /*P1 element only for now*/ 4414 gauss=new GaussPenta(); 4427 4415 for(i=0;i<NUMVERTICES;i++){ 4428 4416 4429 4417 /*Recover vz */ 4430 inputs->GetParameterValue(&vz,&gauss[i][0],VxEnum); 4418 gauss->GaussVertex(i); 4419 inputs->GetParameterValue(&vz,gauss,VxEnum); 4431 4420 values[i]=vz; 4432 4421 } … … 4436 4425 4437 4426 /*Free ressources:*/ 4427 delete gauss; 4438 4428 xfree((void**)&doflist); 4439 4429 } … … 4446 4436 const int numdofpervertex=4; 4447 4437 const int numdof=numdofpervertex*NUMVERTICES; 4448 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4438 GaussPenta *gauss; 4449 4439 int* doflist=NULL; 4450 4440 double values[numdof]; … … 4460 4450 /*Ok, we have vx vy vz and P in values, fill in vx vy vz P arrays: */ 4461 4451 /*P1 element only for now*/ 4452 gauss=new GaussPenta(); 4462 4453 for(i=0;i<NUMVERTICES;i++){ 4463 4454 4464 4455 /*Recover vx and vy*/ 4465 inputs->GetParameterValue(&vx,&gauss[i][0],VxEnum); 4466 inputs->GetParameterValue(&vy,&gauss[i][0],VyEnum); 4467 inputs->GetParameterValue(&vz,&gauss[i][0],VzEnum); 4468 inputs->GetParameterValue(&p ,&gauss[i][0],PressureEnum); 4456 gauss->GaussVertex(i); 4457 inputs->GetParameterValue(&vx,gauss,VxEnum); 4458 inputs->GetParameterValue(&vy,gauss,VyEnum); 4459 inputs->GetParameterValue(&vz,gauss,VzEnum); 4460 inputs->GetParameterValue(&p ,gauss,PressureEnum); 4469 4461 values[i*numdofpervertex+0]=vx; 4470 4462 values[i*numdofpervertex+1]=vy; … … 4477 4469 4478 4470 /*Free ressources:*/ 4471 delete gauss; 4479 4472 xfree((void**)&doflist); 4480 4473 } … … 4487 4480 const int numdofpervertex=1; 4488 4481 const int numdof=numdofpervertex*NUMVERTICES; 4489 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4482 GaussPenta *gauss=NULL; 4490 4483 int* doflist=NULL; 4491 4484 double values[numdof]; … … 4498 4491 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 4499 4492 /*P1 element only for now*/ 4493 gauss=new GaussPenta(); 4500 4494 for(i=0;i<NUMVERTICES;i++){ 4501 4495 4502 4496 /*Recover vz */ 4503 inputs->GetParameterValue(&vz,&gauss[i][0],TemperatureEnum); 4497 gauss->GaussVertex(i); 4498 inputs->GetParameterValue(&vz,gauss,TemperatureEnum); 4504 4499 values[i]=vz; 4505 4500 } … … 4509 4504 4510 4505 /*Free ressources:*/ 4506 delete gauss; 4511 4507 xfree((void**)&doflist); 4512 4508 } … … 4883 4879 double rho_ice,g; 4884 4880 double xyz_list[NUMVERTICES][3]; 4885 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4886 4881 4887 4882 Input *vz_input = NULL; … … 4976 4971 double rho_ice,g; 4977 4972 double xyz_list[NUMVERTICES][3]; 4978 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};4979 4973 4980 4974 Input *vz_input = NULL; … … 5069 5063 double rho_ice,g; 5070 5064 double xyz_list[NUMVERTICES][3]; 5071 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};5072 5065 5073 5066 Input *vz_input = NULL; … … 5149 5142 double rho_ice,g; 5150 5143 double xyz_list[NUMVERTICES][3]; 5151 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};5152 5144 5153 5145 Input* vz_input=NULL; … … 5229 5221 double rho_ice,g; 5230 5222 double xyz_list[NUMVERTICES][3]; 5231 double gauss[NUMVERTICES][4]={{1,0,0,-1},{0,1,0,-1},{0,0,1,-1},{1,0,0,1},{0,1,0,1},{0,0,1,1}};5232 5223 5233 5224 Input* vx_input=NULL;
Note:
See TracChangeset
for help on using the changeset viewer.