Changeset 434
- Timestamp:
- 05/14/09 22:33:13 (16 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 6 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r387 r434 77 77 ./shared/Matrix/matrix.h\ 78 78 ./shared/Matrix/MatrixUtils.cpp\ 79 ./shared/Dofs/dofs.h\ 80 ./shared/Dofs/dofsetgen.cpp\ 79 81 ./shared/Numerics/numerics.h\ 80 82 ./shared/Numerics/GaussPoints.h\ … … 125 127 ./toolkits/petsc/patches/NewMat.cpp\ 126 128 ./toolkits/petsc/patches/VecFree.cpp\ 129 ./toolkits/petsc/patches/VecDuplicatePatch.cpp\ 127 130 ./toolkits/petsc/patches/KSPFree.cpp\ 128 131 ./toolkits/petsc/patches/ISFree.cpp\ … … 320 323 ./shared/Matrix/matrix.h\ 321 324 ./shared/Matrix/MatrixUtils.cpp\ 325 ./shared/Dofs/dofs.h\ 326 ./shared/Dofs/dofsetgen.cpp\ 322 327 ./shared/Numerics/numerics.h\ 323 328 ./shared/Numerics/GaussPoints.h\ … … 368 373 ./toolkits/petsc/patches/NewMat.cpp\ 369 374 ./toolkits/petsc/patches/VecFree.cpp\ 375 ./toolkits/petsc/patches/VecDuplicatePatch.cpp\ 370 376 ./toolkits/petsc/patches/KSPFree.cpp\ 371 377 ./toolkits/petsc/patches/ISFree.cpp\ … … 488 494 ./SlopeExtrudex/SlopeExtrudex.cpp\ 489 495 ./SlopeExtrudex/SlopeExtrudex.h\ 496 ./parallel/diagnostic_core.cpp\ 497 ./parallel/diagnostic_core_linear.cpp\ 490 498 ./parallel/diagnostic_core_nonlinear.cpp\ 491 499 ./parallel/CreateFemModel.cpp\ -
issm/trunk/src/c/parallel/GradJCompute.cpp
r61 r434 46 46 47 47 _printf_("%s\n"," recover solution for this stiffness and right hand side:"); 48 diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0, inputs,femmodel);48 diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,femmodel,inputs,analysis_type); 49 49 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 50 50 -
issm/trunk/src/c/parallel/OutputDiagnostic.cpp
r209 r434 11 11 #include "../objects/objects.h" 12 12 13 void OutputDiagnostic(Vec u_g,Vec p artition,char* filename,NodeSets* nodesets,char* analysis_type){13 void OutputDiagnostic(Vec u_g,Vec p_g, FemModel* femmodels,char* filename){ 14 14 15 15 int i; … … 19 19 FILE* fid=NULL; 20 20 21 /*intermediary: */ 22 FemModel femmodel; 23 NodeSets* nodesets=NULL; 24 Vec partition=NULL; 25 char* analysis_type="diagnostic"; 26 21 27 /* standard output: */ 22 28 Vec partition_shifted=NULL; 23 29 double* serial_partition=NULL; 24 int analysis_size;25 30 26 31 double* serial_ug=NULL; … … 28 33 int gsize; 29 34 int nods; 35 36 /*Recover diagnostic horiz femmodel: */ 37 femmodel=femmodels[0]; 38 partition=femmodel.partition; 39 nodesets=femmodel.nodesets; 30 40 31 41 /*serialize outputs: */ -
issm/trunk/src/c/parallel/control.cpp
r405 r434 25 25 char* outputfilename=NULL; 26 26 char* lockname=NULL; 27 char* analysis_type="control";27 int analysis_type; 28 28 29 29 /*Intermediary: */ … … 78 78 79 79 _printf_("read and create finite element model:\n"); 80 CreateFemModel(&femmodel,fid, analysis_type);80 CreateFemModel(&femmodel,fid,"control"); 81 81 82 82 /*Recover parameters used throughout the solution:*/ … … 92 92 femmodel.parameters->FindParam((void*)&p_g,"p_g"); 93 93 femmodel.parameters->FindParam((void*)&u_g_obs,"u_g_obs"); 94 femmodel.parameters->FindParam((void*)&analysis_type,"analysis_type"); 94 95 gsize=femmodel.nodes->NumberOfDofs(); 95 96 … … 155 156 inputs->Add(control_type,p_g,2,numberofnodes); 156 157 inputs->Add("fit",fit[n]); 157 diagnostic_core_nonlinear(&u_g,NULL,NULL, inputs,&femmodel);158 diagnostic_core_nonlinear(&u_g,NULL,NULL,&femmodel,inputs,analysis_type); 158 159 OutputControl(u_g,p_g,J,nsteps,femmodel.partition,outputfilename,femmodel.nodesets); 159 160 _printf_("%s\n"," done."); … … 174 175 UpdateFromInputsx(femmodel.elements,femmodel.nodes,femmodel.loads, femmodel.materials,inputs); 175 176 176 diagnostic_core_nonlinear(&u_g,NULL,NULL, inputs,&femmodel);177 diagnostic_core_nonlinear(&u_g,NULL,NULL,&femmodel,inputs,analysis_type); 177 178 178 179 _printf_("%s\n"," saving final results..."); -
issm/trunk/src/c/parallel/diagnostic.cpp
r358 r434 23 23 char* outputfilename=NULL; 24 24 char* lockname=NULL; 25 char* analysis_type="diagnostic_horiz";26 25 int numberofnodes; 27 26 28 /*Intermediary: */ 29 FemModel femmodel; 27 /*Fem models : */ 28 FemModel femmodels[5]; 29 30 30 Vec u_g=NULL; 31 Vec p_g=NULL; 31 32 ParameterInputs* inputs=NULL; 32 33 int waitonlock=0; … … 57 58 58 59 _printf_("read and create finite element model:\n"); 59 CreateFemModel(&femmodel,fid,analysis_type); 60 CreateFemModel(&femmodels[0],fid,"diagnostic_horiz"); 61 CreateFemModel(&femmodels[1],fid,"diagnostic_vert"); 62 CreateFemModel(&femmodels[2],fid,"diagnostic_stokes"); 63 CreateFemModel(&femmodels[3],fid,"diagnostic_hutter"); 64 CreateFemModel(&femmodels[4],fid,"slope_compute"); 60 65 61 66 _printf_("initialize inputs:\n"); 62 femmodel .parameters->FindParam((void*)&u_g_initial,"u_g");63 femmodel .parameters->FindParam((void*)&numberofnodes,"numberofnodes");67 femmodels[0].parameters->FindParam((void*)&u_g_initial,"u_g"); 68 femmodels[0].parameters->FindParam((void*)&numberofnodes,"numberofnodes"); 64 69 65 70 inputs=new ParameterInputs; 66 71 inputs->Add("velocity",u_g_initial,3,numberofnodes); 67 72 68 param=(Param*)femmodel.parameters->FindParamObject("u_g"); 69 femmodel.parameters->DeleteObject((Object*)param); 73 /*erase velocities: */ 74 param=(Param*)femmodels[0].parameters->FindParamObject("u_g"); 75 femmodels[0].parameters->DeleteObject((Object*)param); 70 76 71 77 _printf_("call computational core:\n"); 72 diagnostic_core _nonlinear(&u_g,NULL,NULL,inputs,&femmodel);78 diagnostic_core(&u_g,&p_g,femmodels,inputs); 73 79 74 80 _printf_("write results to disk:\n"); 75 OutputDiagnostic(u_g, femmodel.partition,outputfilename,femmodel.nodesets,analysis_type);81 OutputDiagnostic(u_g,p_g,&femmodels[0],outputfilename); 76 82 77 83 _printf_("write lock file:\n"); 78 femmodel .parameters->FindParam((void*)&waitonlock,"waitonlock");84 femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock"); 79 85 if (waitonlock){ 80 86 WriteLockFile(lockname); -
issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
r369 r434 11 11 #include "../issm.h" 12 12 13 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, ParameterInputs* inputs,FemModel* fem){13 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, FemModel* fem,ParameterInputs* inputs,int analysis_type){ 14 14 15 15 … … 38 38 /*parameters:*/ 39 39 int kflag,pflag,connectivity,numberofdofspernode; 40 int analysis_type;41 40 char* solver_string=NULL; 42 41 int debug=0; … … 55 54 fem->parameters->FindParam((void*)&yts,"yts"); 56 55 fem->parameters->FindParam((void*)&debug,"debug"); 57 fem->parameters->FindParam((void*)&analysis_type,"analysis_type");58 56 59 57 /*Copy loads for backup: */ -
issm/trunk/src/c/parallel/objectivefunctionC.cpp
r246 r434 75 75 76 76 //Run diagnostic with updated parameters. 77 diagnostic_core_nonlinear(&u_g,NULL,NULL, inputs,femmodel);77 diagnostic_core_nonlinear(&u_g,NULL,NULL,femmodel,inputs,analysis_type); 78 78 VecToMPISerial(&u_g_double,u_g); VecFree(&u_g); 79 79 -
issm/trunk/src/c/parallel/parallel.h
r46 r434 7 7 8 8 #include "../objects/objects.h" 9 #include "../io/io.h" 9 10 10 11 Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel,double* u_g_obs); 11 12 12 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, ParameterInputs* inputs,FemModel* fem); 13 void diagnostic_core(Vec* pug, Vec* ppg,FemModel* fems, ParameterInputs* inputs); 14 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, FemModel* fem,ParameterInputs* inputs,int analysis_type); 15 void diagnostic_core_linear(Vec* ppg,FemModel* fem,ParameterInputs* inputs,int analysis_type); 13 16 int cielothermal_core(Vec** pt_g,ParameterInputs* inputs,FemModel* femmodel); 14 17 … … 25 28 26 29 //int ParameterUpdate(double* search_vector,int step, WorkspaceParams* workspaceparams,BatchParams* batchparams); 27 void OutputDiagnostic(Vec u_g,Vec tpartition,char* filename,NodeSets* nodesets,char* analysis_type);30 void OutputDiagnostic(Vec u_g,Vec p_g, FemModel* femmodels,char* filename); 28 31 int OutputThermal(Vec* t_g,Vec* tpartition,char* filename,char* analysis_type); 29 32 void OutputControl(Vec u_g,double* p_g, double* J, int nsteps, Vec partition,char* filename,NodeSets* nodesets); -
issm/trunk/src/c/shared/shared.h
r1 r434 16 16 #include "Matrix/matrix.h" 17 17 #include "Numerics/numerics.h" 18 #include "Dofs/dofs.h" 18 19 19 20 -
issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
r1 r434 41 41 void MatMultPatch(Mat A,Vec X, Vec AX); 42 42 void MatToSerial(double** poutmatrix,Mat matrix); 43 void VecDuplicatePatch(Vec* output, Vec input); 43 44 44 45
Note:
See TracChangeset
for help on using the changeset viewer.