Changeset 3982
- Timestamp:
- 05/28/10 15:22:16 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 2 added
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r3947 r3982 26 26 //diagnostic 27 27 DiagnosticAnalysisEnum, 28 DiagnosticHorizAnalysisEnum, 29 DiagnosticVertAnalysisEnum, 30 DiagnosticHutterAnalysisEnum, 31 DiagnosticStokesAnalysisEnum, 28 32 HorizAnalysisEnum, 29 33 HutterAnalysisEnum, -
issm/trunk/src/c/Makefile.am
r3940 r3982 78 78 ./objects/Bamg/VertexOnVertex.cpp\ 79 79 ./objects/Element.h\ 80 ./objects/Model.h\81 ./objects/Model.cpp\82 80 ./objects/FemModel.h\ 83 81 ./objects/FemModel.cpp\ … … 533 531 ./objects/Bamg/VertexOnVertex.h\ 534 532 ./objects/Element.h\ 535 ./objects/Model.h\536 ./objects/Model.cpp\537 533 ./objects/FemModel.h\ 538 534 ./objects/FemModel.cpp\ -
issm/trunk/src/c/modules/ModelProcessorx/CreateDataSets.cpp
r3913 r3982 16 16 17 17 18 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 18 void CreateDataSets(DataSet** pelements,DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_type){ 19 20 /*First, partition elements and vertices. Nodes will partitioned on a per analysis_type basis: */ 21 VerticesPartitioning(&iomodel->my_elements, &iomodel->my_vertices, &iomodel->my_bordervertices, iomodel, iomodel_handle); 19 22 20 23 /*create parameters common to all solutions: */ 21 24 CreateParameters(pparameters,iomodel,iomodel_handle); 25 22 26 CreateParametersControl(pparameters,iomodel,iomodel_handle); 23 27 24 28 /*This is just a high level driver: */ 25 if (iomodel->analysis_type==DiagnosticAnalysisEnum){ 29 if (analysis_type==DiagnosticHorizAnalysisEnum){ 30 CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 31 CreateConstraintsDiagnosticHoriz(pconstraints,iomodel,iomodel_handle); 32 CreateLoadsDiagnosticHoriz(ploads,iomodel,iomodel_handle); 33 } 34 else if (analysis_type==DiagnosticVertAnalysisEnum){ 26 35 27 if (iomodel->sub_analysis_type==HorizAnalysisEnum){ 36 CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 37 CreateConstraintsDiagnosticVert(pconstraints,iomodel,iomodel_handle); 38 CreateLoadsDiagnosticVert(ploads,iomodel,iomodel_handle); 39 } 40 else if (analysis_type==DiagnosticStokesAnalysisEnum){ 28 41 29 CreateElementsNodesAndMaterialsDiagnosticHoriz(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 30 CreateConstraintsDiagnosticHoriz(pconstraints,iomodel,iomodel_handle); 31 CreateLoadsDiagnosticHoriz(ploads,iomodel,iomodel_handle); 32 } 33 else if (iomodel->sub_analysis_type==VertAnalysisEnum){ 34 35 CreateElementsNodesAndMaterialsDiagnosticVert(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 36 CreateConstraintsDiagnosticVert(pconstraints,iomodel,iomodel_handle); 37 CreateLoadsDiagnosticVert(ploads,iomodel,iomodel_handle); 38 } 39 else if (iomodel->sub_analysis_type==StokesAnalysisEnum){ 42 CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 43 CreateConstraintsDiagnosticStokes(pconstraints,iomodel,iomodel_handle); 44 CreateLoadsDiagnosticStokes(ploads,iomodel,iomodel_handle); 45 } 46 else if (analysis_type==DiagnosticHutterAnalysisEnum){ 40 47 41 CreateElementsNodesAndMaterialsDiagnosticStokes(pelements,pnodes, pvertices, pmaterials, iomodel,iomodel_handle); 42 CreateConstraintsDiagnosticStokes(pconstraints,iomodel,iomodel_handle); 43 CreateLoadsDiagnosticStokes(ploads,iomodel,iomodel_handle); 44 } 45 else if (iomodel->sub_analysis_type==HutterAnalysisEnum){ 46 47 CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 48 CreateConstraintsDiagnosticHutter(pconstraints,iomodel,iomodel_handle); 49 CreateLoadsDiagnosticHutter(ploads,iomodel,iomodel_handle); 50 } 48 CreateElementsNodesAndMaterialsDiagnosticHutter(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 49 CreateConstraintsDiagnosticHutter(pconstraints,iomodel,iomodel_handle); 50 CreateLoadsDiagnosticHutter(ploads,iomodel,iomodel_handle); 51 51 } 52 else if ( iomodel->analysis_type==SlopecomputeAnalysisEnum){52 else if (analysis_type==SlopecomputeAnalysisEnum){ 53 53 54 54 CreateElementsNodesAndMaterialsSlopeCompute(pelements,pnodes, pvertices,pmaterials, iomodel,iomodel_handle); … … 56 56 CreateLoadsSlopeCompute(ploads,iomodel,iomodel_handle); 57 57 } 58 else if ( iomodel->analysis_type==ThermalAnalysisEnum){58 else if (analysis_type==ThermalAnalysisEnum){ 59 59 60 60 CreateElementsNodesAndMaterialsThermal(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 61 61 CreateConstraintsThermal(pconstraints,iomodel,iomodel_handle); 62 62 CreateLoadsThermal(ploads,iomodel,iomodel_handle); 63 63 64 64 } 65 else if ( iomodel->analysis_type==MeltingAnalysisEnum){66 65 else if (analysis_type==MeltingAnalysisEnum){ 66 67 67 CreateElementsNodesAndMaterialsMelting(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); 68 68 CreateConstraintsMelting(pconstraints,iomodel,iomodel_handle); 69 69 CreateLoadsMelting(ploads,iomodel,iomodel_handle); 70 70 } 71 else if ( iomodel->analysis_type==PrognosticAnalysisEnum){71 else if (analysis_type==PrognosticAnalysisEnum){ 72 72 73 73 CreateElementsNodesAndMaterialsPrognostic(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); … … 75 75 CreateLoadsPrognostic(ploads,iomodel,iomodel_handle); 76 76 } 77 else if ( iomodel->analysis_type==Prognostic2AnalysisEnum){77 else if (analysis_type==Prognostic2AnalysisEnum){ 78 78 79 79 CreateElementsNodesAndMaterialsPrognostic2(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); … … 81 81 CreateLoadsPrognostic2(ploads,iomodel,iomodel_handle); 82 82 } 83 else if ( iomodel->analysis_type==BalancedthicknessAnalysisEnum){83 else if (analysis_type==BalancedthicknessAnalysisEnum){ 84 84 85 85 CreateElementsNodesAndMaterialsBalancedthickness(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); … … 87 87 CreateLoadsBalancedthickness(ploads,iomodel,iomodel_handle); 88 88 } 89 else if ( iomodel->analysis_type==Balancedthickness2AnalysisEnum){89 else if (analysis_type==Balancedthickness2AnalysisEnum){ 90 90 91 91 CreateElementsNodesAndMaterialsBalancedthickness2(pelements,pnodes,pvertices, pmaterials, iomodel,iomodel_handle); … … 93 93 CreateLoadsBalancedthickness2(ploads,iomodel,iomodel_handle); 94 94 } 95 else if ( iomodel->analysis_type==BalancedvelocitiesAnalysisEnum){95 else if (analysis_type==BalancedvelocitiesAnalysisEnum){ 96 96 97 97 CreateElementsNodesAndMaterialsBalancedvelocities(pelements,pnodes,pvertices,pmaterials, iomodel,iomodel_handle); … … 100 100 } 101 101 else{ 102 103 ISSMERROR("%s%i%s%i%s"," analysis_type: ",iomodel->analysis_type," sub_analysis_type: ",iomodel->sub_analysis_type," not supported yet!"); 102 ISSMERROR("%s%i%s%i%s"," analysis_type: ",analysis_type," analysis_type: ",analysis_type," not supported yet!"); 104 103 105 104 } -
issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h
r3931 r3982 15 15 16 16 /*Creation of fem datasets: general drivers*/ 17 void CreateDataSets(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle );17 void CreateDataSets(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle,int analysis_type); 18 18 void CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 19 19 … … 87 87 88 88 /*partitioning: */ 89 void Partitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 89 void VerticesPartitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 90 void NodesPartitioning(bool** pmy_nodes,bool* my_elements, bool* my_vertices, bool* my_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle,bool continuous); 90 91 91 92 /*Conectivity*/ -
issm/trunk/src/c/objects/FemModel.cpp
r3922 r3982 2 2 * \brief: implementation of the FemModel object 3 3 */ 4 4 5 5 6 #ifdef HAVE_CONFIG_H … … 10 11 11 12 #include "stdio.h" 12 #include "../shared/shared.h" 13 #include "../DataSet/DataSet.h" 14 #include "../modules/FemModelProcessorx/FemModelProcessorx.h" 15 #include "./objects.h" 13 16 #include "../include/include.h" 14 #include "./objects.h" 17 #include "../EnumDefinitions/EnumDefinitions.h" 18 #include "../modules/modules.h" 15 19 16 /*constructors/destructors*/17 /*FUNCTION FemModel::FemModel {{{1*/18 FemModel::FemModel(){19 20 20 elements=NULL; 21 nodes=NULL; 22 vertices=NULL; 23 constraints=NULL; 24 loads=NULL; 25 materials=NULL; 26 parameters=NULL; 21 /*Object constructors and destructor*/ 22 /*FUNCTION FemModel::constructor {{{1*/ 23 FemModel::FemModel(int in_nummodels){ 27 24 28 partition=NULL; 29 tpartition=NULL; 30 yg=NULL; 31 Rmg=NULL; 32 nodesets=NULL; 33 ys=NULL; 34 ys0=NULL; 35 Gmn=NULL; 25 nummodels=in_nummodels; 26 current_analysis_type=-1; 27 28 /*Dynamically allocate whatever is a list of length nummodels: */ 29 analysis_type_list=(int*)xmalloc(nummodels*sizeof(int)); 30 for(i=0;i<nummodels;i++)analysis_type_list[i]=NoneAnalysisEnum; 31 32 Rmg=(Mat*)xmalloc(nummodels*sizeof(Mat)); 33 for(i=0;i<nummodels;i++)Rmg[i]=NULL; 34 35 Gmn=(Mat*)xmalloc(nummodels*sizeof(Mat)); 36 for(i=0;i<nummodels;i++)Gmn[i]=NULL; 37 38 nodesets=(NodeSets**)xmalloc(nummodels*sizeof(NodeSet*)); 39 for(i=0;i<nummodels;i++)nodesets[i]=NULL; 40 41 yg=(Vec*)xmalloc(nummodels*sizeof(Vec)); 42 for(i=0;i<nummodels;i++)yg[i]=NULL; 43 44 ys=(Vec*)xmalloc(nummodels*sizeof(Vec)); 45 for(i=0;i<nummodels;i++)ys[i]=NULL; 36 46 37 47 } 38 /*}}}*/ 39 /*FUNCTION FemModel::FemModel {{{1*/ 40 FemModel::FemModel(DataSet* femmodel_elements,DataSet* femmodel_nodes,DataSet* femmodel_vertices, DataSet* femmodel_constraints,DataSet* femmodel_loads, 41 DataSet* femmodel_materials,Parameters* femmodel_parameters, DofVec* femmodel_partition,DofVec* femmodel_tpartition,DofVec* femmodel_yg, 42 Mat femmodel_Rmg,Mat femmodel_Gmn,NodeSets* femmodel_nodesets,Vec femmodel_ys,Vec femmodel_ys0){ 43 44 45 elements=femmodel_elements; 46 nodes=femmodel_nodes; 47 vertices=femmodel_vertices; 48 constraints=femmodel_constraints; 49 loads=femmodel_loads; 50 materials=femmodel_materials; 51 parameters=femmodel_parameters; 52 53 partition=femmodel_partition; 54 tpartition=femmodel_tpartition; 55 yg=femmodel_yg; 56 Rmg=femmodel_Rmg; 57 nodesets=femmodel_nodesets; 58 ys=femmodel_ys; 59 ys0=femmodel_ys0; 60 Gmn=femmodel_Gmn; 61 62 } 63 /*}}}*/ 64 /*FUNCTION FemModel::~FemModel {{{1*/ 48 /*}}}1*/ 49 /*FUNCTION FemModel::destructor {{{1*/ 65 50 FemModel::~FemModel(){ 66 51 52 int i; 53 54 /*Delete all the datasets: */ 55 xfree((void**)&analysis_type_list); 67 56 delete elements; 68 57 delete nodes; 69 58 delete vertices; 59 delete constraints; 70 60 delete loads; 71 delete constraints;72 61 delete materials; 73 62 delete parameters; 74 75 63 delete partition; 76 64 delete tpartition; 65 66 for(i=0;i<nummodels;i++){ 67 Mat temp_Rmg=Rmg[i]; 68 MatFree(&temp_Rmg); 69 Mat temp_Gmn=Gmn[i]; 70 MatFree(&temp_Gmn); 71 NodeSet* temp_nodesets=nodesets[i]; 72 delete nodesets; 73 Vec temp_yg=yg[i]; 74 VecFree(&temp_yg); 75 Vec temp_ys=ys[i]; 76 VecFree(&temp_ys); 77 } 78 79 /*Delete dynamically allocated arrays: */ 80 delete Rmg; 81 delete Gmn; 82 delete nodesets; 77 83 delete yg; 78 MatFree(&Rmg); 79 delete nodesets; 80 VecFree(&ys); 81 VecFree(&ys0); 82 MatFree(&Gmn); 84 delete ys; 83 85 84 86 } 85 /*}}}*/ 87 /*}}}1*/ 88 89 /*Object management*/ 90 /*FUNCTION FemModel::Echo {{{1*/ 91 92 void FemModel::Echo(void){ 93 94 printf("FemModel echo: \n"); 95 printf(" number of fem models: %i\n",nummodels); 96 printf(" analysis_type_list: \n"); 97 for(i=0;i<nummodels;i++)printf(" %i: %s\n",i,EnumAsString(analysis_type_list[i])); 98 printf(" current analysis_type: \n"); 99 printf(" %i: %s\n",i,EnumAsString(analysis_type_list[current_analysis_type])); 100 101 102 } 103 /*}}}1*/ 104 105 /*Numerics: */ 106 /*FUNCTION FemModel::AddAnalysis(ConstDataHandle FEMMODEL, int analysis_type) {{{1*/ 107 void FemModel::AddAnalysis(ConstDataHandle IOMODEL, int analysis_type){ 108 109 110 int i; //practical counter 111 112 /*Set counter: */ 113 if (current_analysis_type==-1)current_analysis_type=0; 114 else current_analysis_type++; 115 116 i=current_analysis_type; 117 118 /*intermediary: */ 119 IoFemModel* iomodel=NULL; 120 121 _printf_(" fill model with matlab workspace data\n"); 122 iomodel=new IoFemModel(IOMODEL); 123 124 _printf_(" create datasets:\n"); 125 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,¶meters,iomodel,IOMODEL,analysis_type); 126 127 _printf_(" create degrees of freedom: \n"); 128 Dofx( &partition,&tpartition,elements,nodes, vertices,parameters); 129 130 _printf_(" create single point constraints: \n"); 131 SpcNodesx( &yg[i], nodes,constraints); 132 133 _printf_(" create rigid body constraints:\n"); 134 MpcNodesx( &Rmg[i], nodes,constraints); 135 136 _printf_(" create node sets:\n"); 137 BuildNodeSetsx(&nodesets[i], nodes); 138 139 _printf_(" reducing single point constraints vector:\n"); 140 Reducevectorgtosx(&ys[i], yg[i]->vector,nodesets[i]); 141 142 _printf_(" normalizing rigid body constraints matrix:\n"); 143 NormalizeConstraintsx(&Gmn[i], Rmg[i],nodesets[i]); 144 145 _printf_(" configuring element and loads:\n"); 146 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 147 148 _printf_(" process parameters:\n"); 149 ProcessParamsx( parameters, partition->vector); 150 151 _printf_(" free ressources:\n"); 152 delete iomodel; 153 } 154 /*}}}1*/ 155 /*FUNCTION FemModel::GetCurrentAnalysis {{{1*/ 156 FemFemModel* FemModel::GetCurrentAnalysis(){ 157 return analysis_type_list[current_analysis_type]; 158 } 159 /*}}}1*/ 160 /*FUNCTION FemModel::SetCurrentAnalysis {{{1*/ 161 void FemModel::SetCurrentAnalysis(int analysis_type){ 162 int found=-1; 163 for(i=0;i<nummodels;i++){ 164 if (analysis_type_list[i]==analysis_type){ 165 found=i; 166 break; 167 } 168 } 169 if(found)current_analysis_type=i; 170 else ISSMERRR("%s%s%s"," could not find analysis_type ",EnumAsString(analysis_type) " in list of FemModel analyses"); 171 } 172 /*}}}1*/ 173 -
issm/trunk/src/c/objects/FemModel.h
r3922 r3982 16 16 /*}}}*/ 17 17 18 18 19 class FemModel { 19 20 … … 22 23 public: 23 24 24 DataSet* elements; 25 DataSet* nodes; 26 DataSet* vertices; 27 DataSet* constraints; 28 DataSet* loads; 29 DataSet* materials; 30 Parameters* parameters; 25 int nummodels; 26 int* analysis_type_list; //list of analyses this femmodel is capable of. 27 int current_analysis_type; //counter to the current analysis being carried out 28 29 DataSet* elements; //elements (one set for all analyses) 30 DataSet* nodes; //one set of nodes 31 DataSet* vertices; //one set of vertices 32 DataSet* constraints; //one set of constraints. each constraint knows which analysis_type it handles 33 DataSet* loads; //one set of constraints. each constraint knows which analysis_type it handles 34 DataSet* materials; //one set of materials, for each element 35 Parameters* parameters; //one set of parameters, independent of the analysis_type 31 36 32 DofVec* partition; 37 DofVec* partition; //one partitioning for all elements 33 38 DofVec* tpartition; 34 DofVec* yg; 39 40 //multiple sets of vectors for each analysis_type 41 Mat* Rmg; //rigid body motions matrices 42 Mat* Gmn; 43 NodeSets** nodesets; //boundary conditions dof sets 44 Vec* yg; //boundary conditions in global g-set 45 Vec* ys; //boundary conditions, in reduced s-set 35 46 36 Mat Rmg; 37 NodeSets* nodesets; 38 Vec ys; 39 Vec ys0; 40 Mat Gmn; 47 /*constructors, destructors: */ 48 FemModel(int nummodels); 49 ~FemModel(); 41 50 42 FemModel(); 43 ~FemModel(); 44 FemModel(DataSet* elements,DataSet* nodes,DataSet* vertices, DataSet* constraints,DataSet* loads,DataSet* materials,Parameters* parameters, 45 DofVec* partition,DofVec* tpartition,DofVec* yg,Mat Rmg,Mat Gmn,NodeSets* nodesets,Vec ys,Vec ys0); 51 /*Methods: */ 52 Echo(); 53 54 /*Fem: */ 55 void AddAnalysis(ConstDataHandle IOMODEL, int analysis_type); 56 int SetCurrentAnalysis(int analysis_type); 57 void GetCurrentAnalysis(void); 46 58 47 59 }; -
issm/trunk/src/c/objects/IoModel.cpp
r3931 r3982 130 130 IoModelFetchData(&this->inputfilename,iomodel_handle,"inputfilename"); 131 131 IoModelFetchData(&this->outputfilename,iomodel_handle,"outputfilename"); 132 IoModelFetchData(&this->analysis_type,iomodel_handle,"analysis_type");133 IoModelFetchData(&this->sub_analysis_type,iomodel_handle,"sub_analysis_type");134 132 IoModelFetchData(&this->qmu_analysis,iomodel_handle,"qmu_analysis"); 135 133 IoModelFetchData(&this->control_analysis,iomodel_handle,"control_analysis"); … … 232 230 this->repository=NULL; 233 231 this->meshtype=NULL; 234 this->analysis_type=0;235 this->sub_analysis_type=0;236 232 this->qmu_analysis=0; 237 233 this->control_analysis=0; -
issm/trunk/src/c/objects/IoModel.h
r3931 r3982 20 20 char* repository; 21 21 char* meshtype; 22 int analysis_type;23 int sub_analysis_type;24 22 int qmu_analysis; 25 23 int control_analysis; -
issm/trunk/src/c/solutions/diagnostic.cpp
r3938 r3982 27 27 bool control_analysis=false; 28 28 29 /* Model: */30 Model*model=NULL;29 /*FemModel: */ 30 FemModel* femmodel=NULL; 31 31 32 32 /*Results: */ … … 59 59 lockname=argv[4]; 60 60 61 /*Initialize model structure: */61 /*Initialize femmodel structure: */ 62 62 MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime(); 63 model=new Model();63 femmodel=new FemModel(5); 64 64 65 65 /*Open handle to data on disk: */ 66 66 fid=pfopen(inputfilename,"rb"); 67 67 68 _printf_("read and create finite element model:\n");69 _printf_("\n reading diagnostic horiz model data:\n");70 model->AddFormulation(fid,DiagnosticAnalysisEnum,HorizAnalysisEnum);68 _printf_("read and create finite element femmodel:\n"); 69 _printf_("\n reading diagnostic horiz femmodel data:\n"); 70 femmodel->AddAnalysis(fid,DiagnosticHorizAnalysisEnum); 71 71 72 _printf_("\n reading diagnostic vert model data:\n");73 model->AddFormulation(fid,DiagnosticAnalysisEnum,VertAnalysisEnum);72 _printf_("\n reading diagnostic vert femmodel data:\n"); 73 femmodel->AddAnalysis(fid,DiagnosticVertAnalysisEnum); 74 74 75 _printf_("\n reading diagnostic stokes model data:\n");76 model->AddFormulation(fid,DiagnosticAnalysisEnum,StokesAnalysisEnum);75 _printf_("\n reading diagnostic stokes femmodel data:\n"); 76 femmodel->AddAnalysis(fid,DiagnosticStokesAnalysisEnum); 77 77 78 _printf_("\n reading diagnostic hutter model data:\n");79 model->AddFormulation(fid,DiagnosticAnalysisEnum,HutterAnalysisEnum);78 _printf_("\n reading diagnostic hutter femmodel data:\n"); 79 femmodel->AddAnalysis(fid,DiagnosticHutterAnalysisEnum); 80 80 81 _printf_("\n reading surface and bed slope computation model data:\n");82 model->AddFormulation(fid,SlopecomputeAnalysisEnum);81 _printf_("\n reading surface and bed slope computation femmodel data:\n"); 82 femmodel->AddAnalysis(fid,SlopecomputeAnalysisEnum); 83 83 84 84 /*get parameters: */ 85 model->FindParam(&qmu_analysis,QmuAnalysisEnum);86 model->FindParam(&control_analysis,ControlAnalysisEnum);87 model->FindParam(&waitonlock,WaitOnLockEnum);85 femmodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum); 86 femmodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum); 87 femmodel->parameters->FindParam(&waitonlock,WaitOnLockEnum); 88 88 89 89 MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime(); … … 95 95 _printf_("call computational core:\n"); 96 96 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 97 results=diagnostic_core( model);97 results=diagnostic_core(femmodel); 98 98 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 99 99 … … 103 103 _printf_("call computational core:\n"); 104 104 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 105 results=control_core( model);105 results=control_core(femmodel); 106 106 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 107 107 … … 117 117 #ifdef _HAVE_DAKOTA_ 118 118 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 119 Qmux( model,DiagnosticAnalysisEnum,NoneAnalysisEnum);119 Qmux(femmodel,DiagnosticAnalysisEnum,NoneAnalysisEnum); 120 120 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 121 121 #else … … 130 130 131 131 /*Free ressources */ 132 delete model;132 delete femmodel; 133 133 delete results; 134 134 135 135 /*Get finish time and close*/ 136 136 MPI_Barrier(MPI_COMM_WORLD); finish = MPI_Wtime( ); 137 _printf_("\n %-34s %f seconds \n"," Model initialization elapsed time:",finish_init-start_init);137 _printf_("\n %-34s %f seconds \n","FemModel initialization elapsed time:",finish_init-start_init); 138 138 _printf_(" %-34s %f seconds \n","Core solution elapsed time:",finish_core-start_core); 139 139 _printf_("\n %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600),int(int(finish-start)%3600/60),int(finish-start)%60); -
issm/trunk/src/c/solutions/diagnostic_core.cpp
r3959 r3982 11 11 #include "../include/include.h" 12 12 13 Results* diagnostic_core( Model*model){13 Results* diagnostic_core(FemModel* femmodel){ 14 14 15 15 extern int my_rank; 16 16 int dummy; 17 18 /*fem models: */19 FemModel* fem_dh=NULL;20 FemModel* fem_dv=NULL;21 FemModel* fem_dhu=NULL;22 FemModel* fem_ds=NULL;23 FemModel* fem_sl=NULL;24 17 25 18 /*output: */ … … 70 63 results=new Results(); 71 64 72 //first recover parameters common to all solutions 73 model->FindParam(&verbose,VerboseEnum); 74 model->FindParam(&dim,DimEnum); 75 model->FindParam(&ishutter,IsHutterEnum); 76 model->FindParam(&ismacayealpattyn,IsMacAyealPattynEnum); 77 model->FindParam(&numberofnodes,NumberOfNodesEnum); 78 model->FindParam(&isstokes,IsStokesEnum); 79 model->FindParam(&stokesreconditioning,StokesReconditioningEnum); 80 model->FindParam(&numrifts,NumRiftsEnum); 81 model->FindParam(&qmu_analysis,QmuAnalysisEnum); 82 83 /*recover fem models: */ 84 fem_dh=model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum); 85 fem_dv=model->GetFormulation(DiagnosticAnalysisEnum,VertAnalysisEnum); 86 fem_ds=model->GetFormulation(DiagnosticAnalysisEnum,StokesAnalysisEnum); 87 fem_dhu=model->GetFormulation(DiagnosticAnalysisEnum,HutterAnalysisEnum); 88 fem_sl=model->GetFormulation(SlopecomputeAnalysisEnum); 65 //first recover parameters needed to drive the solution 66 femmodel->parameters->FindParam(&verbose,VerboseEnum); 67 femmodel->parameters->FindParam(&dim,DimEnum); 68 femmodel->parameters->FindParam(&ishutter,IsHutterEnum); 69 femmodel->parameters->FindParam(&ismacayealpattyn,IsMacAyealPattynEnum); 70 femmodel->parameters->FindParam(&numberofnodes,NumberOfNodesEnum); 71 femmodel->parameters->FindParam(&isstokes,IsStokesEnum); 72 femmodel->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 73 femmodel->parameters->FindParam(&numrifts,NumRiftsEnum); 74 femmodel->parameters->FindParam(&qmu_analysis,QmuAnalysisEnum); 89 75 90 76 //specific parameters for specific models 91 fem _dh->parameters->FindParam(&numberofdofspernode_dh,NumberOfDofsPerNodeEnum);92 fem _sl->parameters->FindParam(&numberofdofspernode_sl,NumberOfDofsPerNodeEnum);93 fem _ds->parameters->FindParam(&numberofdofspernode_ds,NumberOfDofsPerNodeEnum);77 femmodel->parameters->FindParam(&numberofdofspernode_dh,NumberOfDofsPerNodeEnum); 78 femmodel->parameters->FindParam(&numberofdofspernode_sl,NumberOfDofsPerNodeEnum); 79 femmodel->parameters->FindParam(&numberofdofspernode_ds,NumberOfDofsPerNodeEnum); 94 80 95 81 //for qmu analysis, be sure the velocity input we are starting from is the one in the parameters: */ 96 82 if(qmu_analysis){ 97 fem _dh->parameters->FindParam(&vx,&dummy,VxEnum);model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);98 fem _dh->parameters->FindParam(&vy,&dummy,VyEnum);model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);99 fem _dh->parameters->FindParam(&vz,&dummy,VzEnum);model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);83 femmodel->parameters->FindParam(&vx,&dummy,VxEnum); femmodel->UpdateInputsFromVector(vx,VxEnum,VertexEnum); 84 femmodel->parameters->FindParam(&vy,&dummy,VyEnum); femmodel->UpdateInputsFromVector(vy,VyEnum,VertexEnum); 85 femmodel->parameters->FindParam(&vz,&dummy,VzEnum); femmodel->UpdateInputsFromVector(vz,VzEnum,VertexEnum); 100 86 } 101 87 102 88 /*Compute slopes: */ 103 slope_core(&surfaceslopex,&surfaceslopey,fem _sl,SurfaceAnalysisEnum);104 slope_core(&bedslopex,&bedslopey,fem _sl,BedAnalysisEnum);89 slope_core(&surfaceslopex,&surfaceslopey,femmodel,SurfaceAnalysisEnum); 90 slope_core(&bedslopex,&bedslopey,femmodel,BedAnalysisEnum); 105 91 106 92 /*Update: */ -
issm/trunk/src/c/solutions/slope_core.cpp
r3913 r3982 9 9 #include "../modules/modules.h" 10 10 11 void slope_core(Vec* pslopex,Vec* pslopey,FemModel* fem , int AnalysisEnum){11 void slope_core(Vec* pslopex,Vec* pslopey,FemModel* femmodel, int AnalysisEnum){ 12 12 13 13 /*parameters: */ … … 24 24 25 25 /*Recover some parameters: */ 26 fem ->parameters->FindParam(&verbose,VerboseEnum);27 fem ->parameters->FindParam(&dim,DimEnum);28 fem ->parameters->FindParam(&isstokes,IsStokesEnum);29 fem ->parameters->FindParam(&ishutter,IsHutterEnum);26 femmodel->parameters->FindParam(&verbose,VerboseEnum); 27 femmodel->parameters->FindParam(&dim,DimEnum); 28 femmodel->parameters->FindParam(&isstokes,IsStokesEnum); 29 femmodel->parameters->FindParam(&ishutter,IsHutterEnum); 30 30 31 31 if(verbose)_printf_("%s\n","computing slope (x and y derivatives)..."); … … 59 59 60 60 /*Call on core computations: */ 61 diagnostic_core_linear(&slopex,fem ,SlopecomputeAnalysisEnum,xanalysis);62 diagnostic_core_linear(&slopey,fem ,SlopecomputeAnalysisEnum,yanalysis);61 diagnostic_core_linear(&slopex,femmodel,SlopecomputeAnalysisEnum,xanalysis); 62 diagnostic_core_linear(&slopey,femmodel,SlopecomputeAnalysisEnum,yanalysis); 63 63 64 64 /*extrude if we are in 3D: */ 65 65 if (dim==3){ 66 66 if(verbose)_printf_("%s\n","extruding slopes in 3d..."); 67 FieldExtrudex( slopex, fem ->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,"slopex",0);68 FieldExtrudex( slopey, fem ->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,"slopey",0);67 FieldExtrudex( slopex, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"slopex",0); 68 FieldExtrudex( slopey, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"slopey",0); 69 69 } 70 70
Note:
See TracChangeset
for help on using the changeset viewer.