Changeset 4063
- Timestamp:
- 06/21/10 10:55:50 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 5 added
- 1 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Makefile.am
r4057 r4063 318 318 ./EnumDefinitions/StringAsEnum.cpp\ 319 319 ./modules/ModelProcessorx/ModelProcessorx.h\ 320 ./modules/ModelProcessorx/ModelProcessorx.cpp\ 320 321 ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\ 321 322 ./modules/ModelProcessorx/NodesPartitioning.cpp\ … … 405 406 ./modules/MinVzx/MinVzx.h\ 406 407 ./modules/MinVzx/MinVzx.cpp\ 407 ./modules/ DuplicateInputx/DuplicateInputx.h\408 ./modules/ DuplicateInputx/DuplicateInputx.cpp\408 ./modules/InputDuplicatex/InputDuplicatex.h\ 409 ./modules/InputDuplicatex/InputDuplicatex.cpp\ 409 410 ./modules/ScaleInputx/ScaleInputx.h\ 410 411 ./modules/ScaleInputx/ScaleInputx.cpp\ … … 836 837 ./EnumDefinitions/StringAsEnum.cpp\ 837 838 ./modules/ModelProcessorx/ModelProcessorx.h\ 839 ./modules/ModelProcessorx/ModelProcessorx.cpp\ 838 840 ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\ 839 841 ./modules/ModelProcessorx/NodesPartitioning.cpp\ … … 925 927 ./modules/MinVzx/MinVzx.h\ 926 928 ./modules/MinVzx/MinVzx.cpp\ 927 ./modules/ DuplicateInputx/DuplicateInputx.h\928 ./modules/ DuplicateInputx/DuplicateInputx.cpp\929 ./modules/InputDuplicatex/InputDuplicatex.h\ 930 ./modules/InputDuplicatex/InputDuplicatex.cpp\ 929 931 ./modules/ScaleInputx/ScaleInputx.h\ 930 932 ./modules/ScaleInputx/ScaleInputx.cpp\ -
issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h
r4034 r4063 12 12 class Parameters; 13 13 #include "../../io/io.h" 14 15 void ModelProcessorx(DataSet** pelements, DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads, Parameters** pparameters, ConstDataHandle iomodel_handle,int solution_type,int nummodels, int* analysis_type_list); 14 16 15 17 /*Creation of fem datasets: general drivers*/ -
issm/trunk/src/c/modules/VerticesDofx/VerticesDofx.cpp
r4002 r4063 25 25 DofVec* tpartition=NULL; 26 26 27 if(*ppartition)return; 27 if(*ppartition)return; //do not create partition vector twice! we only have on set of vertices 28 28 29 29 /*Initialize dofvecs: */ -
issm/trunk/src/c/modules/modules.h
r4055 r4063 78 78 #include "./MaxVzx/MaxVzx.h" 79 79 #include "./MaxAbsVzx/MaxAbsVzx.h" 80 #include "./ DuplicateInputx/DuplicateInputx.h"80 #include "./InputDuplicatex/InputDuplicatex.h" 81 81 #include "./ScaleInputx/ScaleInputx.h" 82 82 #include "./AXPYInputx/AXPYInputx.h" -
issm/trunk/src/c/objects/Elements/Beam.cpp
r4057 r4063 980 980 } 981 981 /*}}}*/ 982 /*FUNCTION Beam:: DuplicateInput(int original_enum,int new_enum){{{1*/983 void Beam:: DuplicateInput(int original_enum,int new_enum){982 /*FUNCTION Beam::InputDuplicate(int original_enum,int new_enum){{{1*/ 983 void Beam::InputDuplicate(int original_enum,int new_enum){ 984 984 985 985 Input* original=NULL; -
issm/trunk/src/c/objects/Elements/Beam.h
r4057 r4063 94 94 void MaxVz(double* pmaxvz, bool process_units); 95 95 void MaxAbsVz(double* pmaxabsvz, bool process_units); 96 void DuplicateInput(int original_enum,int new_enum);96 void InputDuplicate(int original_enum,int new_enum); 97 97 void ScaleInput(int enum_type,double scale_factor); 98 98 void AXPYInput(int YEnum, double scalar, int XEnum); -
issm/trunk/src/c/objects/Elements/Element.h
r4057 r4063 64 64 virtual void MaxVz(double* pmaxvz, bool process_units)=0; 65 65 virtual void MaxAbsVz(double* pmaxabsvz, bool process_units)=0; 66 virtual void DuplicateInput(int original_enum,int new_enum)=0;66 virtual void InputDuplicate(int original_enum,int new_enum)=0; 67 67 virtual void ScaleInput(int enum_type,double scale_factor)=0; 68 68 virtual void GetVectorFromInputs(Vec vector,int NameEnum)=0; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4057 r4063 5233 5233 } 5234 5234 /*}}}*/ 5235 /*FUNCTION Penta:: DuplicateInput(int original_enum,int new_enum){{{1*/5236 void Penta:: DuplicateInput(int original_enum,int new_enum){5235 /*FUNCTION Penta::InputDuplicate(int original_enum,int new_enum){{{1*/ 5236 void Penta::InputDuplicate(int original_enum,int new_enum){ 5237 5237 5238 5238 Input* original=NULL; -
issm/trunk/src/c/objects/Elements/Penta.h
r4057 r4063 161 161 void MaxVz(double* pmaxvz, bool process_units); 162 162 void MaxAbsVz(double* pmaxabsvz, bool process_units); 163 void DuplicateInput(int original_enum,int new_enum);163 void InputDuplicate(int original_enum,int new_enum); 164 164 void ScaleInput(int enum_type,double scale_factor); 165 165 void AXPYInput(int YEnum, double scalar, int XEnum); -
issm/trunk/src/c/objects/Elements/Sing.cpp
r4057 r4063 679 679 } 680 680 /*}}}*/ 681 /*FUNCTION Sing:: DuplicateInput(int original_enum,int new_enum){{{1*/682 void Sing:: DuplicateInput(int original_enum,int new_enum){681 /*FUNCTION Sing::InputDuplicate(int original_enum,int new_enum){{{1*/ 682 void Sing::InputDuplicate(int original_enum,int new_enum){ 683 683 684 684 Input* original=NULL; -
issm/trunk/src/c/objects/Elements/Sing.h
r4057 r4063 93 93 void MaxVz(double* pmaxvz, bool process_units); 94 94 void MaxAbsVz(double* pmaxabsvz, bool process_units); 95 void DuplicateInput(int original_enum,int new_enum);95 void InputDuplicate(int original_enum,int new_enum); 96 96 void ScaleInput(int enum_type,double scale_factor); 97 97 void AXPYInput(int YEnum, double scalar, int XEnum); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4057 r4063 5412 5412 } 5413 5413 /*}}}*/ 5414 /*FUNCTION Tria:: DuplicateInput(int original_enum,int new_enum){{{1*/5415 void Tria:: DuplicateInput(int original_enum,int new_enum){5414 /*FUNCTION Tria::InputDuplicate(int original_enum,int new_enum){{{1*/ 5415 void Tria::InputDuplicate(int original_enum,int new_enum){ 5416 5416 5417 5417 Input* original=NULL; -
issm/trunk/src/c/objects/Elements/Tria.h
r4057 r4063 139 139 void MaxVz(double* pmaxvz, bool process_units); 140 140 void MaxAbsVz(double* pmaxabsvz, bool process_units); 141 void DuplicateInput(int original_enum,int new_enum);141 void InputDuplicate(int original_enum,int new_enum); 142 142 void ScaleInput(int enum_type,double scale_factor); 143 143 void AXPYInput(int YEnum, double scalar, int XEnum); -
issm/trunk/src/c/objects/FemModel.cpp
r4059 r4063 30 30 this->nummodels=nummodels; 31 31 this->solution_type=in_solution_type; 32 analysis_counter=nummodels-1; //point to last analysis_type carried out.32 this->analysis_counter=nummodels-1; //point to last analysis_type carried out. 33 33 this->results=new DataSet(); //not initialized by CreateDataSets 34 34 … … 49 49 for(i=0;i<nummodels;i++)m_ys[i]=NULL; 50 50 51 _printf_(" fill model with matlab workspace data\n");52 iomodel = new IoModel(IOMODEL);51 /*create datasets for all analyses: */ 52 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses); 53 53 54 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ 54 55 for(i=0;i<nummodels;i++){ 55 56 56 57 analysis_type=analysis_type_list[i]; 57 58 58 _printf_(" create datasets:\n");59 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,¶meters,iomodel,IOMODEL,solution_type,analysis_type,nummodels,i);60 61 59 _printf_(" create degrees of freedom: \n"); 62 60 VerticesDofx( &partition,&tpartition,vertices,parameters); … … 81 79 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 82 80 } 83 84 _printf_(" free ressources:\n");85 delete iomodel;86 81 } 87 82 /*}}}1*/ -
issm/trunk/src/c/solutions/control_core.cpp
r4055 r4063 95 95 96 96 _printf_("%s"," save new parameter..."); 97 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type,ControlParameterEnum);97 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type,ControlParameterEnum); 98 98 99 99 _printf_("%s%i%s%g\n"," value of misfit J after optimization #",n+1,": ",J[n]); -
issm/trunk/src/c/solutions/diagnostic_core.cpp
r4055 r4063 36 36 /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/ 37 37 if(qmu_analysis){ 38 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVxEnum,VxEnum);39 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVyEnum,VyEnum);40 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVzEnum,VzEnum);41 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuPressureEnum,PressureEnum);38 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVxEnum,VxEnum); 39 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVyEnum,VyEnum); 40 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVzEnum,VzEnum); 41 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuPressureEnum,PressureEnum); 42 42 } 43 43 … … 72 72 73 73 //"recondition" pressure computed previously: 74 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);74 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum); 75 75 ScaleInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning); 76 76 -
issm/trunk/src/c/solutions/objectivefunctionC.cpp
r4055 r4063 54 54 55 55 /*Use ControlParameterEnum input to reinitialize our input parameter: */ 56 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ControlParameterEnum,control_type);56 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ControlParameterEnum,control_type); 57 57 58 58 /*Use search scalar to shoot parameter in the gradient direction: */ -
issm/trunk/src/c/solutions/steadystate_core.cpp
r4057 r4063 43 43 44 44 if(verbose)_printf_("%s\n","saving velocity, temperature and pressure to check for convergence at next step"); 45 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum);46 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum);47 if(dim==3) DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);48 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum);49 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum);45 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum); 46 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum); 47 if(dim==3)InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum); 48 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum); 49 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum); 50 50 51 51 //increase counter -
issm/trunk/src/c/solutions/stokescontrolinit.cpp
r4055 r4063 44 44 45 45 //recondition" pressure computed previously: 46 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);46 InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum); 47 47 ScaleInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning); 48 48 -
issm/trunk/src/m/solutions/jpl/diagnostic_core.m
r3962 r4063 6 6 % 7 7 8 %recover parameters common to all solutions 9 verbose=model.dhu.parameters.Verbose; 10 dim=model.dh.parameters.Dim; 11 ishutter=model.dhu.parameters.IsHutter; 12 ismacayealpattyn=model.dh.parameters.IsMacAyealPattyn; 13 isstokes=model.ds.parameters.IsStokes; 14 numrifts=model.dhu.parameters.NumRifts; 15 qmu_analysis=model.dh.parameters.QmuAnalysis; 8 %some parameters 9 modify_loads=boolean(1); 10 conserve_loads=boolean(1); 16 11 17 18 %for qmu analysis, be sure the velocity input we are starting from is the one in the parameters: 19 if qmu_analysis, 20 model=ModelUpdateInputsFromVector(model,m_dh.vx,VxEnum,VertexEnum); 21 model=ModelUpdateInputsFromVector(model,m_dh.vy,VyEnum,VertexEnum); 22 model=ModelUpdateInputsFromVector(model,m_dh.vz,VzEnum,VertexEnum); 23 end 12 %recover parameters common to all solutions 13 verbose=femmodel.parameters.Verbose; 14 dim=femmodel.parameters.Dim; 15 ishutter=femmodel.parameters.IsHutter; 16 ismacayealpattyn=femmodel.parameters.IsMacAyealPattyn; 17 isstokes=femmodel.parameters.IsStokes; 18 stokesreconditioning=femmodel.parameters.stokesreconditioning; 19 qmu_analysis=femmodel.parameters.QmuAnalysis; 24 20 25 %Compute slopes: 26 [surfaceslopex,surfaceslopey]=slope_core(model.sl,SurfaceAnalysisEnum); 27 [bedslopex,bedslopey]=slope_core(model.sl,BedAnalysisEnum); 28 29 %Update: 30 model=ModelUpdateInputsFromVector(model,surfaceslopex,SurfaceSlopexEnum,VertexEnum); 31 model=ModelUpdateInputsFromVector(model,surfaceslopey,SurfaceSlopeyEnum,VertexEnum); 32 model=ModelUpdateInputsFromVector(model,bedslopex,BedSlopexEnum,VertexEnum); 33 model=ModelUpdateInputsFromVector(model,bedslopey,BedSlopeyEnum,VertexEnum); 34 35 if ishutter, 36 37 displaystring(verbose,'\n%s',['computing hutter velocities...']); 38 u_g=diagnostic_core_linear(model.dhu,DiagnosticAnalysisEnum(),HutterAnalysisEnum()); 39 40 displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']); 41 p_g=ComputePressure(model.dhu.elements,model.dhu.nodes,model.dhu.vertices,model.dhu.loads,model.dhu.materials,model.dhu.parameters,DiagnosticAnalysisEnum(),HutterAnalysisEnum()); 42 43 displaystring(verbose,'\n%s',['update boundary conditions for macyeal pattyn using hutter results...']); 44 if ismacayealpattyn, 45 model.dh.y_g=u_g; 46 model.dh.ys=Reducevectorgtos(model.dh.y_g,model.dh.nodesets); 21 %for qmu analysis, be sure the velocity input we are starting from is the one in the parameters: 22 if qmu_analysis, 23 InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVxEnum,VxEnum); 24 InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVyEnum,VyEnum); 25 InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVzEnum,VzEnum); 26 InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuPressureEnum,PressureEnum); 47 27 end 48 28 49 end 50 51 if ismacayealpattyn, 29 %Compute slopes: 30 if(ishutter)surfaceslope_core(femmodel);end 31 if(isstokes)bedslope_core(femmodel);end 52 32 53 displaystring(verbose,'\n%s',['computing horizontal velocities...']); 54 [u_g model.dh.loads]=diagnostic_core_nonlinear(model.dh,model.dh.loads,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 33 if ishutter, 55 34 56 if dim==2, 57 displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']); 58 p_g=ComputePressure(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 35 displaystring(verbose,'\n%s',['computing hutter velocities...']); 36 femmodel=SetCurrentAnalysis(femmodel,DiagnosticHutterAnalysisEnum); 37 femmodel=solver_linear(femmodel); 38 39 if(ismacayealpattyn)femmodel=ResetBoundaryConditions(femmodel,DiagnosticAnalysisEnum,HorizAnalysisEnum); end 40 59 41 end 60 end 42 43 if ismacayealpattyn, 44 45 displaystring(verbose,'\n%s',['computing horizontal velocities...']); 46 femmodel=SetCurrentAnalysis(femmodel,DiagnosticHorizAnalysisEnum); 47 femmodel=solver_diagnostic_nonlinear(femmodel,modify_loads); 48 end 61 49 62 if dim==3,63 50 64 displaystring(verbose,'\n%s',['extruding horizontal velocities...']); 65 u_g_horiz=FieldExtrude(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,u_g,'velocity',1); 51 if dim==3, 52 53 displaystring(verbose,'\n%s',['computing vertical velocities...']); 54 femmodel=SetCurrentAnalysis(femmodel,DiagnosticVertAnalysisEnum); 55 femmodel=solver_linear(femmodel); 66 56 67 [vx,vy]=SplitSolutionVector(u_g_horiz,model.dh.parameters.NumberOfNodes,model.dh.parameters.NumberOfDofsPerNode); 68 model=ModelUpdateInputsFromVector(model,vx,VxEnum,VertexEnum); 69 model=ModelUpdateInputsFromVector(model,vy,VyEnum,VertexEnum); 70 71 displaystring(verbose,'\n%s',['computing vertical velocities...']); 72 u_g_vert=diagnostic_core_linear(model.dv,DiagnosticAnalysisEnum(),VertAnalysisEnum()); 73 model=ModelUpdateInputsFromVector(model,u_g_vert,VzEnum,VertexEnum); 57 if isstokes, 74 58 75 displaystring(verbose,'\n%s',['computing pressure according to Pattyn...']); 76 p_g=ComputePressure(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 77 model=ModelUpdateInputsFromVector(model,p_g,PressureEnum,VertexEnum); 78 u_g=zeros(model.dh.parameters.NumberOfNodes*3,1); %%%%%%%%%%%%%%%%%%%%%%% NEED TO BE CLEANED 79 u_g(1:3:end)=vx; 80 u_g(2:3:end)=vy; 81 u_g(3:3:end)=u_g_vert; 82 83 if isstokes, 59 %"recondition" pressure computed previously: 60 InputDuplicate(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum); 61 ScaleInput(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning); 84 62 85 %"recondition" pressure86 p_g=p_g/m_ds.parameters.stokesreconditioning;63 displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']); 64 femmodel=ResetBoundaryConditions(femmodel,DiagnosticAnalysisEnum,StokesAnalysisEnum); 87 65 88 displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']);89 model.ds.y_g=zeros(model.ds.nodesets.gsize,1);90 model.ds.y_g(dofsetgen([1,2],4,model.ds.nodesets.gsize))=u_g;91 model.ds.y_g(dofsetgen([3],4,model.ds.nodesets.gsize))=u_g_vert;92 model.ds.ys=Reducevectorgtos(model.ds.y_g,model.ds.nodesets);66 displaystring(verbose,'\n%s',['computing stokes velocities and pressure...']); 67 femmodel=SetCurrentAnalysis(femmodel,DiagnosticStokesAnalysisEnum); 68 femmodel=solver_diagnostic_nonlinear(femmodel,conserve_loads); 69 end 70 end 93 71 94 displaystring(verbose,'\n%s',['computing stokes velocities and pressure ...']); 95 u_g=diagnostic_core_nonlinear(model.ds,DiagnosticAnalysisEnum(),StokesAnalysisEnum()); 96 97 %"decondition" pressure 98 p_g=u_g(4:4:end)*model.dh.parameters.stokesreconditioning; 99 end 100 end 101 %load onto results 102 results.step=1; 103 results.time=0; 104 results.u_g=u_g; 105 results.p_g=p_g; 106 107 if numrifts, 108 results.riftproperties=OutputRifts(model.dh.loads,model.dh.parameters); 109 end 72 displaystring(verbose,'\n%s',['saving results...']); 73 InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum); 74 InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum); 75 InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum); 76 if(dim==3) InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum); -
issm/trunk/src/mex/Makefile.am
r4002 r4063 30 30 Gradj\ 31 31 HoleFiller \ 32 InputDuplicate\ 32 33 InterpFromGridToMesh \ 33 34 InterpFromMeshToMesh2d \ … … 164 165 HoleFiller/HoleFiller.h 165 166 167 InputDuplicate_SOURCES = InputDuplicate/InputDuplicate.cpp\ 168 InputDuplicate/InputDuplicate.h 169 166 170 InterpFromGridToMesh_SOURCES = InterpFromGridToMesh/InterpFromGridToMesh.cpp\ 167 171 InterpFromGridToMesh/InterpFromGridToMesh.h -
issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp
r4002 r4063 11 11 12 12 /*inputs: */ 13 double* analyses=NULL; 13 int solution_type; 14 double* double_analyses=NULL; 15 int* analyses=NULL; 14 16 int numanalyses; 15 17 … … 23 25 Parameters* parameters=NULL; 24 26 25 /*input model: */26 IoModel* iomodel=NULL;27 28 27 /*Boot module: */ 29 28 MODULEBOOT(); … … 32 31 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ModelProcessorUsage); 33 32 34 /*Fill iomodel with matlab workspace data: */ 35 iomodel=new IoModel(MODEL); //this routine goes through the entire MODEL matlab class, and starts filling the corresponding "c" code model object. 36 FetchData(&analyses,&numanalyses,ANALYSES); 33 FetchData(&solution_type,SOLUTIONTYPE); 34 35 FetchData(&double_analyses,&numanalyses,ANALYSES); 36 analyses=(int*)xmalloc(numanalyses*sizeof(int)); 37 for(i=0;i<numanalyses;i++)analyses[i]=double_analyses[i]; 37 38 38 /*Create datasets, and update for each analysis type: */ 39 for(i=0;i<numanalyses;i++){ 40 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints, &loads, ¶meters, iomodel,MODEL,(int)analyses[i],numanalyses,i); 41 } 42 39 /*call x code ModelProcessorx: */ 40 ModelProcessorx(&elements,&nodes,&vertices,&materials,&constraints, &loads, ¶meters, MODEL,solution_type,numanalyses,analyses); 43 41 44 42 /*Write output data: */ … … 53 51 54 52 /*Free ressources: */ 55 delete iomodel;56 53 delete elements; 57 54 delete nodes; … … 61 58 delete materials; 62 59 delete parameters; 63 delete analyses; 64 60 xfree((void**)&analyses); 61 xfree((void**)&double_analyses); 62 65 63 /*end module: */ 66 64 MODULEEND(); -
issm/trunk/src/mex/ModelProcessor/ModelProcessor.h
r4002 r4063 24 24 /* serial input macros: */ 25 25 #define MODEL (mxArray*)prhs[0] 26 #define ANALYSES (mxArray*)prhs[1] 26 #define SOLUTIONTYPE (mxArray*)prhs[1] 27 #define ANALYSES (mxArray*)prhs[2] 27 28 28 29 /* serial output macros: */ … … 39 40 #define NLHS 7 40 41 #undef NRHS 41 #define NRHS 242 #define NRHS 3 42 43 43 44 #endif /* _MEXMODELPROCESSOR_H */
Note:
See TracChangeset
for help on using the changeset viewer.