Changeset 3599
- Timestamp:
- 04/21/10 17:04:16 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 12 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/configs/linux64/linux64.sh.petsc2
r3592 r3599 1 1 #!/bin/sh 2 2 3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-petsc-version=2 3 ./configure --prefix=$ISSM_DIR --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install --with-metis-dir=$ISSM_DIR/externalpackages/metis/install --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich" --with-petsc-arch=$ISSM_ARCH --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/$ISSM_ARCH/INCLUDE" --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/MUMPS_4.6.3/$ISSM_ARCH --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" --with-graphics-lib=/usr/lib64/libX11.so --with-cxxoptflags="-march=opteron -O2" --with-numthreads=32 --with-petsc-version=2 -
issm/trunk/externalpackages/matlab/install.sh
r3592 r3599 2 2 3 3 #Matlab version: used by Petsc to detect some weird behaviour starting at version 7.6 (all blas and lapack prototypes changed! damn them!) 4 MATLAB_VERSION=7. 84 MATLAB_VERSION=7.6 5 5 6 6 #Erase symlink -
issm/trunk/src/c/DataSet/DataSet.cpp
r3595 r3599 152 152 /*FUNCTION DataSet::Demarshall{{{1*/ 153 153 DataSet* DataSetDemarshall(char* marshalled_dataset){ 154 155 return DataSetDemarshallRaw(&marshalled_dataset); 156 157 } 158 /*}}}*/ 159 /*FUNCTION DataSet::DemarshallRaw{{{1*/ 160 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset){ 154 161 155 162 int i; … … 162 169 int* sorted_ids=NULL; 163 170 int* id_offsets=NULL; 171 char* marshalled_dataset=NULL; 172 173 /*recover marshalled_dataset pointer: */ 174 marshalled_dataset=*pmarshalled_dataset; 164 175 165 176 /*initialize dataset: */ … … 291 302 292 303 } 304 305 /*Assign output pointers:*/ 306 *pmarshalled_dataset=marshalled_dataset; 307 293 308 return dataset; 294 309 } 310 /*}}}*/ 311 /*FUNCTION DataSet::Spawn{{{1*/ 312 DataSet* DataSet::Spawn(int* indices, int num){ 313 ISSMERROR(" not supported yet!"); 295 314 } 296 315 /*}}}*/ 297 316 298 317 /*Specific methods*/ 318 /*FUNCTION DataSet::AddEinput{{{1*/ 319 int DataSet::AddEinput(Einput* in_einput){ 320 321 /*First, go through dataset of inputs and check whether any input 322 * with the same name is already in. If so, erase the corresponding 323 * object before adding this new one: */ 324 vector<Object*>::iterator object; 325 Einput* einput=NULL; 326 327 for ( object=objects.begin() ; object < objects.end(); object++ ){ 328 329 einput=(Einput*)(*object); //assume this is an inputs dataset 330 331 if (einput->EnumType()==in_einput->EnumType()){ 332 this->DeleteObject(einput); 333 break; 334 } 335 } 336 this->AddObject(in_einput); 337 } 338 /*}}}*/ 299 339 /*FUNCTION DataSet::AddObject{{{1*/ 300 340 int DataSet::AddObject(Object* object){ … … 1577 1617 } 1578 1618 /*}}}*/ 1619 /*FUNCTION DataSet::UpdateInputs{{{1*/ 1620 void DataSet::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){ 1621 1622 vector<Object*>::iterator object; 1623 Element* element=NULL; 1624 1625 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1626 1627 if(EnumIsElement((*object)->Enum())){ 1628 1629 element=(Element*)(*object); 1630 element->UpdateInputs(solution,analysis_type,sub_analysis_type); 1631 } 1632 else ISSMERROR("%s%i%s"," object with id: ",(*object)->GetId()," is not an element, in a function that deals only with elements!"); 1633 } 1634 } 1635 /*}}}*/ 1579 1636 /*FUNCTION DataSet::UpdateFromInputs{{{1*/ 1580 1637 void DataSet::UpdateFromInputs(void* inputs){ -
issm/trunk/src/c/DataSet/DataSet.h
r3556 r3599 12 12 #include <vector> 13 13 #include "../toolkits/toolkits.h" 14 #include "../objects/Einput.h" 14 15 #include "../objects/Object.h" 15 16 … … 46 47 int MarshallSize(); 47 48 int AddObject(Object* object); 49 int AddEinput(Einput* in_einput); 48 50 int DeleteObject(int id); 49 51 int Size(); … … 77 79 void CreatePVector(Vec pg,void* inputs, int analysis_type,int sub_analysis_type); 78 80 void UpdateFromInputs(void* inputs); 81 void UpdateInputs(double* solution,int analysis_type,int sub_analysis_type); 79 82 void PenaltyCreateKMatrix(Mat Kgg,void* inputs,double kmax,int analysis_type,int sub_analysis_type); 80 83 void PenaltyCreatePVector(Vec pg,void* inputs,double kmax,int analysis_type,int sub_analysis_type); … … 98 101 void UpdateVertexPositions(double* thickness,double* bed); 99 102 void OutputRifts(Vec riftproperties); 103 DataSet* Spawn(int* indices, int num); 100 104 /*}}}*/ 101 105 … … 104 108 /*This routine cannot be object oriented, but need for demarshalling: */ 105 109 DataSet* DataSetDemarshall(char* marshalled_dataset); 110 DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset); 106 111 107 112 #endif -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r3588 r3599 98 98 /*Inputs: */ 99 99 InputEnum, 100 TriaVertexInputEnum, 100 101 /*Params: */ 101 102 ParamEnum, … … 120 121 MelangeEnum, 121 122 /*}}}*/ 123 /*Inputs {{{1*/ 124 VxEnum, 125 VyEnum, 126 /*}}}*/ 122 127 123 128 }; -
issm/trunk/src/c/Makefile.am
r3588 r3599 30 30 ./objects/BamgOpts.cpp\ 31 31 ./objects/Element.h\ 32 ./objects/Element.cpp\33 32 ./objects/ElementProperties.h\ 34 33 ./objects/ElementProperties.cpp\ … … 66 65 ./objects/Tria.h\ 67 66 ./objects/Tria.cpp\ 67 ./objects/TriaVertexInput.h\ 68 ./objects/TriaVertexInput.cpp\ 68 69 ./objects/Sing.h\ 69 70 ./objects/Sing.cpp\ … … 80 81 ./objects/Input.h\ 81 82 ./objects/Input.cpp\ 83 ./objects/Einput.h\ 82 84 ./objects/ParameterInputs.h\ 83 85 ./objects/ParameterInputs.cpp\ … … 272 274 ./UpdateFromInputsx/UpdateFromInputsx.h\ 273 275 ./UpdateFromInputsx/UpdateFromInputsx.cpp\ 276 ./UpdateInputsx/UpdateInputsx.h\ 277 ./UpdateInputsx/UpdateInputsx.cpp\ 274 278 ./UpdateGeometryx/UpdateGeometryx.h\ 275 279 ./UpdateGeometryx/UpdateGeometryx.cpp\ … … 437 441 ./objects/BamgOpts.cpp\ 438 442 ./objects/Element.h\ 439 ./objects/Element.cpp\440 443 ./objects/ElementProperties.h\ 441 444 ./objects/ElementProperties.cpp\ … … 473 476 ./objects/Tria.h\ 474 477 ./objects/Tria.cpp\ 478 ./objects/TriaVertexInput.h\ 479 ./objects/TriaVertexInput.cpp\ 475 480 ./objects/Sing.h\ 476 481 ./objects/Sing.cpp\ … … 487 492 ./objects/Input.h\ 488 493 ./objects/Input.cpp\ 494 ./objects/Einput.h\ 489 495 ./objects/ParameterInputs.h\ 490 496 ./objects/ParameterInputs.cpp\ … … 676 682 ./UpdateFromInputsx/UpdateFromInputsx.h\ 677 683 ./UpdateFromInputsx/UpdateFromInputsx.cpp\ 684 ./UpdateInputsx/UpdateInputsx.h\ 685 ./UpdateInputsx/UpdateInputsx.cpp\ 678 686 ./UpdateGeometryx/UpdateGeometryx.h\ 679 687 ./UpdateGeometryx/UpdateGeometryx.cpp\ -
issm/trunk/src/c/issm.h
r3529 r3599 40 40 #include "./SystemMatricesx/SystemMatricesx.h" 41 41 #include "./UpdateFromInputsx/UpdateFromInputsx.h" 42 #include "./UpdateInputsx/UpdateInputsx.h" 42 43 #include "./UpdateGeometryx/UpdateGeometryx.h" 43 44 #include "./UpdateVertexPositionsx/UpdateVertexPositionsx.h" -
issm/trunk/src/c/objects/Beam.cpp
r3591 r3599 236 236 +properties.MarshallSize() 237 237 +sizeof(int); //sizeof(int) for enum type 238 } 239 /*}}}*/ 240 /*FUNCTION Beam::UpdateInputs {{{1*/ 241 void Beam::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){ 242 ISSMERROR(" not supported yet!"); 238 243 } 239 244 /*}}}*/ -
issm/trunk/src/c/objects/Beam.h
r3591 r3599 64 64 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); 65 65 void UpdateFromInputs(void* inputs); 66 void UpdateInputs(double* solution, int analysis_type, int sub_analysis_type); 66 67 void GetDofList(int* doflist,int* pnumberofdofs); 67 68 void GetDofList1(int* doflist); -
issm/trunk/src/c/objects/Element.h
r3565 r3599 20 20 virtual void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type)=0; 21 21 virtual void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type)=0; 22 virtual int Enum()=0; 22 23 virtual void UpdateFromInputs(void* inputs)=0; 24 virtual void UpdateInputs(double* solution, int analysis_type, int sub_analysis_type)=0; 23 25 virtual void GetNodes(void** nodes)=0; 24 26 virtual void* GetMatPar()=0; … … 40 42 41 43 /*Implementation: */ 42 int Enum();43 44 44 45 }; -
issm/trunk/src/c/objects/Penta.cpp
r3597 r3599 241 241 Hook* tria_hnumpar=NULL; 242 242 ElementProperties* tria_properties=NULL; 243 DataSet* tria_inputs=NULL; 243 244 244 245 indices[0]=g0; … … 251 252 tria_hnumpar=this->hnumpar.Spawn(&zero,1); 252 253 tria_properties=(ElementProperties*)this->properties.Spawn(indices,3); 253 254 tria=new Tria(this->id,tria_hnodes,tria_hmatice,tria_hmatpar,tria_hnumpar,tria_properties); 254 tria_inputs=(DataSet*)this->inputs->Spawn(indices,3); 255 256 tria=new Tria(this->id,tria_hnodes,tria_hmatice,tria_hmatpar,tria_hnumpar,tria_properties,tria_inputs); 255 257 256 258 delete tria_hnodes; … … 259 261 delete tria_hnumpar; 260 262 delete tria_properties; 263 delete tria_inputs; 261 264 262 265 return tria; … … 332 335 ISSMERROR("not supported yet!"); 333 336 337 } 338 /*}}}*/ 339 /*FUNCTION Penta::UpdateInputs {{{1*/ 340 void Penta::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){ 341 ISSMERROR(" not supported yet!"); 334 342 } 335 343 /*}}}*/ -
issm/trunk/src/c/objects/Penta.h
r3582 r3599 37 37 38 38 ElementProperties properties; 39 DataSet* inputs; 39 40 40 41 public: … … 62 63 void UpdateFromDakota(void* inputs); 63 64 void UpdateFromInputs(void* inputs); 65 void UpdateInputs(double* solution, int analysis_type, int sub_analysis_type); 64 66 void SetClone(int* minranks); 65 67 -
issm/trunk/src/c/objects/Sing.cpp
r3591 r3599 286 286 } 287 287 288 } 289 /*}}}*/ 290 /*FUNCTION Sing::UpdateInputs {{{1*/ 291 void Sing::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){ 292 ISSMERROR(" not supported yet!"); 288 293 } 289 294 /*}}}*/ -
issm/trunk/src/c/objects/Sing.h
r3591 r3599 59 59 void CreatePVector(Vec pg, void* inputs, int analysis_type,int sub_analysis_type); 60 60 void UpdateFromInputs(void* inputs); 61 void UpdateInputs(double* solution, int analysis_type, int sub_analysis_type); 61 62 void GetDofList(int* doflist,int* pnumberofdofs); 62 63 void GetDofList1(int* doflist); -
issm/trunk/src/c/objects/Tria.cpp
r3596 r3599 10 10 11 11 #include "stdio.h" 12 #include "./TriaVertexInput.h" 12 13 #include "./Object.h" 13 14 #include "./Hook.h" … … 21 22 #include "../include/macros.h" 22 23 23 /*For debugging purposes: */24 #define ELID 141 //element for which to print debug statements25 #define RANK 2 //rank of cpu for which to print debug statements.26 //#define _DEBUGELEMENTS_27 //#define _DEBUGGAUSS_28 29 24 /*Object constructors and destructor*/ 30 25 /*FUNCTION Tria::Tria(){{{1*/ 31 26 Tria::Tria(){ 27 this->inputs=NULL; 32 28 return; 33 29 } … … 44 40 /*all the initialization has been done by the initializer, just fill in the id: */ 45 41 this->id=tria_id; 42 this->inputs=new DataSet(); 46 43 47 44 return; 48 45 } 49 46 /*}}}*/ 50 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Hook* hnumpar, ElementProperties* properties ) {{{1*/51 Tria::Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Hook* tria_hnumpar, ElementProperties* tria_properties ):47 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Hook* hnumpar, ElementProperties* properties,DataSet* tria_inputs) {{{1*/ 48 Tria::Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Hook* tria_hnumpar, ElementProperties* tria_properties,DataSet* tria_inputs): 52 49 hnodes(tria_hnodes), 53 50 hmatice(tria_hmatice), … … 59 56 /*all the initialization has been done by the initializer, just fill in the id: */ 60 57 this->id=tria_id; 58 if(tria_inputs){ 59 this->inputs=tria_inputs->Copy(); 60 } 61 else{ 62 this->inputs=new DataSet(); 63 } 61 64 62 65 return; … … 74 77 /*id: */ 75 78 this->id=i+1; 76 79 this->inputs=new DataSet(); 80 77 81 /*hooks: */ 78 82 //go recover node ids, needed to initialize the node hook. … … 103 107 /*FUNCTION Tria::~Tria(){{{1*/ 104 108 Tria::~Tria(){ 109 delete inputs; 105 110 return; 106 111 } … … 136 141 Object* Tria::copy() { 137 142 138 return new Tria(this->id,&this->hnodes,&this->hmatice,&this->hmatpar,&this->hnumpar,&this->properties );143 return new Tria(this->id,&this->hnodes,&this->hmatice,&this->hmatpar,&this->hnumpar,&this->properties,this->inputs); 139 144 140 145 } … … 160 165 hmatpar.Demarshall(&marshalled_dataset); 161 166 hnumpar.Demarshall(&marshalled_dataset); 162 167 163 168 /*demarshall properties: */ 164 169 properties.Demarshall(&marshalled_dataset); 170 171 inputs=DataSetDemarshallRaw(&marshalled_dataset); 165 172 166 173 /*return: */ … … 180 187 hnumpar.DeepEcho(); 181 188 properties.DeepEcho(); 189 printf("Element inputs\n"); 190 inputs->DeepEcho(); 182 191 183 192 return; … … 195 204 hnumpar.Echo(); 196 205 properties.Echo(); 206 printf("Element inputs\n"); 207 inputs->Echo(); 197 208 198 209 return; … … 204 215 char* marshalled_dataset=NULL; 205 216 int enum_type=0; 217 char* marshalled_inputs=NULL; 218 int marshalled_inputs_size; 206 219 207 220 /*recover marshalled_dataset: */ … … 225 238 /*Marshall properties: */ 226 239 properties.Marshall(&marshalled_dataset); 240 241 /*Marshall inputs: */ 242 marshalled_inputs_size=inputs->MarshallSize(); 243 marshalled_inputs=inputs->Marshall(); 244 memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char)); 245 marshalled_dataset+=marshalled_inputs_size; 227 246 228 247 *pmarshalled_dataset=marshalled_dataset; … … 239 258 +hnumpar.MarshallSize() 240 259 +properties.MarshallSize() 260 +inputs->MarshallSize() 241 261 +sizeof(int); //sizeof(int) for enum type 242 262 } 243 263 /*}}}*/ 264 265 /*Updates: */ 244 266 /*FUNCTION Tria::UpdateFromInputs {{{1*/ 245 267 void Tria::UpdateFromInputs(void* vinputs){ … … 357 379 } 358 380 /*}}}*/ 359 381 /*FUNCTION Tria::UpdateInputs {{{1*/ 382 void Tria::UpdateInputs(double* solution, int analysis_type, int sub_analysis_type){ 383 384 /*Just branch to the correct UpdateInputs generator, according to the type of analysis we are carrying out: */ 385 if (analysis_type==ControlAnalysisEnum){ 386 387 UpdateInputsDiagnosticHoriz( solution,analysis_type,sub_analysis_type); 388 } 389 else if (analysis_type==DiagnosticAnalysisEnum){ 390 391 if (sub_analysis_type==HorizAnalysisEnum){ 392 393 UpdateInputsDiagnosticHoriz( solution,analysis_type,sub_analysis_type); 394 } 395 else ISSMERROR("%s%i%s\n","sub_analysis: ",sub_analysis_type," not supported yet"); 396 397 } 398 else if (analysis_type==SlopecomputeAnalysisEnum){ 399 400 UpdateInputsSlopeCompute( solution,analysis_type,sub_analysis_type); 401 } 402 else if (analysis_type==PrognosticAnalysisEnum){ 403 404 UpdateInputsPrognostic( solution,analysis_type,sub_analysis_type); 405 } 406 else if (analysis_type==Prognostic2AnalysisEnum){ 407 408 UpdateInputsPrognostic2(solution,analysis_type,sub_analysis_type); 409 } 410 else if (analysis_type==BalancedthicknessAnalysisEnum){ 411 412 UpdateInputsBalancedthickness( solution,analysis_type,sub_analysis_type); 413 } 414 else if (analysis_type==Balancedthickness2AnalysisEnum){ 415 416 UpdateInputsBalancedthickness2( solution,analysis_type,sub_analysis_type); 417 } 418 else if (analysis_type==BalancedvelocitiesAnalysisEnum){ 419 420 UpdateInputsBalancedvelocities( solution,analysis_type,sub_analysis_type); 421 } 422 else{ 423 424 ISSMERROR("%s%i%s\n","analysis: ",analysis_type," not supported yet"); 425 } 426 } 427 /*}}}*/ 428 /*FUNCTION Tria::UpdateInputsDiagnosticHoriz {{{1*/ 429 void Tria::UpdateInputsDiagnosticHoriz(double* solution, int analysis_type, int sub_analysis_type){ 430 431 432 int i; 433 434 const int numvertices=3; 435 const int numdofpervertex=2; 436 const int numdof=numdofpervertex*numvertices; 437 438 int doflist[numdof]; 439 double values[numdof]; 440 double vx[numvertices]; 441 double vy[numvertices]; 442 443 int dummy; 444 445 /*Get dof list: */ 446 GetDofList(&doflist[0],&dummy); 447 448 /*Use the dof list to index into the solution vector: */ 449 for(i=0;i<numdof;i++){ 450 values[i]=solution[doflist[i]]; 451 } 452 453 /*Ok, we have vx and vy in values, fill in vx and vy arrays: */ 454 for(i=0;i<numvertices;i++){ 455 vx[i]=values[i*numdofpervertex+0]; 456 vy[i]=values[i*numdofpervertex+1]; 457 } 458 459 /*Add vx and vy as inputs to the tria element: */ 460 this->inputs->AddEinput(new TriaVertexInput(VxEnum,vx)); 461 this->inputs->AddEinput(new TriaVertexInput(VyEnum,vy)); 462 } 463 464 /*}}}*/ 465 /*FUNCTION Tria::UpdateInputsSlopeCompute {{{1*/ 466 void Tria::UpdateInputsSlopeCompute(double* solution, int analysis_type, int sub_analysis_type){ 467 ISSMERROR(" not supported yet!"); 468 } 469 /*}}}*/ 470 /*FUNCTION Tria::UpdateInputsPrognostic {{{1*/ 471 void Tria::UpdateInputsPrognostic(double* solution, int analysis_type, int sub_analysis_type){ 472 ISSMERROR(" not supported yet!"); 473 } 474 /*}}}*/ 475 /*FUNCTION Tria::UpdateInputsPrognostic2 {{{1*/ 476 void Tria::UpdateInputsPrognostic2(double* solution, int analysis_type, int sub_analysis_type){ 477 ISSMERROR(" not supported yet!"); 478 } 479 /*}}}*/ 480 /*FUNCTION Tria::UpdateInputsBalancedthickness {{{1*/ 481 void Tria::UpdateInputsBalancedthickness(double* solution, int analysis_type, int sub_analysis_type){ 482 ISSMERROR(" not supported yet!"); 483 } 484 /*}}}*/ 485 /*FUNCTION Tria::UpdateInputsBalancedthickness2 {{{1*/ 486 void Tria::UpdateInputsBalancedthickness2(double* solution, int analysis_type, int sub_analysis_type){ 487 ISSMERROR(" not supported yet!"); 488 } 489 /*}}}*/ 490 /*FUNCTION Tria::UpdateInputsBalancedvelocities {{{1*/ 491 void Tria::UpdateInputsBalancedvelocities(double* solution, int analysis_type, int sub_analysis_type){ 492 ISSMERROR(" not supported yet!"); 493 } 494 /*}}}*/ 495 496 360 497 /*Object functions*/ 361 498 /*FUNCTION Tria::ComputeBasalStress {{{1*/ … … 513 650 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 514 651 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 515 516 #ifdef _ISSM_DEBUG_517 for (i=0;i<num_gauss;i++){518 printf("Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(gauss_weights+i));519 }520 #endif521 652 522 653 /* Start looping on the number of gaussian points: */ … … 777 908 778 909 } 779 780 #ifdef _DEBUGELEMENTS_781 if(my_rank==RANK && id==ELID){782 printf(" B:\n");783 for(i=0;i<3;i++){784 for(j=0;j<numdof;j++){785 printf("%g ",B[i][j]);786 }787 printf("\n");788 }789 printf(" Bprime:\n");790 for(i=0;i<3;i++){791 for(j=0;j<numdof;j++){792 printf("%g ",Bprime[i][j]);793 }794 printf("\n");795 }796 }797 #endif798 910 } // for (ig=0; ig<num_gauss; ig++) 799 911 800 912 /*Add Ke_gg to global matrix Kgg: */ 801 913 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 802 803 #ifdef _DEBUGELEMENTS_804 if(my_rank==RANK && id==ELID){805 printf(" Ke_gg erms:\n");806 for( i=0; i<numdof; i++){807 for (j=0;j<numdof;j++){808 printf("%g ",Ke_gg[i][j]);809 }810 printf("\n");811 }812 printf(" Ke_gg row_indices:\n");813 for( i=0; i<numdof; i++){814 printf("%i ",doflist[i]);815 }816 817 }818 #endif819 914 820 915 cleanup_and_return: … … 1117 1212 } 1118 1213 1119 #ifdef _DEBUGELEMENTS_1120 if(my_rank==RANK && id==ELID){1121 printf(" B:\n");1122 for(i=0;i<3;i++){1123 for(j=0;j<numdof;j++){1124 printf("%g ",B[i][j]);1125 }1126 printf("\n");1127 }1128 printf(" Bprime:\n");1129 for(i=0;i<3;i++){1130 for(j=0;j<numdof;j++){1131 printf("%g ",Bprime[i][j]);1132 }1133 printf("\n");1134 }1135 }1136 #endif1137 1214 } // for (ig=0; ig<num_gauss; ig++) 1138 1215 … … 1140 1217 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 1141 1218 1142 #ifdef _DEBUGELEMENTS_1143 if(my_rank==RANK && id==ELID){1144 printf(" Ke_gg erms:\n");1145 for( i=0; i<numdof; i++){1146 for (j=0;j<numdof;j++){1147 printf("%g ",Ke_gg[i][j]);1148 }1149 printf("\n");1150 }1151 printf(" Ke_gg row_indices:\n");1152 for( i=0; i<numdof; i++){1153 printf("%i ",doflist[i]);1154 }1155 1156 }1157 #endif1158 1219 1159 1220 cleanup_and_return: … … 1417 1478 DeleteFriction(&friction); 1418 1479 1419 #ifdef _DEBUGELEMENTS_1420 if(my_rank==RANK && id==ELID){1421 printf(" alpha2_list [%g %g %g ]\n",alpha2_list[0],alpha2_list[1],alpha2_list[2]);1422 }1423 #endif1424 1425 1480 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 1426 1481 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 1427 1428 #ifdef _DEBUGELEMENTS_1429 if(my_rank==RANK && id==ELID){1430 printf(" gaussian points: \n");1431 for(i=0;i<num_gauss;i++){1432 printf(" %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);1433 }1434 }1435 #endif1436 1482 1437 1483 /* Start looping on the number of gaussian points: */ … … 1905 1951 } 1906 1952 1907 #ifdef _DEBUGELEMENTS_1908 if(my_rank==RANK && id==ELID){1909 printf(" B:\n");1910 for(i=0;i<3;i++){1911 for(j=0;j<numdof;j++){1912 printf("%g ",B[i][j]);1913 }1914 printf("\n");1915 }1916 printf(" Bprime:\n");1917 for(i=0;i<3;i++){1918 for(j=0;j<numdof;j++){1919 printf("%g ",Bprime[i][j]);1920 }1921 printf("\n");1922 }1923 }1924 #endif1925 1953 } // for (ig=0; ig<num_gauss; ig++) 1926 1954 … … 1928 1956 MatSetValues(Kgg,numdof,doflist,numdof,doflist,(const double*)Ke_gg,ADD_VALUES); 1929 1957 1930 #ifdef _DEBUGELEMENTS_1931 if(my_rank==RANK && id==ELID){1932 printf(" Ke_gg erms:\n");1933 for( i=0; i<numdof; i++){1934 for (j=0;j<numdof;j++){1935 printf("%g ",Ke_gg[i][j]);1936 }1937 printf("\n");1938 }1939 printf(" Ke_gg row_indices:\n");1940 for( i=0; i<numdof; i++){1941 printf("%i ",doflist[i]);1942 }1943 1944 }1945 #endif1946 1958 1947 1959 cleanup_and_return: … … 2851 2863 2852 2864 2853 #ifdef _DEBUGELEMENTS_2854 if(my_rank==RANK && id==ELID){2855 printf("gravity %g\n",matpar->GetG());2856 printf("rho_ice %g\n",matpar->GetRhoIce());2857 printf("thickness [%g,%g,%g]\n",h[0],h[1],h[2]);2858 printf("surface[%g,%g,%g]\n",s[0],s[1],s[2]);2859 printf("bed[%g,%g,%g]\n",b[0],b[1],b[2]);2860 printf("drag [%g,%g,%g]\n",k[0],k[1],k[2]);2861 }2862 #endif2863 2864 2865 2865 /* Get gaussian points and weights: */ 2866 2866 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); /*We need higher order because our load is order 2*/ 2867 2868 #ifdef _DEBUGELEMENTS_2869 if(my_rank==RANK && id==ELID){2870 printf(" gaussian points: \n");2871 for(i=0;i<num_gauss;i++){2872 printf(" %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);2873 }2874 }2875 #endif2876 2877 2878 2867 2879 2868 /* Start looping on the number of gaussian points: */ … … 2904 2893 /*Compute driving stress: */ 2905 2894 driving_stress_baseline=matpar->GetRhoIce()*matpar->GetG()*thickness; 2906 2907 2908 #ifdef _DEBUGELEMENTS_2909 if(my_rank==RANK && id==ELID){2910 printf(" gaussian %i\n",ig);2911 printf(" thickness %g\n",thickness);2912 printf(" slope(%g,%g)\n",slope[0],slope[1]);2913 printf(" Jdet %g\n",Jdet);2914 printf(" gaussweigth %g\n",gauss_weight);2915 printf(" l1l2l3 (%g,%g,%g)\n",l1l2l3[0],l1l2l3[1],l1l2l3[2]);2916 if(friction_type==1)printf(" plastic_stress(%g)\n",plastic_stress);2917 }2918 #endif2919 2895 2920 2896 /*Build pe_g_gaussian vector: */ … … 2938 2914 2939 2915 } //for (ig=0; ig<num_gauss; ig++) 2940 2941 #ifdef _DEBUGELEMENTS_2942 if(my_rank==RANK && id==ELID){2943 printf(" pe_g->terms\n",ig);2944 for( i=0; i<pe_g->nrows; i++){2945 printf("%g ",*(pe_g->terms+i));2946 }2947 printf("\n");2948 printf(" pe_g->row_indices\n",ig);2949 for( i=0; i<pe_g->nrows; i++){2950 printf("%i ",*(pe_g->row_indices+i));2951 }2952 }2953 #endif2954 2916 2955 2917 /*Add pe_g to global vector pg: */ … … 3787 3749 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 2); 3788 3750 3789 #ifdef _DEBUGELEMENTS_3790 if(my_rank==RANK && id==ELID){3791 printf(" gaussian points: \n");3792 for(i=0;i<num_gauss;i++){3793 printf(" %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);3794 }3795 }3796 #endif3797 3798 3751 /* Start looping on the number of gaussian points: */ 3799 3752 for (ig=0; ig<num_gauss; ig++){ … … 3806 3759 /* Get Jacobian determinant: */ 3807 3760 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss_l1l2l3); 3808 #ifdef _ISSM_DEBUG_3809 printf("Element id %i Jacobian determinant: %g\n",GetId(),Jdet);3810 #endif3811 3761 3812 3762 /* Get nodal functions value at gaussian point:*/ … … 3934 3884 GetNodalFunctionsDerivatives(&dh1dh3[0][0],xyz_list, gauss_l1l2l3); 3935 3885 3936 #ifdef _ISSM_DEBUG_3937 for (i=0;i<3;i++){3938 printf("Node %i dh/dx=%lf dh/dy=%lf \n",i,dh1dh3[0][i],dh1dh3[1][i]);3939 }3940 #endif3941 3942 3886 /*Build B: */ 3943 3887 for (i=0;i<numgrids;i++){ … … 3974 3918 /*Get dh1dh2dh3 in actual coordinate system: */ 3975 3919 GetNodalFunctions(&l1l2l3[0],gauss_l1l2l3); 3976 3977 #ifdef _ISSM_DEBUG_3978 for (i=0;i<3;i++){3979 printf("Node %i h=%lf \n",i,l1l2l3[i]);3980 }3981 #endif3982 3920 3983 3921 /*Build B_prog: */ … … 4558 4496 /* Get gaussian points and weights (make this a statically initialized list of points? fstd): */ 4559 4497 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 4); 4560 #ifdef _ISSM_DEBUG_4561 for (i=0;i<num_gauss;i++){4562 printf("Gauss coord %i: %lf %lf %lf Weight: %lf\n",i,*(first_gauss_area_coord+i),*(second_gauss_area_coord+i),*(third_gauss_area_coord+i),*(gauss_weights+i));4563 }4564 #endif4565 4498 4566 4499 /* Start looping on the number of gaussian points: */ … … 4592 4525 /* Get nodal functions value at gaussian point:*/ 4593 4526 GetNodalFunctions(l1l2l3, gauss_l1l2l3); 4594 #ifdef _ISSM_DEBUG_4595 printf("viscositycomp %g thickness %g dvx [%g %g] dvy [%g %g] dadjx [%g %g] dadjy[%g %g]\n",viscosity_complement,thickness,dvx[0],dvx[1],dvy[0],dvy[1],dadjx[0],dadjx[1],dadjy[0],dadjy[1]);4596 #endif4597 4527 4598 4528 /*Get nodal functions derivatives*/ … … 4745 4675 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 4); 4746 4676 4747 #ifdef _DEBUGELEMENTS_4748 if(my_rank==RANK && id==ELID){4749 printf(" gaussian points: \n");4750 for(i=0;i<num_gauss;i++){4751 printf(" %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);4752 }4753 }4754 #endif4755 4756 4677 /* Start looping on the number of gaussian points: */ 4757 4678 for (ig=0; ig<num_gauss; ig++){ … … 4799 4720 GetParameterValue(&alpha_complement, &alpha_complement_list[0],gauss_l1l2l3); 4800 4721 GetParameterValue(&drag, &this->properties.k[0],gauss_l1l2l3); 4801 #ifdef _ISSM_DEBUG_4802 printf("Drag complement: %20.20lf Drag: %20.20lf\n",alpha_complement,drag);4803 #endif4804 4722 4805 4723 /*recover lambda and mu: */ 4806 4724 GetParameterValue(&lambda, &adjx_list[0],gauss_l1l2l3); 4807 4725 GetParameterValue(&mu, &adjy_list[0],gauss_l1l2l3); 4808 #ifdef _ISSM_DEBUG_4809 printf("Adjoint vector %20.20lf %20.20lf\n",lambda,mu);4810 #endif4811 4726 4812 4727 /*recover vx and vy: */ 4813 4728 GetParameterValue(&vx, &vx_list[0],gauss_l1l2l3); 4814 4729 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3); 4815 #ifdef _ISSM_DEBUG_4816 printf("Velocity vector %20.20lf %20.20lf\n",vx,vy);4817 #endif4818 4730 4819 4731 /* Get Jacobian determinant: */ 4820 4732 GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss_l1l2l3); 4821 #ifdef _ISSM_DEBUG_4822 printf("Element id %i Jacobian determinant: %lf\n",GetId(),Jdet);4823 #endif4824 4733 4825 4734 /* Get nodal functions value at gaussian point:*/ … … 4979 4888 GaussTria( &num_gauss, &first_gauss_area_coord, &second_gauss_area_coord, &third_gauss_area_coord, &gauss_weights, 4); 4980 4889 4981 #ifdef _DEBUGELEMENTS_4982 if(my_rank==RANK && id==ELID){4983 printf(" gaussian points: \n");4984 for(i=0;i<num_gauss;i++){4985 printf(" %g %g %g : %g\n",first_gauss_area_coord[i],second_gauss_area_coord[i],third_gauss_area_coord[i],gauss_weights[i]);4986 }4987 }4988 #endif4989 4990 4890 /* Start looping on the number of gaussian points: */ 4991 4891 for (ig=0; ig<num_gauss; ig++){ … … 5033 4933 GetParameterValue(&alpha_complement, &alpha_complement_list[0],gauss_l1l2l3); 5034 4934 GetParameterValue(&drag, &this->properties.k[0],gauss_l1l2l3); 5035 #ifdef _ISSM_DEBUG_5036 printf("Drag complement: %20.20lf Drag: %20.20lf\n",alpha_complement,drag);5037 #endif5038 4935 5039 4936 /*recover lambda mu and xi: */ … … 5041 4938 GetParameterValue(&mu, &adjy_list[0],gauss_l1l2l3); 5042 4939 GetParameterValue(&xi, &adjz_list[0],gauss_l1l2l3); 5043 #ifdef _ISSM_DEBUG_5044 printf("Adjoint vector %20.20lf %20.20lf\n",lambda,mu);5045 #endif5046 4940 5047 4941 /*recover vx vy and vz: */ … … 5049 4943 GetParameterValue(&vy, &vy_list[0],gauss_l1l2l3); 5050 4944 GetParameterValue(&vz, &vz_list[0],gauss_l1l2l3); 5051 #ifdef _ISSM_DEBUG_5052 printf("Velocity vector %20.20lf %20.20lf\n",vx,vy);5053 4945 5054 4946 /*Get normal vecyor to the bed */ … … 5058 4950 bed_normal[1]=-surface_normal[1]; 5059 4951 bed_normal[2]=-surface_normal[2]; 5060 #endif5061 4952 5062 4953 /* Get Jacobian determinant: */ 5063 4954 GetJacobianDeterminant3d(&Jdet, &xyz_list[0][0],gauss_l1l2l3); 5064 #ifdef _ISSM_DEBUG_5065 printf("Element id %i Jacobian determinant: %lf\n",GetId(),Jdet);5066 #endif5067 4955 5068 4956 /* Get nodal functions value at gaussian point:*/ -
issm/trunk/src/c/objects/Tria.h
r3588 r3599 34 34 35 35 ElementProperties properties; 36 DataSet* inputs; 36 37 37 38 public: … … 40 41 Tria(); 41 42 Tria(int tria_id,int* tria_node_ids, int tria_matice_id, int tria_matpar_id, int tria_numpar_id, ElementProperties* tria_properties); 42 Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Hook* tria_hnumpar, ElementProperties* tria_properties );43 Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Hook* tria_hnumpar, ElementProperties* tria_properties,DataSet* tria_inputs); 43 44 Tria(int i, IoModel* iomodel); 44 45 ~Tria(); … … 57 58 int MyRank(); 58 59 void SetClone(int* minranks); 59 void UpdateFromDakota(void* inputs); 60 void UpdateFromInputs(void* inputs); 61 /*}}}*/ 60 /*}}}*/ 62 61 /*FUNCTION element numerical routines {{{1*/ 63 62 void CreateKMatrix(Mat Kgg,void* inputs,int analysis_type,int sub_analysis_type); … … 124 123 double GetArea(void); 125 124 double GetAreaCoordinate(double x, double y, int which_one); 125 126 /*updates:*/ 127 void UpdateFromDakota(void* inputs); 128 void UpdateFromInputs(void* inputs); 129 void UpdateInputs(double* solution, int analysis_type, int sub_analysis_type); 130 void UpdateInputsDiagnosticHoriz( double* solution,int analysis_type,int sub_analysis_type); 131 void UpdateInputsSlopeCompute( double* solution,int analysis_type,int sub_analysis_type); 132 void UpdateInputsPrognostic( double* solution,int analysis_type,int sub_analysis_type); 133 void UpdateInputsPrognostic2(double* solution,int analysis_type,int sub_analysis_type); 134 void UpdateInputsBalancedthickness( double* solution,int analysis_type,int sub_analysis_type); 135 void UpdateInputsBalancedthickness2( double* solution,int analysis_type,int sub_analysis_type); 136 void UpdateInputsBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type); 137 126 138 /*}}}*/ 127 139 -
issm/trunk/src/m/enum/AirEnum.m
r3589 r3599 7 7 % macro=AirEnum() 8 8 9 macro=7 6;9 macro=77; -
issm/trunk/src/m/enum/DofVecEnum.m
r3589 r3599 7 7 % macro=DofVecEnum() 8 8 9 macro=7 0;9 macro=71; -
issm/trunk/src/m/enum/GeographyEnum.m
r3589 r3599 7 7 % macro=GeographyEnum() 8 8 9 macro=7 1;9 macro=72; -
issm/trunk/src/m/enum/IceEnum.m
r3589 r3599 7 7 % macro=IceEnum() 8 8 9 macro=7 5;9 macro=76; -
issm/trunk/src/m/enum/IceSheetEnum.m
r3589 r3599 7 7 % macro=IceSheetEnum() 8 8 9 macro=7 2;9 macro=73; -
issm/trunk/src/m/enum/IceShelfEnum.m
r3589 r3599 7 7 % macro=IceShelfEnum() 8 8 9 macro=7 3;9 macro=74; -
issm/trunk/src/m/enum/MelangeEnum.m
r3589 r3599 7 7 % macro=MelangeEnum() 8 8 9 macro=7 7;9 macro=78; -
issm/trunk/src/m/enum/ParamEnum.m
r3589 r3599 7 7 % macro=ParamEnum() 8 8 9 macro=6 6;9 macro=67; -
issm/trunk/src/m/enum/ResultEnum.m
r3589 r3599 7 7 % macro=ResultEnum() 8 8 9 macro=6 7;9 macro=68; -
issm/trunk/src/m/enum/RgbEnum.m
r3589 r3599 7 7 % macro=RgbEnum() 8 8 9 macro=6 8;9 macro=69; -
issm/trunk/src/m/enum/SpcEnum.m
r3589 r3599 7 7 % macro=SpcEnum() 8 8 9 macro= 69;9 macro=70; -
issm/trunk/src/m/enum/WaterEnum.m
r3589 r3599 7 7 % macro=WaterEnum() 8 8 9 macro=7 4;9 macro=75; -
issm/trunk/src/m/solutions/jpl/diagnostic_core_nonlinear.m
r3484 r3599 50 50 %Solve 51 51 [soln(count).u_f]=Solver(K_ff,p_f,[],m.parameters); 52 52 53 53 %Merge back to g set 54 54 [soln(count).u_g]= Mergesolutionfromftog( soln(count).u_f, m.Gmn, m.ys, m.nodesets ); 55 56 %Update elements with new solution 57 [m.elements]=UpdateInputs(m.elements,m.nodes,m.vertices,loads,m.materials,m.parameters,soln(count).u_g,analysis_type,sub_analysis_type); 58 error; 55 59 56 60 %Deal with penalty loads -
issm/trunk/src/mex/Makefile.am
r3529 r3599 59 59 TriMeshRefine\ 60 60 UpdateFromInputs\ 61 UpdateInputs\ 61 62 UpdateVertexPositions\ 62 63 UpdateGeometry … … 247 248 UpdateFromInputs/UpdateFromInputs.h 248 249 250 UpdateInputs_SOURCES = UpdateInputs/UpdateInputs.cpp\ 251 UpdateInputs/UpdateInputs.h 252 249 253 UpdateGeometry_SOURCES = UpdateGeometry/UpdateGeometry.cpp\ 250 254 UpdateGeometry/UpdateGeometry.h
Note:
See TracChangeset
for help on using the changeset viewer.