Changeset 3673
- Timestamp:
- 05/08/10 14:37:25 (15 years ago)
- Location:
- issm/trunk
- Files:
-
- 36 added
- 19 deleted
- 145 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/configs/macosx32/macosx32.sh.petsc2
r3225 r3673 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=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a" --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/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$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="/usr/local/lib/libgfortran.a" --with-math-lib="/usr/lib/libm.dylib" --with-graphics-lib="/usr/X11/lib/libX11.dylib" --with-petsc-version=23 ./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=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a" --with-petsc-arch=$ISSM_ARCH --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$ISSM_ARCH -lPLAPACK" --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32/$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="/usr/local/lib/libgfortran.a" --with-math-lib="/usr/lib/libm.dylib" --with-graphics-lib="/usr/X11/lib/libX11.dylib" --with-petsc-version=2 -
issm/trunk/etc/environment_variables.csh
r3601 r3673 1 #2 #3 #This routine can only be run if the ISSM_DIR variable has been correctly set!4 #5 #6 7 #MATLAB8 set MATLAB_DIR={$ISSM_DIR}/externalpackages/matlab/install9 set MATLAB_VERSION=10 11 #MPI12 set MPI_DIR={$ISSM_DIR}/externalpackages/mpich2/install13 14 #PETSC15 set PETSC_DIR={$ISSM_DIR}/externalpackages/petsc/install16 17 #SLEPC18 set SLEPC_DIR={$ISSM_DIR}/externalpackages/slepc/install19 20 #Dakota21 set DAKOTA_DIR={$ISSM_DIR}/externalpackages/dakota/install22 23 #Qhull24 set QHULL_DIR={$ISSM_DIR}/externalpackages/qhull/install25 26 #Doxygen27 set DOXYGEN_DIR={$ISSM_DIR}/externalpackages/doxygen/install28 29 #MTOC30 set MTOC_DIR={$ISSM_DIR}/externalpackages/mtoc/install31 32 #Triangle33 set TRIANGLE_DIR={$ISSM_DIR}/externalpackages/triangle/install34 35 #METIS36 set METIS_DIR={$ISSM_DIR}/externalpackages/metis/install37 38 #BLAS39 set BLAS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack40 41 #LAPACK42 set LAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/fblaslapack/$ISSM_ARCH43 44 #SCALAPACK45 set SCALAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/SCALAPACK/$ISSM_ARCH46 47 #PLAPACK48 set PLAPACK_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/PLAPACKR3249 50 #BLACS51 set BLACS_DIR={$ISSM_DIR}/externalpackages/petsc/install/externalexternalpackages/blacs-dev/$ISSM_ARCH52 53 #sowing54 set SOWING_DIR={$ISSM_DIR}/externalpackages/sowing/install55 56 #YAMS57 set YAMS_DIR={$ISSM_DIR}/externalpackages/yams/install58 59 #TEX2IM60 set TEX2IM_DIR={$ISSM_DIR}/externalpackages/tex2im/install61 62 #Chaco63 set CHACO_DIR={$ISSM_DIR}/externalpackages/chaco/install64 65 #MeshPart66 set MESHPART_DIR={$ISSM_DIR}/externalpackages/meshpart/install67 68 #SCOTCH69 set SCOTCH_DIR={$ISSM_DIR}/externalpackages/scotch/install70 71 #Development packages72 #automake73 set AUTOMAKE_DIR={$ISSM_DIR}/devpackages/automake/install74 75 #autoconf76 set AUTOCONF_DIR={$ISSM_DIR}/devpackages/autoconf/install77 78 #borland79 set BORLAND_DIR=/cygdrive/c/Borland80 81 #ssh82 set SSH_DIR={$ISSM_DIR}/externalpackages/ssh83 84 #valgrind85 set VALGRIND_DIR={$ISSM_DIR}/externalpackages/valgrind/install/bin -
issm/trunk/etc/environment_variables.sh
r3602 r3673 1 #2 #3 #This routine can only be run if the ISSM_DIR variable has been correctly set!4 #5 #6 7 #MATLAB8 MATLAB_DIR="$ISSM_DIR/externalpackages/matlab/install"9 MATLAB_VERSION=10 11 #MPI12 MPI_DIR="$ISSM_DIR/externalpackages/mpich2/install"13 14 #PETSC15 PETSC_DIR="$ISSM_DIR/externalpackages/petsc/install"16 17 #SLEPC18 SLEPC_DIR="$ISSM_DIR/externalpackages/slepc/install"19 20 #Dakota21 DAKOTA_DIR="$ISSM_DIR/externalpackages/dakota/install"22 23 #Qhull24 QHULL_DIR="$ISSM_DIR/externalpackages/qhull/install"25 26 #Doxygen27 DOXYGEN_DIR="$ISSM_DIR/externalpackages/doxygen/install"28 29 #MTOC30 MTOC_DIR="$ISSM_DIR/externalpackages/mtoc/install"31 32 #Triangle33 TRIANGLE_DIR="$ISSM_DIR/externalpackages/triangle/install"34 35 #METIS36 METIS_DIR="$ISSM_DIR/externalpackages/metis/install"37 38 #BLAS39 BLAS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack"40 41 #LAPACK42 LAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/fblaslapack/$ISSM_ARCH"43 44 #SCALAPACK45 SCALAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/SCALAPACK/$ISSM_ARCH"46 47 #PLAPACK48 PLAPACK_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32"49 50 #BLACS51 BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"52 53 #sowing54 SOWING_DIR="$ISSM_DIR/externalpackages/sowing/install"55 56 #BLACS57 BLACS_DIR="$ISSM_DIR/externalpackages/petsc/install/externalpackages/blacs-dev/$ISSM_ARCH"58 59 #YAMS60 YAMS_DIR="$ISSM_DIR/externalpackages/yams/install"61 62 #BAMG63 BAMG_DIR="$ISSM_DIR/externalpackages/bamg/install"64 65 #Chaco66 CHACO_DIR="$ISSM_DIR/externalpackages/chaco/install"67 68 #MeshPart69 MESHPART_DIR="$ISSM_DIR/externalpackages/meshpart/install"70 71 #SCOTCH72 SCOTCH_DIR="$ISSM_DIR/externalpackages/scotch/install"73 74 #Development packages75 #automake76 AUTOMAKE_DIR="$ISSM_DIR/devpackages/automake/install"77 78 #autoconf79 AUTOCONF_DIR="$ISSM_DIR/devpackages/autoconf/install"80 81 #borland82 #BORLAND_DIR="/cygdrive/c/Borland/"83 84 #intel85 #INTEL_DIR="C:/IntelInstall/Compiler/11.1/038/bin/ia32/"86 87 #TEX2IM88 TEX2IM_DIR="$ISSM_DIR/externalpackages/tex2im/install"89 90 #sdk91 SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"92 93 #ssh94 SSH_DIR="$ISSM_DIR/externalpackages/ssh"95 96 #valgrind97 VALGRIND_DIR="$ISSM_DIR/externalpackages/valgrind/install/bin"98 99 #graphviz100 GRAPHVIZ_DIR="$ISSM_DIR/externalpackages/graphviz/install/bin"101 102 #cppcheck103 CPPCHECK_DIR="$ISSM_DIR/externalpackages/cppcheck/install" -
issm/trunk/externalpackages/matlab/install.sh
r3603 r3673 8 8 9 9 #symlink matlab to root matlab 10 ln -s /usr/local/pkgs/matlab-$MATLAB_VERSION/ install 10 ln -s /Applications/MATLAB_R2008a/ install 11 12 export MATLAB_VERSION=R2008a 11 13 12 14 #initialize MATLAB_VERSION in etc/environment_variables -
issm/trunk/externalpackages/mpich2/install.sh
r2124 r3673 5 5 6 6 #version of mpich2 7 version=1. 1.1p17 version=1.0.2p1 8 8 9 9 #Some cleanup -
issm/trunk/m4/matlab.m4
r1439 r3673 306 306 fi 307 307 fi]) 308 echo $ax_cv_matlab_version 308 309 case $ax_cv_matlab_version in 309 310 @<:@1-9@:>@.@<:@0-9@:>@ | @<:@1-9@:>@@<:@0-9@:>@.@<:@0-9@:>@) … … 317 318 MATLAB_MINOR=a 318 319 ;; 320 R2008a) 321 MATLAB_VERSION=R2008a 322 MATLAB_MAJOR=R2008 323 MATLAB_MINOR=a 324 ;; 325 319 326 *) 320 327 if test x$ax_enable_matlab = xyes ; then -
issm/trunk/src/c/ComputeBasalStressx/ComputeBasalStressx.cpp
r3529 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeBasalStressx( Vec* psigma,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,13 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){12 void ComputeBasalStressx( Vec* psigma,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters, 13 int analysis_type,int sub_analysis_type){ 14 14 15 15 int i; … … 34 34 35 35 /*Call on dataset driver: */ 36 elements->ComputeBasalStress(sigma, inputs,analysis_type,sub_analysis_type);36 elements->ComputeBasalStress(sigma,analysis_type,sub_analysis_type); 37 37 38 38 /*Assemble vector: */ -
issm/trunk/src/c/ComputeBasalStressx/ComputeBasalStressx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void ComputeBasalStressx( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,12 void ComputeBasalStressx( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ComputePressurex/ComputePressurex.cpp
r3529 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,13 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){12 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters, 13 int analysis_type,int sub_analysis_type){ 14 14 15 15 int i; … … 32 32 33 33 /*Call on dataset driver: */ 34 elements->ComputePressure(p_g, inputs,analysis_type,sub_analysis_type);34 elements->ComputePressure(p_g,analysis_type,sub_analysis_type); 35 35 36 36 /*Assemble vector: */ -
issm/trunk/src/c/ComputePressurex/ComputePressurex.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,12 void ComputePressurex( Vec* pp_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ComputeStrainRatex/ComputeStrainRatex.cpp
r3529 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void ComputeStrainRatex( Vec* peps,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,13 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){12 void ComputeStrainRatex( Vec* peps,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials,Parameters* parameters, 13 int analysis_type,int sub_analysis_type){ 14 14 15 15 int i; … … 33 33 34 34 /*Call on dataset driver: */ 35 elements->ComputeStrainRate(eps, inputs,analysis_type,sub_analysis_type);35 elements->ComputeStrainRate(eps,analysis_type,sub_analysis_type); 36 36 37 37 /*Assemble vector: */ -
issm/trunk/src/c/ComputeStrainRatex/ComputeStrainRatex.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void ComputeStrainRatex(Vec* eps_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,12 void ComputeStrainRatex(Vec* eps_g,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.cpp
r3633 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, DataSet* parameters){12 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials,Parameters* parameters){ 13 13 14 14 int noerr=1; … … 23 23 loads->Configure(elements,loads,nodes,vertices,materials,parameters); 24 24 //_printf_(" Configuring nodes...\n"); 25 nodes->Configure( nodes);25 nodes->Configure(elements,loads,nodes,vertices,materials,parameters); 26 26 //_printf_(" Configuring parameters...\n"); 27 parameters->Configure(elements,loads, nodes,vertices,materials,parameters);27 parameters->Configure(elements,loads,nodes,vertices,materials,parameters); 28 28 29 29 return noerr; -
issm/trunk/src/c/ConfigureObjectsx/ConfigureObjectsx.h
r3420 r3673 9 9 10 10 /* local prototypes: */ 11 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, DataSet* parameters);11 int ConfigureObjectsx( DataSet* elements, DataSet* loads, DataSet* nodes, DataSet* vertices, DataSet* materials, Parameters* parameters); 12 12 13 13 #endif /* _CONFIGUREOBJECTSX_H */ -
issm/trunk/src/c/CostFunctionx/CostFunctionx.cpp
r3502 r3673 11 11 #include "../SurfaceAreax/SurfaceAreax.h" 12 12 13 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,14 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){13 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters, 14 int analysis_type,int sub_analysis_type){ 15 15 16 16 /*Intermediary*/ … … 27 27 parameters->Configure(elements,loads, nodes,vertices, materials,parameters); 28 28 29 /*If fit=3, compute Surface Area*/ 30 if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter"); 31 if (fit==3 && !inputs->IsPresent("surfacearea")){ 29 /*Compute surface area: */ 30 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type); 32 31 33 SurfaceAreax(&S,elements,nodes,vertices,loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 34 inputs->Add("surfacearea",S); 35 } 36 32 /*add surface area to elements :*/ 33 elements->AddInput(S,SurfaceAreaEnum); 34 37 35 /*Compute gradients: */ 38 elements->CostFunction(&J, inputs,analysis_type,sub_analysis_type);36 elements->CostFunction(&J,analysis_type,sub_analysis_type); 39 37 40 38 /*Sum all J from all cpus of the cluster:*/ -
issm/trunk/src/c/CostFunctionx/CostFunctionx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,12 void CostFunctionx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/DataSet/DataSet.cpp
r3649 r3673 207 207 dataset->AddObject(vertex); 208 208 } 209 else if(enum_type==ParamEnum){ 210 Param* param=NULL; 211 param=new Param(); 212 param->Demarshall(&marshalled_dataset); 213 dataset->AddObject(param); 214 } 215 else if(enum_type==NumparEnum){ 216 Numpar* numpar=NULL; 217 numpar=new Numpar(); 218 numpar->Demarshall(&marshalled_dataset); 219 dataset->AddObject(numpar); 209 else if(enum_type==DoubleParamEnum){ 210 DoubleParam* doubleparam=NULL; 211 doubleparam=new DoubleParam(); 212 doubleparam->Demarshall(&marshalled_dataset); 213 dataset->AddObject(doubleparam); 220 214 } 221 215 else if(enum_type==TriaEnum){ … … 512 506 513 507 /*Which id does it have: */ 514 id=(*object)-> GetId();508 id=(*object)->Id(); 515 509 516 510 /*Plug rank into ranks, according to id: */ … … 532 526 for(i=0;i<objects.size();i++){ 533 527 id_offsets[i]=i; 534 sorted_ids[i]=objects[i]-> GetId();528 sorted_ids[i]=objects[i]->Id(); 535 529 } 536 530 } … … 1364 1358 element->UpdateInputs(solution,analysis_type,sub_analysis_type); 1365 1359 } 1366 else ISSMERROR("%s%i%s"," object with id: ",(*object)->GetId()," is not an element, in a function that deals only with elements!"); 1360 else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!"); 1361 } 1362 } 1363 /*}}}*/ 1364 /*FUNCTION DataSet::AddInput{{{1*/ 1365 void DataSet::AddInput(double value, int enum_type){ 1366 1367 vector<Object*>::iterator object; 1368 Element* element=NULL; 1369 1370 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1371 1372 if(EnumIsElement((*object)->Enum())){ 1373 1374 element=(Element*)(*object); 1375 element->AddInput(value,enum_type); 1376 } 1377 else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!"); 1367 1378 } 1368 1379 } -
issm/trunk/src/c/DataSet/DataSet.h
r3649 r3673 71 71 void CreatePVector(Vec pg, int analysis_type,int sub_analysis_type); 72 72 void UpdateInputs(double* solution,int analysis_type,int sub_analysis_type); 73 void AddInput(double value, int enum_type); 73 74 void PenaltyCreateKMatrix(Mat Kgg,double kmax,int analysis_type,int sub_analysis_type); 74 75 void PenaltyCreatePVector(Vec pg,double kmax,int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/DataSet/Inputs.cpp
r3649 r3673 64 64 65 65 /*Ok, we have an input if we made it here, request the input to return the values: */ 66 input->GetParameterValue s(pvalue,gauss);66 input->GetParameterValue(pvalue,gauss); 67 67 68 68 } … … 165 165 /*}}}*/ 166 166 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{1*/ 167 void GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){ 168 167 void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){ 168 169 int i; 169 170 vector<Object*>::iterator object; 170 171 Input* input=NULL; … … 188 189 /*}}}*/ 189 190 /*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{1*/ 190 void GetParameterValue(bool* pvalue,int enum_type){191 void Inputs::GetParameterValue(bool* pvalue,int enum_type){ 191 192 192 193 vector<Object*>::iterator object; … … 212 213 /*}}}*/ 213 214 /*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{1*/ 214 void GetParameterValue(int* pvalue,int enum_type){215 void Inputs::GetParameterValue(int* pvalue,int enum_type){ 215 216 216 217 vector<Object*>::iterator object; … … 236 237 /*}}}*/ 237 238 /*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{1*/ 238 void GetParameterValue(double* pvalue,int enum_type){239 void Inputs::GetParameterValue(double* pvalue,int enum_type){ 239 240 240 241 vector<Object*>::iterator object; … … 279 280 280 281 /*Ok, we have an input if we made it here, request the input to return the value: */ 281 input->GetParameter Value(derivativevalues,xyz_list,gauss);282 input->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss); 282 283 } 283 284 /*}}}*/ … … 312 313 /*}}}*/ 313 314 /*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{1*/ 314 void Inputs::GetStrainRate (double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){315 void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){ 315 316 316 317 vector<Object*>::iterator object; 317 318 Input* xinput=NULL; 318 319 Input* yinput=NULL; 319 Input* yinput=NULL;320 Input* zinput=NULL; 320 321 321 322 /*Go through inputs and find data for xenum: */ -
issm/trunk/src/c/DataSet/Inputs.h
r3647 r3673 6 6 #define _INPUTS_H_ 7 7 8 #include "./DataSet.h" 8 9 class Input; 9 class Node; 10 #include "./DataSet.h" 10 #include "../objects/Input.h" 11 11 #include "../objects/Node.h" 12 12 -
issm/trunk/src/c/DataSet/Parameters.cpp
r3621 r3673 9 9 #endif 10 10 11 #include <vector> 12 #include <functional> 13 #include <algorithm> 14 #include <iostream> 15 11 16 #include "./DataSet.h" 12 17 #include "./Parameters.h" 18 19 #include "../shared/shared.h" 20 #include "../include/macros.h" 21 #include "../EnumDefinitions/EnumDefinitions.h" 22 23 using namespace std; 24 13 25 14 26 /*Object constructors and destructor*/ … … 20 32 /*FUNCTION Parameters::Parameters(int in_enum){{{1*/ 21 33 Parameters::Parameters(int in_enum): DataSet(in_enum){ 22 {23 34 //do nothing; 24 35 return; … … 32 43 33 44 /*Object management*/ 34 /*FUNCTION Parameters::FindParam(double* pscalar, char* name){{{1*/35 int Parameters::FindParam(double* pscalar, char* name){36 37 /*Go through a dataset, and find a Param* object 38 *which parameter name is "name" : */ 39 40 vector<Object*>::iterator object; 41 Param* param=NULL; 42 43 int found=0; 44 45 for ( object=objects.begin() ; object < objects.end(); object++ ){ 46 47 /*Find param type objects: */ 48 if((*object)->Enum()==ParamEnum){ 49 50 /*Ok, this object is a parameter, recover it and ask which name it has: */ 51 param=(Param*)(*object); 52 53 if (strcmp(param->GetParameterName(),name)==0){45 /*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{1*/ 46 int Parameters::FindParam(double* pscalar, int enum_type){ 47 48 /*Go through a dataset, and find a Param* object 49 *which parameter name is "name" : */ 50 51 vector<Object*>::iterator object; 52 Param* param=NULL; 53 54 int found=0; 55 56 for ( object=objects.begin() ; object < objects.end(); object++ ){ 57 58 /*Find param type objects: */ 59 if((*object)->Enum()==ParamEnum){ 60 61 /*Ok, this object is a parameter, recover it and ask which name it has: */ 62 param=(Param*)(*object); 63 64 if(param->EnumType()==enum_type){ 54 65 /*Ok, this is the one! Recover the value of this parameter: */ 55 66 param->GetParameterValue(pscalar); … … 62 73 } 63 74 /*}}}*/ 64 /*FUNCTION Parameters::FindParam(int* pinteger, char* name){{{1*/65 int Parameters::FindParam(int* pinteger, char* name){66 67 68 /*Go through a dataset, and find a Param* object 69 *which parameter name is "name" : */ 70 71 vector<Object*>::iterator object; 72 Param* param=NULL; 73 74 int found=0; 75 76 for ( object=objects.begin() ; object < objects.end(); object++ ){ 77 78 /*Find param type objects: */ 79 if((*object)->Enum()==ParamEnum){ 80 81 /*Ok, this object is a parameter, recover it and ask which name it has: */ 82 param=(Param*)(*object); 83 84 if (strcmp(param->GetParameterName(),name)==0){75 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{1*/ 76 int Parameters::FindParam(int* pinteger,int enum_type){ 77 78 79 /*Go through a dataset, and find a Param* object 80 *which parameter name is "name" : */ 81 82 vector<Object*>::iterator object; 83 Param* param=NULL; 84 85 int found=0; 86 87 for ( object=objects.begin() ; object < objects.end(); object++ ){ 88 89 /*Find param type objects: */ 90 if((*object)->Enum()==ParamEnum){ 91 92 /*Ok, this object is a parameter, recover it and ask which name it has: */ 93 param=(Param*)(*object); 94 95 if(param->EnumType()==enum_type){ 85 96 /*Ok, this is the one! Recover the value of this parameter: */ 86 97 param->GetParameterValue(pinteger); … … 93 104 } 94 105 /*}}}*/ 95 /*FUNCTION Parameters::FindParam(char** pstring, char* name){{{1*/96 int Parameters::FindParam(char** pstring, char* name){97 98 /*Go through a dataset, and find a Param* object 99 *which parameter name is "name" : */ 100 101 vector<Object*>::iterator object; 102 Param* param=NULL; 103 104 int found=0; 105 106 for ( object=objects.begin() ; object < objects.end(); object++ ){ 107 108 /*Find param type objects: */ 109 if((*object)->Enum()==ParamEnum){ 110 111 /*Ok, this object is a parameter, recover it and ask which name it has: */ 112 param=(Param*)(*object); 113 114 if (strcmp(param->GetParameterName(),name)==0){106 /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{1*/ 107 int Parameters::FindParam(char** pstring,int enum_type){ 108 109 /*Go through a dataset, and find a Param* object 110 *which parameter name is "name" : */ 111 112 vector<Object*>::iterator object; 113 Param* param=NULL; 114 115 int found=0; 116 117 for ( object=objects.begin() ; object < objects.end(); object++ ){ 118 119 /*Find param type objects: */ 120 if((*object)->Enum()==ParamEnum){ 121 122 /*Ok, this object is a parameter, recover it and ask which name it has: */ 123 param=(Param*)(*object); 124 125 if(param->EnumType()==enum_type){ 115 126 /*Ok, this is the one! Recover the value of this parameter: */ 116 127 param->GetParameterValue(pstring); … … 124 135 } 125 136 /*}}}*/ 126 /*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,char* name){{{1*/ 127 int Parameters::FindParam(char*** pstringarray,int* pM,char* name){ 128 129 /*Go through a dataset, and find a Param* object 130 *which parameter name is "name" : */ 131 132 vector<Object*>::iterator object; 133 Param* param=NULL; 134 135 int found=0; 136 137 for ( object=objects.begin() ; object < objects.end(); object++ ){ 138 139 /*Find param type objects: */ 140 if((*object)->Enum()==ParamEnum){ 141 142 /*Ok, this object is a parameter, recover it and ask which name it has: */ 143 param=(Param*)(*object); 144 145 if (strcmp(param->GetParameterName(),name)==0){ 146 /*Ok, this is the one! Recover the value of this parameter: */ 147 param->GetParameterValue(pstringarray); 148 if(pM)*pM=param->GetM(); 149 found=1; 150 break; 151 } 152 } 153 } 154 return found; 155 156 } 157 /*}}}*/ 158 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,char* name){{{1*/ 159 int Parameters::FindParam(double** pdoublearray,int* pM, int* pN,char* name){ 160 161 /*Go through a dataset, and find a Param* object 162 *which parameter name is "name" : */ 163 164 vector<Object*>::iterator object; 165 Param* param=NULL; 166 167 int found=0; 168 169 for ( object=objects.begin() ; object < objects.end(); object++ ){ 170 171 /*Find param type objects: */ 172 if((*object)->Enum()==ParamEnum){ 173 174 /*Ok, this object is a parameter, recover it and ask which name it has: */ 175 param=(Param*)(*object); 176 177 if (strcmp(param->GetParameterName(),name)==0){ 178 /*Ok, this is the one! Recover the value of this parameter: */ 179 param->GetParameterValue(pdoublearray); 180 if(pM)param->GetM(); 181 if(pN)param->GetN(); 182 found=1; 183 break; 184 } 185 } 186 } 187 return found; 188 189 } 190 /*}}}*/ 191 /*FUNCTION Parameters::FindParam(Vec* pvec,char* name){{{1*/ 192 int Parameters::FindParam(Vec* pvec,char* name){ 193 194 /*Go through a dataset, and find a Param* object 195 *which parameter name is "name" : */ 196 197 vector<Object*>::iterator object; 198 Param* param=NULL; 199 200 int found=0; 201 202 for ( object=objects.begin() ; object < objects.end(); object++ ){ 203 204 /*Find param type objects: */ 205 if((*object)->Enum()==ParamEnum){ 206 207 /*Ok, this object is a parameter, recover it and ask which name it has: */ 208 param=(Param*)(*object); 209 210 if (strcmp(param->GetParameterName(),name)==0){ 137 /*FUNCTION Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){{{1*/ 138 int Parameters::FindParam(char*** pstringarray,int* pM,int enum_type){ 139 140 /*Go through a dataset, and find a Param* object 141 *which parameter name is "name" : */ 142 143 vector<Object*>::iterator object; 144 Param* param=NULL; 145 146 int found=0; 147 148 for ( object=objects.begin() ; object < objects.end(); object++ ){ 149 150 /*Find param type objects: */ 151 if((*object)->Enum()==ParamEnum){ 152 153 /*Ok, this object is a parameter, recover it and ask which name it has: */ 154 param=(Param*)(*object); 155 156 if(param->EnumType()==enum_type){ 157 /*Ok, this is the one! Recover the value of this parameter: */ 158 param->GetParameterValue(pstringarray,pM); 159 found=1; 160 break; 161 } 162 } 163 } 164 return found; 165 166 } 167 /*}}}*/ 168 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM,int enum_type){{{1*/ 169 int Parameters::FindParam(double** pdoublearray,int* pM, int enum_type){ 170 171 /*Go through a dataset, and find a Param* object 172 *which parameter name is "name" : */ 173 174 vector<Object*>::iterator object; 175 Param* param=NULL; 176 177 int found=0; 178 179 for ( object=objects.begin() ; object < objects.end(); object++ ){ 180 181 /*Find param type objects: */ 182 if((*object)->Enum()==ParamEnum){ 183 184 /*Ok, this object is a parameter, recover it and ask which name it has: */ 185 param=(Param*)(*object); 186 187 if(param->EnumType()==enum_type){ 188 /*Ok, this is the one! Recover the value of this parameter: */ 189 param->GetParameterValue(pdoublearray,pM) 190 found=1; 191 break; 192 } 193 } 194 } 195 return found; 196 197 } 198 /*}}}*/ 199 /*FUNCTION Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){{{1*/ 200 int Parameters::FindParam(double** pdoublearray,int* pM, int* pN,int enum_type){ 201 202 /*Go through a dataset, and find a Param* object 203 *which parameter name is "name" : */ 204 205 vector<Object*>::iterator object; 206 Param* param=NULL; 207 208 int found=0; 209 210 for ( object=objects.begin() ; object < objects.end(); object++ ){ 211 212 /*Find param type objects: */ 213 if((*object)->Enum()==ParamEnum){ 214 215 /*Ok, this object is a parameter, recover it and ask which name it has: */ 216 param=(Param*)(*object); 217 218 if(param->EnumType()==enum_type){ 219 /*Ok, this is the one! Recover the value of this parameter: */ 220 param->GetParameterValue(pdoublearray,pM,pN); 221 found=1; 222 break; 223 } 224 } 225 } 226 return found; 227 228 } 229 /*}}}*/ 230 /*FUNCTION Parameters::FindParam(Vec* pvec,int enum_type){{{1*/ 231 int Parameters::FindParam(Vec* pvec,int enum_type){ 232 233 /*Go through a dataset, and find a Param* object 234 *which parameter name is "name" : */ 235 236 vector<Object*>::iterator object; 237 Param* param=NULL; 238 239 int found=0; 240 241 for ( object=objects.begin() ; object < objects.end(); object++ ){ 242 243 /*Find param type objects: */ 244 if((*object)->Enum()==ParamEnum){ 245 246 /*Ok, this object is a parameter, recover it and ask which name it has: */ 247 param=(Param*)(*object); 248 249 if(param->EnumType()==enum_type){ 211 250 /*Ok, this is the one! Recover the value of this parameter: */ 212 251 param->GetParameterValue(pvec); … … 220 259 } 221 260 /*}}}*/ 222 /*FUNCTION Parameters::FindParamMat* pmat, char* name){{{1*/223 int Parameters::FindParam(Mat* pmat, char* name){224 225 /*Go through a dataset, and find a Param* object 226 *which parameter name is "name" : */ 227 228 vector<Object*>::iterator object; 229 Param* param=NULL; 230 231 int found=0; 232 233 for ( object=objects.begin() ; object < objects.end(); object++ ){ 234 235 /*Find param type objects: */ 236 if((*object)->Enum()==ParamEnum){ 237 238 /*Ok, this object is a parameter, recover it and ask which name it has: */ 239 param=(Param*)(*object); 240 241 if (strcmp(param->GetParameterName(),name)==0){261 /*FUNCTION Parameters::FindParamMat* pmat,int enum_type){{{1*/ 262 int Parameters::FindParam(Mat* pmat,int enum_type){ 263 264 /*Go through a dataset, and find a Param* object 265 *which parameter name is "name" : */ 266 267 vector<Object*>::iterator object; 268 Param* param=NULL; 269 270 int found=0; 271 272 for ( object=objects.begin() ; object < objects.end(); object++ ){ 273 274 /*Find param type objects: */ 275 if((*object)->Enum()==ParamEnum){ 276 277 /*Ok, this object is a parameter, recover it and ask which name it has: */ 278 param=(Param*)(*object); 279 280 if(param->EnumType()==enum_type){ 242 281 /*Ok, this is the one! Recover the value of this parameter: */ 243 282 param->GetParameterValue(pmat); … … 252 291 /*}}}*/ 253 292 /*FUNCTION Parameters::FindParamObject{{{1*/ 254 Object* Parameters::FindParamObject(char* name){255 256 /*Go through a dataset, and find a Param* object 257 *which parameter name is "name" : */ 258 259 vector<Object*>::iterator object; 260 Param* param=NULL; 261 262 for ( object=objects.begin() ; object < objects.end(); object++ ){ 263 264 /*Find param type objects: */ 265 if((*object)->Enum()==ParamEnum){ 266 267 /*Ok, this object is a parameter, recover it and ask which name it has: */ 268 param=(Param*)(*object); 269 270 if (strcmp(param->GetParameterName(),name)==0){293 Object* Parameters::FindParamObject(int enum_type){ 294 295 /*Go through a dataset, and find a Param* object 296 *which parameter name is "name" : */ 297 298 vector<Object*>::iterator object; 299 Param* param=NULL; 300 301 for ( object=objects.begin() ; object < objects.end(); object++ ){ 302 303 /*Find param type objects: */ 304 if((*object)->Enum()==ParamEnum){ 305 306 /*Ok, this object is a parameter, recover it and ask which name it has: */ 307 param=(Param*)(*object); 308 309 if(param->EnumType()==enum_type){ 271 310 /*Ok, this is the one! Return the object: */ 272 311 return (*object); -
issm/trunk/src/c/DataSet/Parameters.h
r3621 r3673 18 18 /*}}}*/ 19 19 /*numerics: {{{1*/ 20 int FindParam(double* pscalar, char* name); 21 int FindParam(int* pinteger,char* name); 22 int FindParam(char** pstring,char* name); 23 int FindParam(char*** pstringarray,int* pM,char* name); 24 int FindParam(double** pdoublearray,int* pM,int* pN,char* name); 25 int FindParam(Vec* pvec,char* name); 26 int FindParam(Mat* pmat,char* name); 20 int FindParam(double* pscalar, int enum_type); 21 int FindParam(int* pinteger,int enum_type); 22 int FindParam(char** pstring,int enum_type); 23 int FindParam(char*** pstringarray,int* pM,int enum_type); 24 int FindParam(double** pdoublearray,int* pM,int enum_type); 25 int FindParam(double** pdoublearray,int* pM,int* pN,int enum_type); 26 int FindParam(Vec* pvec,int enum_type); 27 int FindParam(Mat* pmat,int enum_type); 28 Object* FindParamObject(int enum_type); 27 29 /*}}}*/ 28 30 -
issm/trunk/src/c/Dofx/Dofx.cpp
r3476 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* params) {12 int Dofx( DofVec** ppartition, DofVec** ptpartition, DataSet* elements,DataSet* nodes, DataSet* vertices, Parameters* parameters) { 13 13 14 14 int noerr=1; … … 36 36 37 37 /*First, recover number of vertices and nodes from parameters: */ 38 found=param s->FindParam(&numberofvertices,"numberofvertices");38 found=parameters->FindParam(&numberofvertices,"numberofvertices"); 39 39 if(!found)ISSMERROR(" could not find numberofvertices in parameters"); 40 40 41 found=param s->FindParam(&numberofnodes,"numberofnodes");41 found=parameters->FindParam(&numberofnodes,"numberofnodes"); 42 42 if(!found)ISSMERROR(" could not find numberofnodes in parameters"); 43 43 44 44 /*Recover number of dofs per node: */ 45 found=param s->FindParam(&numberofdofspernode,"numberofdofspernode");45 found=parameters->FindParam(&numberofdofspernode,"numberofdofspernode"); 46 46 if(!found)ISSMERROR(" could not find numberofdofspernode in parameters"); 47 47 -
issm/trunk/src/c/Dofx/Dofx.h
r3446 r3673 10 10 11 11 /* local prototypes: */ 12 int Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* verticesin, DataSet* params);12 int Dofx( DofVec** partition, DofVec** ptpartition,DataSet* elements,DataSet* nodesin, DataSet* verticesin, Parameters* parameters); 13 13 14 14 #endif /* _DOFX_H */ -
issm/trunk/src/c/Dux/Dux.cpp
r3502 r3673 11 11 #include "../SurfaceAreax/SurfaceAreax.h" 12 12 13 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,14 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){13 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 14 int analysis_type,int sub_analysis_type){ 15 15 16 16 /*Intermediary*/ … … 29 29 parameters->Configure(elements,loads, nodes, vertices, materials,parameters); 30 30 31 /*If fit=3, compute Surface Area*/ 32 if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter"); 33 if (fit==3 && !inputs->IsPresent("surfacearea")){ 31 /*Compute surface area: */ 32 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type); 34 33 35 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,inputs,analysis_type,sub_analysis_type); 36 inputs->Add("surfacearea",S); 37 } 38 34 /*add surface area to elements :*/ 35 elements->AddInput(S,SurfaceAreaEnum); 36 39 37 /*Get size of matrix: */ 40 38 gsize=nodes->NumberOfDofs(); … … 44 42 45 43 /*Compute velocity difference: */ 46 elements->Du(du_g, inputs,analysis_type,sub_analysis_type);44 elements->Du(du_g,analysis_type,sub_analysis_type); 47 45 48 46 /*Assemble vector: */ -
issm/trunk/src/c/Dux/Dux.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,12 void Dux( Vec* pdu_g, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.cpp
r3567 r3673 17 17 } 18 18 int EnumIsMaterial(int en){ 19 if ((en>=MaterialEnum) && (en<= NumparEnum))return 1;19 if ((en>=MaterialEnum) && (en<=MatparEnum))return 1; 20 20 else return 0; 21 21 } -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r3647 r3673 22 22 /*Analysis types {{{1 */ 23 23 AnalysisEnum, 24 AnalysisTypeEnum, 25 SubAnalysisTypeEnum, 24 26 //diagnostic 25 27 DiagnosticAnalysisEnum, … … 99 101 MaticeEnum, 100 102 MatparEnum, 101 NumparEnum,102 103 /*Inputs: */ 103 104 InputEnum, … … 111 112 /*Params: */ 112 113 ParamEnum, 114 BoolParamEnum, 115 IntParamEnum, 116 DoubleParamEnum, 113 117 /*Results: */ 114 118 ResultEnum, … … 187 191 FillEnum, 188 192 InternalEnum, 189 BoundaryEnum 193 MaxPenetrationEnum, 194 BoundaryEnum, 195 DtEnum, 196 ArtDiffEnum, 197 CmNoiseDmpEnum, 198 CmMinDmpValueEnum, 199 CmMaxDmpValueEnum, 200 CmMinDmpSlopeEnum, 201 CmMaxDmpSlopeEnum, 202 ControlTypeEnum, 203 ViscosityOvershootEnum, 204 MeanVelEnum, 205 EpsVelEnum, 206 StokesReconditioningEnum, 207 StabilizeConstraintsEnum, 208 PenaltyOffsetEnum 190 209 /*}}}*/ 191 210 -
issm/trunk/src/c/FieldAverageOntoVerticesx/FieldAverageOntoVerticesx.cpp
r3556 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void FieldAverageOntoVerticesx(Vec* pfield, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters){12 void FieldAverageOntoVerticesx(Vec* pfield, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters){ 13 13 14 14 extern int my_rank; -
issm/trunk/src/c/FieldAverageOntoVerticesx/FieldAverageOntoVerticesx.h
r3556 r3673 9 9 10 10 /* local prototypes: */ 11 void FieldAverageOntoVerticesx(Vec* field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters);11 void FieldAverageOntoVerticesx(Vec* field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters); 12 12 13 13 #endif /* _FIELDDEPTHAVERAGEX_H */ -
issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.cpp
r3446 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname){12 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* fieldname){ 13 13 14 14 double* field_serial=NULL; -
issm/trunk/src/c/FieldDepthAveragex/FieldDepthAveragex.h
r3446 r3673 9 9 10 10 /* local prototypes: */ 11 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* fieldname);11 void FieldDepthAveragex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* fieldname); 12 12 13 13 #endif /* _FIELDDEPTHAVERAGEX_H */ -
issm/trunk/src/c/FieldExtrudex/FieldExtrudex.cpp
r3446 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name,int collapse){12 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* field_name,int collapse){ 13 13 14 14 double* field_serial=NULL; -
issm/trunk/src/c/FieldExtrudex/FieldExtrudex.h
r3446 r3673 9 9 10 10 /* local prototypes: */ 11 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,char* field_name, int collapse);11 void FieldExtrudex( Vec field, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,char* field_name, int collapse); 12 12 13 13 #endif /* _FIELDEXTRUDEX_H */ -
issm/trunk/src/c/Gradjx/Gradjx.cpp
r3502 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,13 ParameterInputs* inputs,int analysis_type,int sub_analysis_type,char* control_type){12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 int analysis_type,int sub_analysis_type,char* control_type){ 14 14 15 15 /*output: */ … … 25 25 26 26 /*Compute gradients: */ 27 elements->Gradj(grad_g, inputs,analysis_type,sub_analysis_type,control_type);27 elements->Gradj(grad_g,analysis_type,sub_analysis_type,control_type); 28 28 29 29 /*Assemble vector: */ -
issm/trunk/src/c/Gradjx/Gradjx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,12 void Gradjx( Vec* pgrad_g, int numberofnodes, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type,char* control_type); 14 14 -
issm/trunk/src/c/Makefile.am
r3642 r3673 61 61 ./objects/Tria.h\ 62 62 ./objects/Tria.cpp\ 63 ./objects/TriaVertexInput.h\ 64 ./objects/TriaVertexInput.cpp\ 65 ./objects/SingVertexInput.h\ 66 ./objects/SingVertexInput.cpp\ 67 ./objects/BeamVertexInput.h\ 68 ./objects/BeamVertexInput.cpp\ 69 ./objects/PentaVertexInput.h\ 70 ./objects/PentaVertexInput.cpp\ 71 ./objects/BoolInput.h\ 72 ./objects/BoolInput.cpp\ 73 ./objects/IntInput.h\ 74 ./objects/IntInput.cpp\ 75 ./objects/DoubleInput.h\ 76 ./objects/DoubleInput.cpp\ 63 ./objects/InputObjects/Input.h\ 64 ./objects/InputObjects/TriaVertexInput.h\ 65 ./objects/InputObjects/TriaVertexInput.cpp\ 66 ./objects/InputObjects/SingVertexInput.h\ 67 ./objects/InputObjects/SingVertexInput.cpp\ 68 ./objects/InputObjects/BeamVertexInput.h\ 69 ./objects/InputObjects/BeamVertexInput.cpp\ 70 ./objects/InputObjects/PentaVertexInput.h\ 71 ./objects/InputObjects/PentaVertexInput.cpp\ 72 ./objects/InputObjects/BoolInput.h\ 73 ./objects/InputObjects/BoolInput.cpp\ 74 ./objects/InputObjects/IntInput.h\ 75 ./objects/InputObjects/IntInput.cpp\ 76 ./objects/InputObjects/DoubleInput.h\ 77 ./objects/InputObjects/DoubleInput.cpp\ 77 78 ./objects/Sing.h\ 78 79 ./objects/Sing.cpp\ … … 85 86 ./objects/Matpar.h\ 86 87 ./objects/Matpar.cpp\ 87 ./objects/Input.h\88 88 ./objects/Spc.cpp\ 89 89 ./objects/Spc.h\ … … 100 100 ./objects/Numericalflux.cpp\ 101 101 ./objects/Numericalflux.h\ 102 ./objects/Param.cpp\ 103 ./objects/Param.h\ 102 ./objects/ParamObjects/Param.h\ 103 ./objects/ParamObjects/BoolParam.cpp\ 104 ./objects/ParamObjects/BoolParam.h\ 105 ./objects/ParamObjects/IntParam.cpp\ 106 ./objects/ParamObjects/IntParam.h\ 107 ./objects/ParamObjects/DoubleParam.cpp\ 108 ./objects/ParamObjects/DoubleParam.h\ 109 ./objects/ParamObjects/PetscMatParam.cpp\ 110 ./objects/ParamObjects/PetscMatParam.h\ 111 ./objects/ParamObjects/StringArrayParam.cpp\ 112 ./objects/ParamObjects/StringArrayParam.h\ 113 ./objects/ParamObjects/DoubleMatParam.cpp\ 114 ./objects/ParamObjects/DoubleMatParam.h\ 115 ./objects/ParamObjects/DoubleVecParam.cpp\ 116 ./objects/ParamObjects/DoubleVecParam.h\ 117 ./objects/ParamObjects/PetscVecParam.cpp\ 118 ./objects/ParamObjects/PetscVecParam.h\ 119 ./objects/ParamObjects/StringParam.cpp\ 120 ./objects/ParamObjects/StringParam.h\ 104 121 ./objects/NodeSets.cpp\ 105 122 ./objects/NodeSets.h\ … … 476 493 ./objects/Tria.h\ 477 494 ./objects/Tria.cpp\ 478 ./objects/TriaVertexInput.h\ 479 ./objects/TriaVertexInput.cpp\ 480 ./objects/SingVertexInput.h\ 481 ./objects/SingVertexInput.cpp\ 482 ./objects/BeamVertexInput.h\ 483 ./objects/BeamVertexInput.cpp\ 484 ./objects/PentaVertexInput.h\ 485 ./objects/PentaVertexInput.cpp\ 486 ./objects/BoolInput.h\ 487 ./objects/BoolInput.cpp\ 488 ./objects/IntInput.h\ 489 ./objects/IntInput.cpp\ 490 ./objects/DoubleInput.h\ 491 ./objects/DoubleInput.cpp\ 495 ./objects/InputObjects/Input.h\ 496 ./objects/InputObjects/TriaVertexInput.h\ 497 ./objects/InputObjects/TriaVertexInput.cpp\ 498 ./objects/InputObjects/SingVertexInput.h\ 499 ./objects/InputObjects/SingVertexInput.cpp\ 500 ./objects/InputObjects/BeamVertexInput.h\ 501 ./objects/InputObjects/BeamVertexInput.cpp\ 502 ./objects/InputObjects/PentaVertexInput.h\ 503 ./objects/InputObjects/PentaVertexInput.cpp\ 504 ./objects/InputObjects/BoolInput.h\ 505 ./objects/InputObjects/BoolInput.cpp\ 506 ./objects/InputObjects/IntInput.h\ 507 ./objects/InputObjects/IntInput.cpp\ 508 ./objects/InputObjects/DoubleInput.h\ 509 ./objects/InputObjects/DoubleInput.cpp\ 492 510 ./objects/Sing.h\ 493 511 ./objects/Sing.cpp\ … … 500 518 ./objects/Matpar.h\ 501 519 ./objects/Matpar.cpp\ 502 ./objects/Input.h\503 520 ./objects/Spc.cpp\ 504 521 ./objects/Spc.h\ … … 515 532 ./objects/Numericalflux.cpp\ 516 533 ./objects/Numericalflux.h\ 517 ./objects/Param.cpp\ 518 ./objects/Param.h\ 534 ./objects/ParamObjects/Param.h\ 535 ./objects/ParamObjects/BoolParam.cpp\ 536 ./objects/ParamObjects/BoolParam.h\ 537 ./objects/ParamObjects/IntParam.cpp\ 538 ./objects/ParamObjects/IntParam.h\ 539 ./objects/ParamObjects/DoubleParam.cpp\ 540 ./objects/ParamObjects/DoubleParam.h\ 541 ./objects/ParamObjects/PetscMatParam.cpp\ 542 ./objects/ParamObjects/PetscMatParam.h\ 543 ./objects/ParamObjects/StringArrayParam.cpp\ 544 ./objects/ParamObjects/StringArrayParam.h\ 545 ./objects/ParamObjects/DoubleMatParam.cpp\ 546 ./objects/ParamObjects/DoubleMatParam.h\ 547 ./objects/ParamObjects/DoubleVecParam.cpp\ 548 ./objects/ParamObjects/DoubleVecParam.h\ 549 ./objects/ParamObjects/PetscVecParam.cpp\ 550 ./objects/ParamObjects/PetscVecParam.h\ 551 ./objects/ParamObjects/StringParam.cpp\ 552 ./objects/ParamObjects/StringParam.h\ 519 553 ./objects/NodeSets.cpp\ 520 554 ./objects/NodeSets.h\ -
issm/trunk/src/c/MassFluxx/MassFluxx.cpp
r3446 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters, double* segments,int num_segments,double* ug){12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials,Parameters* parameters, double* segments,int num_segments,double* ug){ 13 13 14 14 int i,j; … … 35 35 for(j=0;j<elements->Size();j++){ 36 36 element=(Element*)elements->GetObjectByOffset(j); 37 if (element-> GetId()==element_id){37 if (element->Id()==element_id){ 38 38 /*We found the element which owns this segment, use it to compute the mass flux: */ 39 39 mass_flux+=element->MassFlux(segments+5*i+0,ug); -
issm/trunk/src/c/MassFluxx/MassFluxx.h
r3446 r3673 10 10 11 11 /* local prototypes: */ 12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,double* segments,int num_segments,double* ug);12 void MassFluxx(double* pmass_flux, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters,double* segments,int num_segments,double* ug); 13 13 14 14 -
issm/trunk/src/c/Misfitx/Misfitx.cpp
r3502 r3673 11 11 #include "../SurfaceAreax/SurfaceAreax.h" 12 12 13 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,14 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){13 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters, 14 int analysis_type,int sub_analysis_type){ 15 15 16 16 /*Intermediary*/ … … 27 27 parameters->Configure(elements,loads, nodes,vertices, materials,parameters); 28 28 29 /*If fit=3, compute Surface Area*/ 30 if(!inputs->Recover("fit",&fit)) ISSMERROR(" missing fit input parameter"); 31 if (fit==3 && !inputs->IsPresent("surfacearea")){ 29 /*Compute surface area: */ 30 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type); 32 31 33 SurfaceAreax(&S,elements,nodes,vertices, loads,materials,parameters,inputs,analysis_type,sub_analysis_type);34 inputs->Add("surfacearea",S);35 }32 /*add surface area to elements :*/ 33 elements->AddInput(S,SurfaceAreaEnum); 34 36 35 37 36 /*Compute Misfit: */ 38 elements->Misfit(&J, inputs,analysis_type,sub_analysis_type);37 elements->Misfit(&J,analysis_type,sub_analysis_type); 39 38 40 39 /*Sum all J from all cpus of the cluster:*/ -
issm/trunk/src/c/Misfitx/Misfitx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,12 void Misfitx( double* pJ, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ModelProcessorx/Balancedthickness/CreateParametersBalancedthickness.cpp
r3633 r3673 9 9 #include "../ModelProcessorx.h" 10 10 11 void CreateParametersBalancedthickness( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){11 void CreateParametersBalancedthickness(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 12 12 13 13 Param* param = NULL; 14 DataSet* parameters=NULL;14 Parameters* parameters=NULL; 15 15 int count; 16 16 int i; … … 44 44 xfree((void**)&u_g); 45 45 46 /*Get melting : */47 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");48 if(iomodel->melting ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;46 /*Get melting_rate: */ 47 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 48 if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; 49 49 50 50 count++; 51 51 param= new Param(count,"m_g",DOUBLEVEC); 52 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);53 else param->SetDoubleVec(iomodel->melting ,0,1);52 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1); 53 else param->SetDoubleVec(iomodel->melting_rate,0,1); 54 54 parameters->AddObject(param); 55 55 56 /*Free melting : */57 xfree((void**)&iomodel->melting );56 /*Free melting_rate: */ 57 xfree((void**)&iomodel->melting_rate); 58 58 59 /*Get accumulation : */60 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");61 if(iomodel->accumulation ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;59 /*Get accumulation_rate: */ 60 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 61 if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts; 62 62 63 63 count++; 64 64 param= new Param(count,"a_g",DOUBLEVEC); 65 if(iomodel->accumulation ) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);66 else param->SetDoubleVec(iomodel->accumulation ,0,0);65 if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1); 66 else param->SetDoubleVec(iomodel->accumulation_rate,0,0); 67 67 parameters->AddObject(param); 68 68 69 /*Free accumulation : */70 xfree((void**)&iomodel->accumulation );69 /*Free accumulation_rate: */ 70 xfree((void**)&iomodel->accumulation_rate); 71 71 72 72 /*Assign output pointer: */ -
issm/trunk/src/c/ModelProcessorx/Balancedthickness2/CreateLoadsBalancedthickness2.cpp
r3633 r3673 14 14 15 15 /*Intermediary*/ 16 int i,j; 17 int i1,i2; 18 int pos1,pos2; 19 double e1,e2; 16 int i; 20 17 21 18 /*Output*/ 22 19 DataSet* loads=NULL; 23 24 /*numericalflux intermediary data: */25 char numericalflux_type[NUMERICALFLUXSTRING];26 int numericalflux_id;27 int numericalflux_node_ids[MAX_NUMERICALFLUX_NODES];28 int numericalflux_elem_id;29 double numericalflux_h[MAX_NUMERICALFLUX_NODES];30 20 31 21 /*Create loads: */ … … 39 29 /*First load data:*/ 40 30 for (i=0;i<iomodel->numberofedges;i++){ 41 42 /*Get left and right elements*/ 43 e1=iomodel->edges[4*i+2]-1; //edges are [node1 node2 elem1 elem2] 44 e2=iomodel->edges[4*i+3]-1; //edges are [node1 node2 elem1 elem2] 45 46 /*Now, if this element is not in the partition, pass: */ 47 if(!iomodel->my_elements[(int)e1]) continue; 48 49 /*Create load*/ 50 numericalflux_id=i+1; //Matlab indexing 51 numericalflux_elem_id=(int)e1+1;//id is in matlab index 52 53 /*1: Get vertices ids*/ 54 i1=(int)iomodel->edges[4*i+0]; 55 i2=(int)iomodel->edges[4*i+1]; 56 57 if (!isnan(e2)){ 58 strcpy(numericalflux_type,"internal"); 59 60 /*Now, we must get the nodes of the 4 nodes located on the edge*/ 61 62 /*2: Get the column where these ids are located in the index*/ 63 pos1=pos2=UNDEF; 64 for(j=0;j<3;j++){ 65 if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1; 66 if (iomodel->elements[3*(int)e2+j]==i1) pos2=j+1; 67 } 68 ISSMASSERT(pos1!=UNDEF && pos2!=UNDEF); 69 70 /*3: We have the id of the elements and the position of the vertices in the index 71 * we can compute their dofs!*/ 72 numericalflux_node_ids[0]=3*(int)e1+pos1; //ex: 1 2 3 73 numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1; //ex: 2 3 1 74 numericalflux_node_ids[2]=3*(int)e2+pos2; //ex: 1 2 3 75 numericalflux_node_ids[3]=3*(int)e2+((pos2+1)%3)+1; //ex: 3 1 2 76 77 numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1] -1]; 78 numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1]; 79 numericalflux_h[2]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[2]-1]-1]; 80 numericalflux_h[3]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[3]-1]-1]; 81 } 82 else{ 83 strcpy(numericalflux_type,"boundary"); 84 85 /*2: Get the column where these ids are located in the index*/ 86 pos1==UNDEF; 87 for(j=0;j<3;j++){ 88 if (iomodel->elements[3*(int)e1+j]==i1) pos1=j+1; 89 } 90 ISSMASSERT(pos1!=UNDEF); 91 92 /*3: We have the id of the elements and the position of the vertices in the index 93 * we can compute their dofs!*/ 94 numericalflux_node_ids[0]=3*(int)e1+pos1; 95 numericalflux_node_ids[1]=3*(int)e1+(pos1%3)+1; 96 97 numericalflux_h[0]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[0]-1]-1]; 98 numericalflux_h[1]=iomodel->thickness[(int)iomodel->elements[numericalflux_node_ids[1]-1]-1]; 99 numericalflux_h[2]=UNDEF; 100 numericalflux_h[3]=UNDEF; 101 } 102 103 loads->AddObject(new Numericalflux(numericalflux_id,numericalflux_type,numericalflux_node_ids,numericalflux_elem_id,numericalflux_h)); 31 loads->AddObject(new Numericalflux(i+1,i,iomodel)); 104 32 } 105 33 -
issm/trunk/src/c/ModelProcessorx/Balancedthickness2/CreateParametersBalancedthickness2.cpp
r3633 r3673 10 10 #include "../ModelProcessorx.h" 11 11 12 void CreateParametersBalancedthickness2( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){12 void CreateParametersBalancedthickness2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 13 13 14 14 Param* param = NULL; 15 DataSet* parameters=NULL;15 Parameters* parameters=NULL; 16 16 int count; 17 17 int i; … … 74 74 xfree((void**)&iomodel->dhdt); 75 75 76 /*Get melting : */77 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");78 if(iomodel->melting ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;76 /*Get melting_rate: */ 77 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 78 if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; 79 79 80 80 count++; 81 81 param= new Param(count,"m_g",DOUBLEVEC); 82 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);83 else param->SetDoubleVec(iomodel->melting ,0,1);82 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1); 83 else param->SetDoubleVec(iomodel->melting_rate,0,1); 84 84 parameters->AddObject(param); 85 85 86 /*Free melting : */87 xfree((void**)&iomodel->melting );86 /*Free melting_rate: */ 87 xfree((void**)&iomodel->melting_rate); 88 88 89 /*Get accumulation : */90 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");91 if(iomodel->accumulation ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;89 /*Get accumulation_rate: */ 90 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 91 if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts; 92 92 93 93 count++; 94 94 param= new Param(count,"a_g",DOUBLEVEC); 95 if(iomodel->accumulation ) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);96 else param->SetDoubleVec(iomodel->accumulation ,0,0);95 if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1); 96 else param->SetDoubleVec(iomodel->accumulation_rate,0,0); 97 97 parameters->AddObject(param); 98 98 99 /*Free accumulation : */100 xfree((void**)&iomodel->accumulation );99 /*Free accumulation_rate: */ 100 xfree((void**)&iomodel->accumulation_rate); 101 101 102 102 /*Assign output pointer: */ -
issm/trunk/src/c/ModelProcessorx/Balancedvelocities/CreateParametersBalancedvelocities.cpp
r3633 r3673 10 10 #include "../ModelProcessorx.h" 11 11 12 void CreateParametersBalancedvelocities( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){12 void CreateParametersBalancedvelocities(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 13 13 14 14 Param* param = NULL; 15 DataSet* parameters=NULL;15 Parameters* parameters=NULL; 16 16 int count; 17 17 int i; … … 56 56 xfree((void**)&iomodel->thickness); 57 57 58 /*Get melting : */59 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");60 if(iomodel->melting ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;58 /*Get melting_rate: */ 59 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 60 if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; 61 61 62 62 count++; 63 63 param= new Param(count,"m_g",DOUBLEVEC); 64 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);65 else param->SetDoubleVec(iomodel->melting ,0,1);64 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1); 65 else param->SetDoubleVec(iomodel->melting_rate,0,1); 66 66 parameters->AddObject(param); 67 67 68 /*Free melting : */69 xfree((void**)&iomodel->melting );68 /*Free melting_rate: */ 69 xfree((void**)&iomodel->melting_rate); 70 70 71 /*Get accumulation : */72 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");73 if(iomodel->accumulation ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;71 /*Get accumulation_rate: */ 72 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 73 if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts; 74 74 75 75 count++; 76 76 param= new Param(count,"a_g",DOUBLEVEC); 77 if(iomodel->accumulation ) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);78 else param->SetDoubleVec(iomodel->accumulation ,0,0);77 if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1); 78 else param->SetDoubleVec(iomodel->accumulation_rate,0,0); 79 79 parameters->AddObject(param); 80 80 81 /*Free accumulation : */82 xfree((void**)&iomodel->accumulation );81 /*Free accumulation_rate: */ 82 xfree((void**)&iomodel->accumulation_rate); 83 83 84 84 -
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r3633 r3673 11 11 #include "../ModelProcessorx.h" 12 12 13 void CreateParametersControl( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){13 void CreateParametersControl(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 15 int i; 16 16 17 DataSet* parameters=NULL;17 Parameters* parameters=NULL; 18 18 Param* param = NULL; 19 19 int count; -
issm/trunk/src/c/ModelProcessorx/CreateDataSets.cpp
r3621 r3673 13 13 #include "../include/macros.h" 14 14 #include "../EnumDefinitions/EnumDefinitions.h" 15 #include "./ModelProcessorx/ModelProcessorx.h" 15 16 16 17 -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r3621 r3673 11 11 #include "./IoModel.h" 12 12 13 void CreateParameters( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){13 void CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 15 int i; 16 16 17 DataSet* parameters = NULL;17 Parameters* parameters = NULL; 18 18 Param* param = NULL; 19 Numpar* numpar=NULL;20 19 int count=0; 21 20 int numberofdofspernode; … … 30 29 31 30 /*Initialize dataset: */ 32 parameters = new DataSet(ParametersEnum);31 parameters = new Parameters(ParametersEnum); 33 32 34 33 //outputfilename … … 37 36 param->SetString(iomodel->outputfilename); 38 37 parameters->AddObject(param); 38 39 39 40 40 //dimension 2d or 3d: -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp
r3633 r3673 10 10 #include "../ModelProcessorx.h" 11 11 12 void CreateParametersDiagnosticHoriz( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){12 void CreateParametersDiagnosticHoriz(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 13 13 14 14 Param* param = NULL; 15 DataSet* parameters=NULL;15 Parameters* parameters=NULL; 16 16 int count; 17 17 int i; -
issm/trunk/src/c/ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp
r3633 r3673 46 46 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 47 47 IoModelFetchData(&iomodel->uppernodes,NULL,NULL,iomodel_handle,"uppergrids"); 48 IoModelFetchData(&iomodel->drag ,NULL,NULL,iomodel_handle,"drag");49 IoModelFetchData(&iomodel-> B,NULL,NULL,iomodel_handle,"B");50 IoModelFetchData(&iomodel-> n,NULL,NULL,iomodel_handle,"n");48 IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient"); 49 IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B"); 50 IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n"); 51 51 52 52 /*2d mesh: */ … … 97 97 xfree((void**)&iomodel->gridonsurface); 98 98 xfree((void**)&iomodel->uppernodes); 99 xfree((void**)&iomodel->drag );100 xfree((void**)&iomodel-> B);101 xfree((void**)&iomodel-> n);99 xfree((void**)&iomodel->drag_coefficient); 100 xfree((void**)&iomodel->rheology_B); 101 xfree((void**)&iomodel->rheology_n); 102 102 103 103 /*Add new constrant material property to materials, at the end: */ … … 108 108 materials->AddObject(new Matpar(iomodel->numberofvertices2d*(iomodel->numlayers-1)+1,iomodel)); //put it at the end of the materials 109 109 } 110 }111 110 112 111 /*First fetch data: */ -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp
r3633 r3673 43 43 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 44 44 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 45 IoModelFetchData(&iomodel->drag ,NULL,NULL,iomodel_handle,"drag");46 IoModelFetchData(&iomodel-> p,NULL,NULL,iomodel_handle,"p");47 IoModelFetchData(&iomodel-> q,NULL,NULL,iomodel_handle,"q");45 IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient"); 46 IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p"); 47 IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q"); 48 48 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 49 49 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 50 50 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 51 51 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 52 IoModelFetchData(&iomodel-> B,NULL,NULL,iomodel_handle,"B");53 IoModelFetchData(&iomodel-> n,NULL,NULL,iomodel_handle,"n");54 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");55 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");52 IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B"); 53 IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n"); 54 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 55 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 56 56 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 57 57 … … 77 77 xfree((void**)&iomodel->surface); 78 78 xfree((void**)&iomodel->bed); 79 xfree((void**)&iomodel->drag );80 xfree((void**)&iomodel-> p);81 xfree((void**)&iomodel-> q);79 xfree((void**)&iomodel->drag_coefficient); 80 xfree((void**)&iomodel->drag_p); 81 xfree((void**)&iomodel->drag_q); 82 82 xfree((void**)&iomodel->elementoniceshelf); 83 83 xfree((void**)&iomodel->elementonbed); 84 84 xfree((void**)&iomodel->elementonsurface); 85 85 xfree((void**)&iomodel->elements_type); 86 xfree((void**)&iomodel-> n);87 xfree((void**)&iomodel-> B);88 xfree((void**)&iomodel->accumulation );89 xfree((void**)&iomodel->melting );86 xfree((void**)&iomodel->rheology_n); 87 xfree((void**)&iomodel->rheology_B); 88 xfree((void**)&iomodel->accumulation_rate); 89 xfree((void**)&iomodel->melting_rate); 90 90 xfree((void**)&iomodel->elementonwater); 91 91 -
issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp
r3636 r3673 53 53 54 54 /*Create and add load: */ 55 loads->AddObject(new Icefront( i,iomodel));55 loads->AddObject(new Icefront(counter,i,iomodel)); 56 56 counter++; 57 57 … … 68 68 IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet"); 69 69 IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes"); 70 iomodel->CreateSingleNodeToElementConnectivity ;70 iomodel->CreateSingleNodeToElementConnectivity(); 71 71 72 72 for (i=0;i<iomodel->numberofvertices;i++){ -
issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp
r3633 r3673 45 45 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 46 46 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 47 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");48 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");47 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 48 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 49 49 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 50 50 … … 72 72 xfree((void**)&iomodel->elementonsurface); 73 73 xfree((void**)&iomodel->elements_type); 74 xfree((void**)&iomodel->melting );75 xfree((void**)&iomodel->accumulation );74 xfree((void**)&iomodel->melting_rate); 75 xfree((void**)&iomodel->accumulation_rate); 76 76 xfree((void**)&iomodel->elementonwater); 77 77 -
issm/trunk/src/c/ModelProcessorx/IoModel.cpp
r3633 r3673 36 36 37 37 #ifdef _PARALLEL_ 38 xfree((void**)& iomodel->x);39 xfree((void**)& iomodel->y);40 xfree((void**)& iomodel->z);41 xfree((void**)& iomodel->elements);42 xfree((void**)& iomodel->elements_type);43 xfree((void**)& iomodel->gridonhutter);44 xfree((void**)& iomodel->gridonmacayeal);45 if (strcmp( iomodel->meshtype,"3d")==0){46 xfree((void**)& iomodel->elements2d);47 xfree((void**)& iomodel->deadgrids);48 xfree((void**)& iomodel->uppernodes);49 xfree((void**)& iomodel->gridonpattyn);38 xfree((void**)&this->x); 39 xfree((void**)&this->y); 40 xfree((void**)&this->z); 41 xfree((void**)&this->elements); 42 xfree((void**)&this->elements_type); 43 xfree((void**)&this->gridonhutter); 44 xfree((void**)&this->gridonmacayeal); 45 if (strcmp(this->meshtype,"3d")==0){ 46 xfree((void**)&this->elements2d); 47 xfree((void**)&this->deadgrids); 48 xfree((void**)&this->uppernodes); 49 xfree((void**)&this->gridonpattyn); 50 50 } 51 xfree((void**)& iomodel->solverstring);52 xfree((void**)& iomodel->elementonbed);53 xfree((void**)& iomodel->elementonsurface);54 xfree((void**)& iomodel->gridonbed);55 xfree((void**)& iomodel->gridonsurface);56 xfree((void**)& iomodel->gridonstokes);57 xfree((void**)& iomodel->borderstokes);58 xfree((void**)& iomodel->thickness);59 xfree((void**)& iomodel->surface);60 xfree((void**)& iomodel->bed);61 xfree((void**)& iomodel->vx_obs);62 xfree((void**)& iomodel->vy_obs);63 xfree((void**)& iomodel->vx);64 xfree((void**)& iomodel->vy);65 xfree((void**)& iomodel->vz);66 xfree((void**)& iomodel->pressure);67 xfree((void**)& iomodel->temperature);68 xfree((void**)& iomodel->drag_coefficient);69 xfree((void**)& iomodel->drag_p);70 xfree((void**)& iomodel->drag_q);71 xfree((void**)& iomodel->elementoniceshelf);72 xfree((void**)& iomodel->elementonwater);73 xfree((void**)& iomodel->gridonicesheet);74 xfree((void**)& iomodel->gridoniceshelf);75 xfree((void**)& iomodel->pressureload);76 xfree((void**)& iomodel->spcvelocity);77 xfree((void**)& iomodel->spcthickness);78 xfree((void**)& iomodel->spctemperature);79 xfree((void**)& iomodel->edges);80 xfree((void**)& iomodel->geothermalflux);81 xfree((void**)& iomodel->melting_rate);82 xfree((void**)& iomodel->accumulation_rate);83 xfree((void**)& iomodel->dhdt);84 xfree((void**)& iomodel->rheology_B);85 xfree((void**)& iomodel->rheology_n);86 xfree((void**)& iomodel->fit);87 xfree((void**)& iomodel->weights);88 xfree((void**)& iomodel->cm_jump);89 xfree((void**)& iomodel->optscal);90 xfree((void**)& iomodel->maxiter);51 xfree((void**)&this->solverstring); 52 xfree((void**)&this->elementonbed); 53 xfree((void**)&this->elementonsurface); 54 xfree((void**)&this->gridonbed); 55 xfree((void**)&this->gridonsurface); 56 xfree((void**)&this->gridonstokes); 57 xfree((void**)&this->borderstokes); 58 xfree((void**)&this->thickness); 59 xfree((void**)&this->surface); 60 xfree((void**)&this->bed); 61 xfree((void**)&this->vx_obs); 62 xfree((void**)&this->vy_obs); 63 xfree((void**)&this->vx); 64 xfree((void**)&this->vy); 65 xfree((void**)&this->vz); 66 xfree((void**)&this->pressure); 67 xfree((void**)&this->temperature); 68 xfree((void**)&this->drag_coefficient); 69 xfree((void**)&this->drag_p); 70 xfree((void**)&this->drag_q); 71 xfree((void**)&this->elementoniceshelf); 72 xfree((void**)&this->elementonwater); 73 xfree((void**)&this->gridonicesheet); 74 xfree((void**)&this->gridoniceshelf); 75 xfree((void**)&this->pressureload); 76 xfree((void**)&this->spcvelocity); 77 xfree((void**)&this->spcthickness); 78 xfree((void**)&this->spctemperature); 79 xfree((void**)&this->edges); 80 xfree((void**)&this->geothermalflux); 81 xfree((void**)&this->melting_rate); 82 xfree((void**)&this->accumulation_rate); 83 xfree((void**)&this->dhdt); 84 xfree((void**)&this->rheology_B); 85 xfree((void**)&this->rheology_n); 86 xfree((void**)&this->fit); 87 xfree((void**)&this->weights); 88 xfree((void**)&this->cm_jump); 89 xfree((void**)&this->optscal); 90 xfree((void**)&this->maxiter); 91 91 92 92 93 93 /*!Delete structure fields: */ 94 xfree((void**)& iomodel->inputfilename);95 xfree((void**)& iomodel->outputfilename);96 xfree((void**)& iomodel->repository);97 xfree((void**)& iomodel->meshtype);98 xfree((void**)& iomodel->name);99 100 xfree((void**)& iomodel->riftinfo);101 102 xfree((void**)& iomodel->penalties);103 xfree((void**)& iomodel->penaltypartitioning);104 105 xfree((void**)& iomodel->control_type);94 xfree((void**)&this->inputfilename); 95 xfree((void**)&this->outputfilename); 96 xfree((void**)&this->repository); 97 xfree((void**)&this->meshtype); 98 xfree((void**)&this->name); 99 100 xfree((void**)&this->riftinfo); 101 102 xfree((void**)&this->penalties); 103 xfree((void**)&this->penaltypartitioning); 104 105 xfree((void**)&this->control_type); 106 106 107 107 /*exterior data: */ 108 xfree((void**)& iomodel->my_elements);109 xfree((void**)& iomodel->my_vertices);110 xfree((void**)& iomodel->my_nodes);111 xfree((void**)& iomodel->my_bordervertices);112 xfree((void**)& iomodel->penaltypartitioning);108 xfree((void**)&this->my_elements); 109 xfree((void**)&this->my_vertices); 110 xfree((void**)&this->my_nodes); 111 xfree((void**)&this->my_bordervertices); 112 xfree((void**)&this->penaltypartitioning); 113 113 #endif 114 114 } … … 124 124 /*Get all the data that consists of scalars, integers and strings: */ 125 125 126 IoModelFetchData(& iomodel->name,iomodel_handle,"name");127 IoModelFetchData(& iomodel->inputfilename,iomodel_handle,"inputfilename");128 IoModelFetchData(& iomodel->outputfilename,iomodel_handle,"outputfilename");129 IoModelFetchData(& iomodel->analysis_type,iomodel_handle,"analysis_type");130 IoModelFetchData(& iomodel->sub_analysis_type,iomodel_handle,"sub_analysis_type");131 IoModelFetchData(& iomodel->qmu_analysis,iomodel_handle,"qmu_analysis");132 IoModelFetchData(& iomodel->control_analysis,iomodel_handle,"control_analysis");133 IoModelFetchData(& iomodel->meshtype,iomodel_handle,"type");126 IoModelFetchData(&this->name,iomodel_handle,"name"); 127 IoModelFetchData(&this->inputfilename,iomodel_handle,"inputfilename"); 128 IoModelFetchData(&this->outputfilename,iomodel_handle,"outputfilename"); 129 IoModelFetchData(&this->analysis_type,iomodel_handle,"analysis_type"); 130 IoModelFetchData(&this->sub_analysis_type,iomodel_handle,"sub_analysis_type"); 131 IoModelFetchData(&this->qmu_analysis,iomodel_handle,"qmu_analysis"); 132 IoModelFetchData(&this->control_analysis,iomodel_handle,"control_analysis"); 133 IoModelFetchData(&this->meshtype,iomodel_handle,"type"); 134 134 /*!Get numberofelements and numberofvertices: */ 135 IoModelFetchData(& iomodel->numberofvertices,iomodel_handle,"numberofgrids");136 IoModelFetchData(& iomodel->numberofelements,iomodel_handle,"numberofelements");135 IoModelFetchData(&this->numberofvertices,iomodel_handle,"numberofgrids"); 136 IoModelFetchData(&this->numberofelements,iomodel_handle,"numberofelements"); 137 137 /*!In case we are running 3d, we are going to need the collapsed and non-collapsed 2d meshes, from which the 3d mesh was extruded: */ 138 if (strcmp( iomodel->meshtype,"3d")==0){138 if (strcmp(this->meshtype,"3d")==0){ 139 139 140 140 /*!Deal with 2d mesh: */ 141 IoModelFetchData(& iomodel->numberofelements2d,iomodel_handle,"numberofelements2d");142 IoModelFetchData(& iomodel->numberofvertices2d,iomodel_handle,"numberofgrids2d");143 IoModelFetchData(& iomodel->numlayers,iomodel_handle,"numlayers");141 IoModelFetchData(&this->numberofelements2d,iomodel_handle,"numberofelements2d"); 142 IoModelFetchData(&this->numberofvertices2d,iomodel_handle,"numberofgrids2d"); 143 IoModelFetchData(&this->numlayers,iomodel_handle,"numlayers"); 144 144 } 145 145 146 146 147 147 /*elements type: */ 148 IoModelFetchData(& iomodel->ishutter,iomodel_handle,"ishutter");149 IoModelFetchData(& iomodel->ismacayealpattyn,iomodel_handle,"ismacayealpattyn");150 IoModelFetchData(& iomodel->isstokes,iomodel_handle,"isstokes");148 IoModelFetchData(&this->ishutter,iomodel_handle,"ishutter"); 149 IoModelFetchData(&this->ismacayealpattyn,iomodel_handle,"ismacayealpattyn"); 150 IoModelFetchData(&this->isstokes,iomodel_handle,"isstokes"); 151 151 152 152 /*!Get drag_type, drag and p,q: */ 153 IoModelFetchData(& iomodel->drag_type,iomodel_handle,"drag_type");153 IoModelFetchData(&this->drag_type,iomodel_handle,"drag_type"); 154 154 155 155 /*!Get materials: */ 156 IoModelFetchData(& iomodel->rho_water,iomodel_handle,"rho_water");157 IoModelFetchData(& iomodel->rho_ice,iomodel_handle,"rho_ice");158 IoModelFetchData(& iomodel->g,iomodel_handle,"g");156 IoModelFetchData(&this->rho_water,iomodel_handle,"rho_water"); 157 IoModelFetchData(&this->rho_ice,iomodel_handle,"rho_ice"); 158 IoModelFetchData(&this->g,iomodel_handle,"g"); 159 159 160 160 /*Get control parameters: */ 161 IoModelFetchData(& iomodel->control_type,iomodel_handle,"control_type");161 IoModelFetchData(&this->control_type,iomodel_handle,"control_type"); 162 162 163 163 /*!Get solution parameters: */ 164 IoModelFetchData(& iomodel->yts,iomodel_handle,"yts");165 IoModelFetchData(& iomodel->meanvel,iomodel_handle,"meanvel");166 IoModelFetchData(& iomodel->epsvel,iomodel_handle,"epsvel");167 IoModelFetchData(& iomodel->verbose,iomodel_handle,"verbose");168 IoModelFetchData(& iomodel->plot,iomodel_handle,"plot");169 IoModelFetchData(& iomodel->artificial_diffusivity,iomodel_handle,"artificial_diffusivity");170 IoModelFetchData(& iomodel->nsteps,iomodel_handle,"nsteps");171 IoModelFetchData(& iomodel->eps_cm,iomodel_handle,"eps_cm");172 IoModelFetchData(& iomodel->tolx,iomodel_handle,"tolx");173 IoModelFetchData(& iomodel->cm_noisedmp,iomodel_handle,"cm_noisedmp");174 IoModelFetchData(& iomodel->cm_mindmp_value,iomodel_handle,"cm_mindmp_value");175 IoModelFetchData(& iomodel->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope");176 IoModelFetchData(& iomodel->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value");177 IoModelFetchData(& iomodel->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope");178 IoModelFetchData(& iomodel->cm_min,iomodel_handle,"cm_min");179 IoModelFetchData(& iomodel->cm_max,iomodel_handle,"cm_max");180 IoModelFetchData(& iomodel->cm_gradient,iomodel_handle,"cm_gradient");181 IoModelFetchData(& iomodel->eps_res,iomodel_handle,"eps_res");182 IoModelFetchData(& iomodel->eps_rel,iomodel_handle,"eps_rel");183 IoModelFetchData(& iomodel->eps_abs,iomodel_handle,"eps_abs");184 IoModelFetchData(& iomodel->max_nonlinear_iterations,iomodel_handle,"max_nonlinear_iterations");185 IoModelFetchData(& iomodel->dt,iomodel_handle,"dt");186 IoModelFetchData(& iomodel->ndt,iomodel_handle,"ndt");187 IoModelFetchData(& iomodel->penalty_offset,iomodel_handle,"penalty_offset");188 IoModelFetchData(& iomodel->penalty_melting,iomodel_handle,"penalty_melting");189 IoModelFetchData(& iomodel->penalty_lock,iomodel_handle,"penalty_lock");190 IoModelFetchData(& iomodel->sparsity,iomodel_handle,"sparsity");191 IoModelFetchData(& iomodel->connectivity,iomodel_handle,"connectivity");192 IoModelFetchData(& iomodel->lowmem,iomodel_handle,"lowmem");193 IoModelFetchData(& iomodel->solverstring,iomodel_handle,"solverstring");194 IoModelFetchData(& iomodel->viscosity_overshoot,iomodel_handle,"viscosity_overshoot");195 IoModelFetchData(& iomodel->artdiff,iomodel_handle,"artificial_diffusivity");196 IoModelFetchData(& iomodel->stokesreconditioning,iomodel_handle,"stokesreconditioning");197 IoModelFetchData(& iomodel->waitonlock,iomodel_handle,"waitonlock");164 IoModelFetchData(&this->yts,iomodel_handle,"yts"); 165 IoModelFetchData(&this->meanvel,iomodel_handle,"meanvel"); 166 IoModelFetchData(&this->epsvel,iomodel_handle,"epsvel"); 167 IoModelFetchData(&this->verbose,iomodel_handle,"verbose"); 168 IoModelFetchData(&this->plot,iomodel_handle,"plot"); 169 IoModelFetchData(&this->artificial_diffusivity,iomodel_handle,"artificial_diffusivity"); 170 IoModelFetchData(&this->nsteps,iomodel_handle,"nsteps"); 171 IoModelFetchData(&this->eps_cm,iomodel_handle,"eps_cm"); 172 IoModelFetchData(&this->tolx,iomodel_handle,"tolx"); 173 IoModelFetchData(&this->cm_noisedmp,iomodel_handle,"cm_noisedmp"); 174 IoModelFetchData(&this->cm_mindmp_value,iomodel_handle,"cm_mindmp_value"); 175 IoModelFetchData(&this->cm_mindmp_slope,iomodel_handle,"cm_mindmp_slope"); 176 IoModelFetchData(&this->cm_maxdmp_value,iomodel_handle,"cm_maxdmp_value"); 177 IoModelFetchData(&this->cm_maxdmp_slope,iomodel_handle,"cm_maxdmp_slope"); 178 IoModelFetchData(&this->cm_min,iomodel_handle,"cm_min"); 179 IoModelFetchData(&this->cm_max,iomodel_handle,"cm_max"); 180 IoModelFetchData(&this->cm_gradient,iomodel_handle,"cm_gradient"); 181 IoModelFetchData(&this->eps_res,iomodel_handle,"eps_res"); 182 IoModelFetchData(&this->eps_rel,iomodel_handle,"eps_rel"); 183 IoModelFetchData(&this->eps_abs,iomodel_handle,"eps_abs"); 184 IoModelFetchData(&this->max_nonlinear_iterations,iomodel_handle,"max_nonlinear_iterations"); 185 IoModelFetchData(&this->dt,iomodel_handle,"dt"); 186 IoModelFetchData(&this->ndt,iomodel_handle,"ndt"); 187 IoModelFetchData(&this->penalty_offset,iomodel_handle,"penalty_offset"); 188 IoModelFetchData(&this->penalty_melting,iomodel_handle,"penalty_melting"); 189 IoModelFetchData(&this->penalty_lock,iomodel_handle,"penalty_lock"); 190 IoModelFetchData(&this->sparsity,iomodel_handle,"sparsity"); 191 IoModelFetchData(&this->connectivity,iomodel_handle,"connectivity"); 192 IoModelFetchData(&this->lowmem,iomodel_handle,"lowmem"); 193 IoModelFetchData(&this->solverstring,iomodel_handle,"solverstring"); 194 IoModelFetchData(&this->viscosity_overshoot,iomodel_handle,"viscosity_overshoot"); 195 IoModelFetchData(&this->artdiff,iomodel_handle,"artificial_diffusivity"); 196 IoModelFetchData(&this->stokesreconditioning,iomodel_handle,"stokesreconditioning"); 197 IoModelFetchData(&this->waitonlock,iomodel_handle,"waitonlock"); 198 198 199 199 /*!Get thermal parameters: */ 200 IoModelFetchData(& iomodel->beta,iomodel_handle,"beta");201 IoModelFetchData(& iomodel->meltingpoint,iomodel_handle,"meltingpoint");202 IoModelFetchData(& iomodel->latentheat,iomodel_handle,"latentheat");203 IoModelFetchData(& iomodel->heatcapacity,iomodel_handle,"heatcapacity");204 IoModelFetchData(& iomodel->thermalconductivity,iomodel_handle,"thermalconductivity");205 IoModelFetchData(& iomodel->min_thermal_constraints,iomodel_handle,"min_thermal_constraints");206 IoModelFetchData(& iomodel->min_mechanical_constraints,iomodel_handle,"min_mechanical_constraints");207 IoModelFetchData(& iomodel->stabilize_constraints,iomodel_handle,"stabilize_constraints");208 IoModelFetchData(& iomodel->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity");209 IoModelFetchData(& iomodel->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity");200 IoModelFetchData(&this->beta,iomodel_handle,"beta"); 201 IoModelFetchData(&this->meltingpoint,iomodel_handle,"meltingpoint"); 202 IoModelFetchData(&this->latentheat,iomodel_handle,"latentheat"); 203 IoModelFetchData(&this->heatcapacity,iomodel_handle,"heatcapacity"); 204 IoModelFetchData(&this->thermalconductivity,iomodel_handle,"thermalconductivity"); 205 IoModelFetchData(&this->min_thermal_constraints,iomodel_handle,"min_thermal_constraints"); 206 IoModelFetchData(&this->min_mechanical_constraints,iomodel_handle,"min_mechanical_constraints"); 207 IoModelFetchData(&this->stabilize_constraints,iomodel_handle,"stabilize_constraints"); 208 IoModelFetchData(&this->mixed_layer_capacity,iomodel_handle,"mixed_layer_capacity"); 209 IoModelFetchData(&this->thermal_exchange_velocity,iomodel_handle,"thermal_exchange_velocity"); 210 210 211 211 /*qmu: */ 212 if( iomodel->qmu_analysis){213 IoModelFetchData(& iomodel->numberofvariables,iomodel_handle,"numberofvariables");214 IoModelFetchData(& iomodel->numberofresponses,iomodel_handle,"numberofresponses");215 IoModelFetchData(& iomodel->qmu_npart,iomodel_handle,"npart");212 if(this->qmu_analysis){ 213 IoModelFetchData(&this->numberofvariables,iomodel_handle,"numberofvariables"); 214 IoModelFetchData(&this->numberofresponses,iomodel_handle,"numberofresponses"); 215 IoModelFetchData(&this->qmu_npart,iomodel_handle,"npart"); 216 216 } 217 217 218 218 /*parameter output : */ 219 IoModelFetchData(&iomodel->numoutput,iomodel_handle,"numoutput"); 220 221 /*Assign output pointers: */ 222 *piomodel=iomodel; 223 224 return 1; 219 IoModelFetchData(&this->numoutput,iomodel_handle,"numoutput"); 225 220 } 226 221 /*}}}*/ … … 229 224 230 225 /*!initialize all pointers to 0: */ 231 iomodel->name=NULL;232 iomodel->inputfilename=NULL;233 iomodel->outputfilename=NULL;234 iomodel->repository=NULL;235 iomodel->meshtype=NULL;236 iomodel->analysis_type=0;237 iomodel->sub_analysis_type=0;238 iomodel->qmu_analysis=0;239 iomodel->control_analysis=0;240 iomodel->solverstring=NULL;241 iomodel->numberofresponses=0;242 iomodel->numberofvariables=0;243 iomodel->qmu_npart=0;244 iomodel->numberofelements=0;245 iomodel->numberofvertices=0;246 iomodel->x=NULL;247 iomodel->y=NULL;248 iomodel->z=NULL;249 iomodel->elements=NULL;250 iomodel->elements_type=NULL;251 iomodel->numberofvertices2d=0;252 iomodel->elements2d=NULL;253 iomodel->deadgrids=NULL;254 iomodel->numlayers=0;255 iomodel->uppernodes=NULL;256 iomodel->gridonhutter=NULL;257 iomodel->gridonmacayeal=NULL;258 iomodel->gridonpattyn=NULL;259 260 iomodel->vx_obs=NULL;261 iomodel->vy_obs=NULL;262 iomodel->vx=NULL;263 iomodel->vy=NULL;264 iomodel->vz=NULL;265 iomodel->pressure=NULL;266 iomodel->temperature=NULL;267 iomodel->melting=NULL;268 iomodel->geothermalflux=NULL;269 iomodel->elementonbed=NULL;270 iomodel->elementonsurface=NULL;271 iomodel->gridonbed=NULL;272 iomodel->gridonsurface=NULL;273 iomodel->gridonstokes=NULL;274 iomodel->borderstokes=NULL;275 iomodel->thickness=NULL;276 iomodel->surface=NULL;277 iomodel->bed=NULL;278 iomodel->elementoniceshelf=NULL;279 iomodel->elementonwater=NULL;280 iomodel->gridonicesheet=NULL;281 iomodel->gridoniceshelf=NULL;282 283 iomodel->drag_type=0;284 iomodel->drag_cofficient=NULL;285 iomodel->drag_p=NULL;286 iomodel->drag_q=NULL;287 288 289 iomodel->numberofpressureloads=0;290 iomodel->pressureload=NULL;291 iomodel-> spcvelocity=NULL;292 iomodel-> spctemperature=NULL;293 iomodel-> spcthickness=NULL;294 iomodel->numberofedges=0;295 iomodel->edges=NULL;226 this->name=NULL; 227 this->inputfilename=NULL; 228 this->outputfilename=NULL; 229 this->repository=NULL; 230 this->meshtype=NULL; 231 this->analysis_type=0; 232 this->sub_analysis_type=0; 233 this->qmu_analysis=0; 234 this->control_analysis=0; 235 this->solverstring=NULL; 236 this->numberofresponses=0; 237 this->numberofvariables=0; 238 this->qmu_npart=0; 239 this->numberofelements=0; 240 this->numberofvertices=0; 241 this->x=NULL; 242 this->y=NULL; 243 this->z=NULL; 244 this->elements=NULL; 245 this->elements_type=NULL; 246 this->numberofvertices2d=0; 247 this->elements2d=NULL; 248 this->deadgrids=NULL; 249 this->numlayers=0; 250 this->uppernodes=NULL; 251 this->gridonhutter=NULL; 252 this->gridonmacayeal=NULL; 253 this->gridonpattyn=NULL; 254 255 this->vx_obs=NULL; 256 this->vy_obs=NULL; 257 this->vx=NULL; 258 this->vy=NULL; 259 this->vz=NULL; 260 this->pressure=NULL; 261 this->temperature=NULL; 262 this->melting_rate=NULL; 263 this->geothermalflux=NULL; 264 this->elementonbed=NULL; 265 this->elementonsurface=NULL; 266 this->gridonbed=NULL; 267 this->gridonsurface=NULL; 268 this->gridonstokes=NULL; 269 this->borderstokes=NULL; 270 this->thickness=NULL; 271 this->surface=NULL; 272 this->bed=NULL; 273 this->elementoniceshelf=NULL; 274 this->elementonwater=NULL; 275 this->gridonicesheet=NULL; 276 this->gridoniceshelf=NULL; 277 278 this->drag_type=0; 279 this->drag_coefficient=NULL; 280 this->drag_p=NULL; 281 this->drag_q=NULL; 282 283 284 this->numberofpressureloads=0; 285 this->pressureload=NULL; 286 this-> spcvelocity=NULL; 287 this-> spctemperature=NULL; 288 this-> spcthickness=NULL; 289 this->numberofedges=0; 290 this->edges=NULL; 296 291 297 292 /*!materials: */ 298 iomodel->rho_water=0;299 iomodel->rho_ice=0;300 iomodel->g=0;301 iomodel->rheology_n=NULL;302 iomodel->rheology_B=NULL;293 this->rho_water=0; 294 this->rho_ice=0; 295 this->g=0; 296 this->rheology_n=NULL; 297 this->rheology_B=NULL; 303 298 304 299 /*!control methods: */ 305 iomodel->control_type=NULL;300 this->control_type=NULL; 306 301 307 302 /*!solution parameters: */ 308 iomodel->fit=NULL;309 iomodel->weights=NULL;310 iomodel->cm_jump=NULL;311 iomodel->meanvel=0;312 iomodel->epsvel=0;313 iomodel->artificial_diffusivity=0;314 iomodel->nsteps=0;315 iomodel->eps_cm=0;316 iomodel->tolx=0;317 iomodel->maxiter=NULL;318 iomodel->cm_noisedmp=0;319 iomodel->cm_mindmp_value=0;320 iomodel->cm_mindmp_slope=0;321 iomodel->cm_maxdmp_value=0;322 iomodel->cm_maxdmp_slope=0;323 iomodel->cm_min=0;324 iomodel->cm_max=0;325 iomodel->cm_gradient=0;326 iomodel->verbose=0;327 iomodel->plot=0;328 iomodel->eps_res=0;329 iomodel->eps_rel=0;330 iomodel->eps_abs=0;331 iomodel->max_nonlinear_iterations=0;332 iomodel->dt=0;333 iomodel->ndt=0;334 iomodel->penalty_offset=0;335 iomodel->penalty_melting=0;336 iomodel->penalty_lock=0;337 iomodel->sparsity=0;338 iomodel->connectivity=0;339 iomodel->lowmem=0;340 iomodel->optscal=NULL;341 iomodel->yts=0;342 iomodel->viscosity_overshoot=0;343 iomodel->artdiff=0;344 iomodel->stokesreconditioning=0;345 iomodel->waitonlock=0;303 this->fit=NULL; 304 this->weights=NULL; 305 this->cm_jump=NULL; 306 this->meanvel=0; 307 this->epsvel=0; 308 this->artificial_diffusivity=0; 309 this->nsteps=0; 310 this->eps_cm=0; 311 this->tolx=0; 312 this->maxiter=NULL; 313 this->cm_noisedmp=0; 314 this->cm_mindmp_value=0; 315 this->cm_mindmp_slope=0; 316 this->cm_maxdmp_value=0; 317 this->cm_maxdmp_slope=0; 318 this->cm_min=0; 319 this->cm_max=0; 320 this->cm_gradient=0; 321 this->verbose=0; 322 this->plot=0; 323 this->eps_res=0; 324 this->eps_rel=0; 325 this->eps_abs=0; 326 this->max_nonlinear_iterations=0; 327 this->dt=0; 328 this->ndt=0; 329 this->penalty_offset=0; 330 this->penalty_melting=0; 331 this->penalty_lock=0; 332 this->sparsity=0; 333 this->connectivity=0; 334 this->lowmem=0; 335 this->optscal=NULL; 336 this->yts=0; 337 this->viscosity_overshoot=0; 338 this->artdiff=0; 339 this->stokesreconditioning=0; 340 this->waitonlock=0; 346 341 347 342 /*!thermal parameters: */ 348 iomodel->beta=0;349 iomodel->meltingpoint=0;350 iomodel->latentheat=0;351 iomodel->heatcapacity=0;352 iomodel->thermalconductivity=0;353 iomodel->min_thermal_constraints=0;354 iomodel->min_mechanical_constraints=0;355 iomodel->stabilize_constraints=0;356 iomodel->mixed_layer_capacity=0;357 iomodel->thermal_exchange_velocity=0;358 359 360 iomodel->numrifts=0;361 iomodel->riftinfo=NULL;343 this->beta=0; 344 this->meltingpoint=0; 345 this->latentheat=0; 346 this->heatcapacity=0; 347 this->thermalconductivity=0; 348 this->min_thermal_constraints=0; 349 this->min_mechanical_constraints=0; 350 this->stabilize_constraints=0; 351 this->mixed_layer_capacity=0; 352 this->thermal_exchange_velocity=0; 353 354 355 this->numrifts=0; 356 this->riftinfo=NULL; 362 357 363 358 /*!penalties: */ 364 iomodel->numpenalties=0;365 iomodel->penalties=NULL;366 iomodel->penaltypartitioning=NULL;359 this->numpenalties=0; 360 this->penalties=NULL; 361 this->penaltypartitioning=NULL; 367 362 368 363 /*!basal: */ 369 iomodel->accumulation_rate=NULL;370 iomodel->dhdt=NULL;364 this->accumulation_rate=NULL; 365 this->dhdt=NULL; 371 366 372 367 /*parameter output: */ 373 iomodel->numoutput=0;368 this->numoutput=0; 374 369 375 370 /*elements type: */ 376 iomodel->ishutter=0;377 iomodel->ismacayealpattyn=0;378 iomodel->isstokes=0;371 this->ishutter=0; 372 this->ismacayealpattyn=0; 373 this->isstokes=0; 379 374 380 375 /*exterior data: */ 381 iomodel->my_elements=NULL;382 iomodel->my_vertices=NULL;383 iomodel->my_nodes=NULL;384 iomodel->my_bordervertices=NULL;385 iomodel->penaltypartitioning=NULL;376 this->my_elements=NULL; 377 this->my_vertices=NULL; 378 this->my_nodes=NULL; 379 this->my_bordervertices=NULL; 380 this->penaltypartitioning=NULL; 386 381 } 387 382 /*}}}*/ … … 394 389 int i,j; 395 390 396 if(which_part==1 && my_rank==rank && (strcmp( iomodel->meshtype,"3d")==0)){391 if(which_part==1 && my_rank==rank && (strcmp(this->meshtype,"3d")==0)){ 397 392 printf("IoModel penalties: \n"); 398 printf(" number of penalties: %i\n", iomodel->numpenalties);393 printf(" number of penalties: %i\n",this->numpenalties); 399 394 printf(" grids: \n"); 400 395 401 for(i=0;i< iomodel->numpenalties;i++){402 for(j=0;j< iomodel->numlayers;j++){403 printf("%i ",(int)*( iomodel->penalties+iomodel->numlayers*i+j));396 for(i=0;i<this->numpenalties;i++){ 397 for(j=0;j<this->numlayers;j++){ 398 printf("%i ",(int)*(this->penalties+this->numlayers*i+j)); 404 399 } 405 400 printf("\n"); … … 408 403 } 409 404 /*}}}*/ 405 /*FUNCTION IoModel::CreateSingleNodeToElementConnectivity(void){{{1*/ 406 void IoModel::CreateSingleNodeToElementConnectivity(void){ 407 408 ISSMERROR(" not supported yet!"); 409 } 410 /*}}}*/ -
issm/trunk/src/c/ModelProcessorx/IoModel.h
r3633 r3673 191 191 void IoModelInit(void); 192 192 void Echo(int which_part,int rank); 193 void CreateSingleNodeToElementConnectivity(void); 193 194 /*}}}*/ 194 195 -
issm/trunk/src/c/ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp
r3633 r3673 37 37 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 38 38 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 39 IoModelFetchData(&iomodel->drag ,NULL,NULL,iomodel_handle,"drag");40 IoModelFetchData(&iomodel-> p,NULL,NULL,iomodel_handle,"p");41 IoModelFetchData(&iomodel-> q,NULL,NULL,iomodel_handle,"q");39 IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient"); 40 IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p"); 41 IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q"); 42 42 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 43 43 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); 44 44 IoModelFetchData(&iomodel->elementonsurface,NULL,NULL,iomodel_handle,"elementonsurface"); 45 45 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 46 IoModelFetchData(&iomodel-> B,NULL,NULL,iomodel_handle,"B");47 IoModelFetchData(&iomodel-> n,NULL,NULL,iomodel_handle,"n");48 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");49 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");46 IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B"); 47 IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n"); 48 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 49 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 50 50 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 51 51 … … 68 68 xfree((void**)&iomodel->surface); 69 69 xfree((void**)&iomodel->bed); 70 xfree((void**)&iomodel->drag );71 xfree((void**)&iomodel-> p);72 xfree((void**)&iomodel-> q);70 xfree((void**)&iomodel->drag_coefficient); 71 xfree((void**)&iomodel->drag_p); 72 xfree((void**)&iomodel->drag_q); 73 73 xfree((void**)&iomodel->elementoniceshelf); 74 74 xfree((void**)&iomodel->elementonbed); 75 75 xfree((void**)&iomodel->elementonsurface); 76 76 xfree((void**)&iomodel->elements_type); 77 xfree((void**)&iomodel-> n);78 xfree((void**)&iomodel-> B);79 xfree((void**)&iomodel->accumulation );80 xfree((void**)&iomodel->melting );77 xfree((void**)&iomodel->rheology_n); 78 xfree((void**)&iomodel->rheology_B); 79 xfree((void**)&iomodel->accumulation_rate); 80 xfree((void**)&iomodel->melting_rate); 81 81 xfree((void**)&iomodel->elementonwater); 82 82 -
issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp
r3633 r3673 24 24 //create penalties for grids: no grid can have a temperature over the melting point 25 25 IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed"); 26 iomodel->CreateSingleNodeToElementConnectivity ;26 iomodel->CreateSingleNodeToElementConnectivity(); 27 27 28 28 for (i=0;i<iomodel->numberofvertices;i++){ -
issm/trunk/src/c/ModelProcessorx/Melting/CreateParametersMelting.cpp
r3633 r3673 10 10 #include "../ModelProcessorx.h" 11 11 12 void CreateParametersMelting( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){12 void CreateParametersMelting(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 13 13 14 14 Param* param = NULL; 15 DataSet* parameters=NULL;15 Parameters* parameters=NULL; 16 16 int count; 17 17 int i; … … 25 25 count=parameters->Size(); 26 26 27 /* get initial melting if transient*/27 /* get initial melting_rate if transient*/ 28 28 if(iomodel->dt){ 29 29 30 /*Get melting : */31 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");32 if(iomodel->melting ) {33 for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting [i]=iomodel->melting[i]/iomodel->yts; //m/s instead of m/yr30 /*Get melting_rate: */ 31 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 32 if(iomodel->melting_rate) { 33 for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; //m/s instead of m/yr 34 34 } 35 35 else{ 36 for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting [i]=0;36 for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=0; 37 37 } 38 38 39 39 count++; 40 40 param= new Param(count,"m_g",DOUBLEVEC); 41 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices);42 else param->SetDoubleVec(iomodel->melting ,0);41 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices); 42 else param->SetDoubleVec(iomodel->melting_rate,0); 43 43 parameters->AddObject(param); 44 44 45 /*Free melting : */46 xfree((void**)&iomodel->melting );45 /*Free melting_rate: */ 46 xfree((void**)&iomodel->melting_rate); 47 47 } 48 48 -
issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h
r3633 r3673 6 6 #define _MODEL_PROCESSORX_H_ 7 7 8 #include "./ModelProcessorx.h"9 10 8 #define RIFTINFOSIZE 11 11 9 12 10 /*Creation of fem datasets: general drivers*/ 13 void CreateDataSets(DataSet** pelements,DataSet** pnodes, 11 void CreateDataSets(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads,Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 14 12 15 void CreateParameters( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);13 void CreateParameters(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 16 14 17 15 … … 19 17 20 18 /*diagnostic horizontal*/ 21 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);19 void CreateElementsNodesAndMaterialsDiagnosticHoriz(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 22 20 void CreateConstraintsDiagnosticHoriz(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 23 21 void CreateLoadsDiagnosticHoriz(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 24 void CreateParametersDiagnosticHoriz( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);22 void CreateParametersDiagnosticHoriz(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 25 23 26 24 /*diagnostic vertical*/ 27 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);25 void CreateElementsNodesAndMaterialsDiagnosticVert(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 28 26 void CreateConstraintsDiagnosticVert(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 29 27 void CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 30 28 31 29 /*diagnostic hutter*/ 32 void CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);30 void CreateElementsNodesAndMaterialsDiagnosticHutter(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 33 31 void CreateConstraintsDiagnosticHutter(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 34 32 void CreateLoadsDiagnosticHutter(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 35 33 36 34 /*diagnostic stokes*/ 37 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);35 void CreateElementsNodesAndMaterialsDiagnosticStokes(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 38 36 void CreateConstraintsDiagnosticStokes(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 39 37 void CreateLoadsDiagnosticStokes(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 40 38 41 39 /*slope compute*/ 42 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);40 void CreateElementsNodesAndMaterialsSlopeCompute(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 43 41 void CreateConstraintsSlopeCompute(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 44 42 void CreateLoadsSlopeCompute(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 45 43 46 44 /*control:*/ 47 void CreateParametersControl( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);45 void CreateParametersControl(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 48 46 49 47 /*thermal:*/ 50 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);48 void CreateElementsNodesAndMaterialsThermal(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 51 49 void CreateConstraintsThermal(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 52 50 void CreateLoadsThermal(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 53 void CreateParametersThermal( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);51 void CreateParametersThermal(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 54 52 55 53 /*melting:*/ 56 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);54 void CreateElementsNodesAndMaterialsMelting(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 57 55 void CreateConstraintsMelting(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 58 56 void CreateLoadsMelting(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 59 void CreateParametersMelting( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);57 void CreateParametersMelting(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 60 58 61 59 /*prognostic:*/ 62 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);60 void CreateElementsNodesAndMaterialsPrognostic(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 63 61 void CreateConstraintsPrognostic(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 64 62 void CreateLoadsPrognostic(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 65 void CreateParametersPrognostic( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);63 void CreateParametersPrognostic(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 66 64 67 65 /*prognostic2:*/ 68 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);66 void CreateElementsNodesAndMaterialsPrognostic2(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 69 67 void CreateConstraintsPrognostic2(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 70 68 void CreateLoadsPrognostic2(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 71 void CreateParametersPrognostic2( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);69 void CreateParametersPrognostic2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 72 70 73 71 /*balancedthickness:*/ 74 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);72 void CreateElementsNodesAndMaterialsBalancedthickness(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 75 73 void CreateConstraintsBalancedthickness(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 76 74 void CreateLoadsBalancedthickness(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 77 void CreateParametersBalancedthickness(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 75 void CreateParametersBalancedthickness(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 76 77 void CreateElementsNodesAndMaterialsBalancedthickness2(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 78 void CreateConstraintsBalancedthickness2(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 79 void CreateLoadsBalancedthickness2(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 80 void CreateParametersBalancedthickness2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 81 78 82 79 83 /*balancedvelocities:*/ 80 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle);84 void CreateElementsNodesAndMaterialsBalancedvelocities(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** pmaterials, IoModel* iomodel,ConstDataHandle iomodel_handle); 81 85 void CreateConstraintsBalancedvelocities(DataSet** pconstraints,IoModel* iomodel,ConstDataHandle iomodel_handle); 82 86 void CreateLoadsBalancedvelocities(DataSet** ploads, IoModel* iomodel, ConstDataHandle iomodel_handle); 83 void CreateParametersBalancedvelocities( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle);87 void CreateParametersBalancedvelocities(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 84 88 85 89 /*qmu: */ 86 void CreateParametersQmu(DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 90 void CreateParametersQmu(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle); 91 92 /*partitioning: */ 93 void Partitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle); 87 94 88 95 #endif -
issm/trunk/src/c/ModelProcessorx/Partitioning.cpp
r3595 r3673 16 16 #include "../include/typedefs.h" 17 17 #include "../MeshPartitionx/MeshPartitionx.h" 18 #include "../ModelProcessorx/ModelProcessorx.h" 18 19 19 20 void DiscontinuousGalerkinPartitioning(bool** pmy_elements, bool** pmy_vertices, bool** pmy_nodes, bool** pmy_bordervertices, IoModel* iomodel, ConstDataHandle iomodel_handle); -
issm/trunk/src/c/ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp
r3633 r3673 11 11 #include "../ModelProcessorx.h" 12 12 13 void CreateParametersPrognostic( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){13 void CreateParametersPrognostic(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 15 Param* param = NULL; 16 DataSet* parameters=NULL;16 Parameters* parameters=NULL; 17 17 int count; 18 18 int i; … … 113 113 xfree((void**)&iomodel->bed); 114 114 115 /*Get melting : */116 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");117 if(iomodel->melting ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;115 /*Get melting_rate: */ 116 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 117 if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; 118 118 119 119 count++; 120 120 param= new Param(count,"m_g",DOUBLEVEC); 121 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);122 else param->SetDoubleVec(iomodel->melting ,0,1);121 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1); 122 else param->SetDoubleVec(iomodel->melting_rate,0,1); 123 123 parameters->AddObject(param); 124 124 125 /*Free melting : */126 xfree((void**)&iomodel->melting );125 /*Free melting_rate: */ 126 xfree((void**)&iomodel->melting_rate); 127 127 128 /*Get accumulation : */129 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");130 if(iomodel->accumulation ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;128 /*Get accumulation_rate: */ 129 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 130 if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts; 131 131 132 132 count++; 133 133 param= new Param(count,"a_g",DOUBLEVEC); 134 if(iomodel->accumulation ) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);135 else param->SetDoubleVec(iomodel->accumulation ,0,0);134 if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1); 135 else param->SetDoubleVec(iomodel->accumulation_rate,0,0); 136 136 parameters->AddObject(param); 137 137 138 /*Free accumulation : */139 xfree((void**)&iomodel->accumulation );138 /*Free accumulation_rate: */ 139 xfree((void**)&iomodel->accumulation_rate); 140 140 141 141 /*Assign output pointer: */ -
issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateParametersPrognostic2.cpp
r3633 r3673 11 11 #include "../ModelProcessorx.h" 12 12 13 void CreateParametersPrognostic2( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){13 void CreateParametersPrognostic2(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 15 Param* param = NULL; 16 DataSet* parameters=NULL;16 Parameters* parameters=NULL; 17 17 int count; 18 18 int i; … … 86 86 xfree((void**)&iomodel->bed); 87 87 88 /*Get melting : */89 IoModelFetchData(&iomodel->melting ,NULL,NULL,iomodel_handle,"melting");90 if(iomodel->melting ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting[i]=iomodel->melting[i]/iomodel->yts;88 /*Get melting_rate: */ 89 IoModelFetchData(&iomodel->melting_rate,NULL,NULL,iomodel_handle,"melting_rate"); 90 if(iomodel->melting_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->melting_rate[i]=iomodel->melting_rate[i]/iomodel->yts; 91 91 92 92 count++; 93 93 param= new Param(count,"m_g",DOUBLEVEC); 94 if(iomodel->melting ) param->SetDoubleVec(iomodel->melting,iomodel->numberofvertices,1);95 else param->SetDoubleVec(iomodel->melting ,0,1);94 if(iomodel->melting_rate) param->SetDoubleVec(iomodel->melting_rate,iomodel->numberofvertices,1); 95 else param->SetDoubleVec(iomodel->melting_rate,0,1); 96 96 parameters->AddObject(param); 97 97 98 /*Free melting : */99 xfree((void**)&iomodel->melting );98 /*Free melting_rate: */ 99 xfree((void**)&iomodel->melting_rate); 100 100 101 /*Get accumulation : */102 IoModelFetchData(&iomodel->accumulation ,NULL,NULL,iomodel_handle,"accumulation");103 if(iomodel->accumulation ) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation[i]=iomodel->accumulation[i]/iomodel->yts;101 /*Get accumulation_rate: */ 102 IoModelFetchData(&iomodel->accumulation_rate,NULL,NULL,iomodel_handle,"accumulation_rate"); 103 if(iomodel->accumulation_rate) for(i=0;i<iomodel->numberofvertices;i++)iomodel->accumulation_rate[i]=iomodel->accumulation_rate[i]/iomodel->yts; 104 104 105 105 count++; 106 106 param= new Param(count,"a_g",DOUBLEVEC); 107 if(iomodel->accumulation ) param->SetDoubleVec(iomodel->accumulation,iomodel->numberofvertices,1);108 else param->SetDoubleVec(iomodel->accumulation ,0,0);107 if(iomodel->accumulation_rate) param->SetDoubleVec(iomodel->accumulation_rate,iomodel->numberofvertices,1); 108 else param->SetDoubleVec(iomodel->accumulation_rate,0,0); 109 109 parameters->AddObject(param); 110 110 111 /*Free accumulation : */112 xfree((void**)&iomodel->accumulation );111 /*Free accumulation_rate: */ 112 xfree((void**)&iomodel->accumulation_rate); 113 113 114 114 /*Assign output pointer: */ -
issm/trunk/src/c/ModelProcessorx/Qmu/CreateParametersQmu.cpp
r3633 r3673 12 12 #include "../ModelProcessorx.h" 13 13 14 void CreateParametersQmu( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){14 void CreateParametersQmu(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 15 15 16 16 int i,j,k; 17 17 18 DataSet* parameters = NULL;18 Parameters* parameters = NULL; 19 19 Param* param = NULL; 20 20 int count; -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp
r3633 r3673 37 37 IoModelFetchData(&iomodel->surface,NULL,NULL,iomodel_handle,"surface"); 38 38 IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed"); 39 IoModelFetchData(&iomodel->drag ,NULL,NULL,iomodel_handle,"drag");40 IoModelFetchData(&iomodel-> p,NULL,NULL,iomodel_handle,"p");41 IoModelFetchData(&iomodel-> q,NULL,NULL,iomodel_handle,"q");39 IoModelFetchData(&iomodel->drag_coefficient,NULL,NULL,iomodel_handle,"drag_coefficient"); 40 IoModelFetchData(&iomodel->drag_p,NULL,NULL,iomodel_handle,"drag_p"); 41 IoModelFetchData(&iomodel->drag_q,NULL,NULL,iomodel_handle,"drag_q"); 42 42 IoModelFetchData(&iomodel->elementoniceshelf,NULL,NULL,iomodel_handle,"elementoniceshelf"); 43 43 IoModelFetchData(&iomodel->elementonbed,NULL,NULL,iomodel_handle,"elementonbed"); … … 45 45 IoModelFetchData(&iomodel->elements_type,NULL,NULL,iomodel_handle,"elements_type"); 46 46 IoModelFetchData(&iomodel->geothermalflux,NULL,NULL,iomodel_handle,"geothermalflux"); 47 IoModelFetchData(&iomodel-> B,NULL,NULL,iomodel_handle,"B");48 IoModelFetchData(&iomodel-> n,NULL,NULL,iomodel_handle,"n");47 IoModelFetchData(&iomodel->rheology_B,NULL,NULL,iomodel_handle,"rheology_B"); 48 IoModelFetchData(&iomodel->rheology_n,NULL,NULL,iomodel_handle,"rheology_n"); 49 49 IoModelFetchData(&iomodel->elementonwater,NULL,NULL,iomodel_handle,"elementonwater"); 50 50 … … 65 65 xfree((void**)&iomodel->surface); 66 66 xfree((void**)&iomodel->bed); 67 xfree((void**)&iomodel->drag );68 xfree((void**)&iomodel-> p);69 xfree((void**)&iomodel-> q);67 xfree((void**)&iomodel->drag_coefficient); 68 xfree((void**)&iomodel->drag_p); 69 xfree((void**)&iomodel->drag_q); 70 70 xfree((void**)&iomodel->elementoniceshelf); 71 71 xfree((void**)&iomodel->elementonbed); … … 73 73 xfree((void**)&iomodel->elements_type); 74 74 xfree((void**)&iomodel->geothermalflux); 75 xfree((void**)&iomodel-> n);76 xfree((void**)&iomodel-> B);75 xfree((void**)&iomodel->rheology_n); 76 xfree((void**)&iomodel->rheology_B); 77 77 xfree((void**)&iomodel->elementonwater); 78 78 -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp
r3633 r3673 25 25 //create penalties for grids: no grid can have a temperature over the melting point 26 26 IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature"); 27 iomodel->CreateSingleNodeToElementConnectivity ;27 iomodel->CreateSingleNodeToElementConnectivity(); 28 28 29 29 for (i=0;i<iomodel->numberofvertices;i++){ -
issm/trunk/src/c/ModelProcessorx/Thermal/CreateParametersThermal.cpp
r3633 r3673 11 11 #include "../ModelProcessorx.h" 12 12 13 void CreateParametersThermal( DataSet** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){13 void CreateParametersThermal(Parameters** pparameters,IoModel* iomodel,ConstDataHandle iomodel_handle){ 14 14 15 15 Param* param = NULL; 16 DataSet* parameters=NULL;16 Parameters* parameters=NULL; 17 17 int count; 18 18 int i; -
issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.cpp
r3503 r3673 12 12 13 13 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices, 14 DataSet* loads,DataSet* materials, DataSet* parameters,ParameterInputs* inputs,int analysis_type,int sub_analysis_type){14 DataSet* loads,DataSet* materials, Parameters* parameters,int analysis_type,int sub_analysis_type){ 15 15 16 16 int i; … … 34 34 * management routine, otherwise, skip : */ 35 35 if (RiftIsPresent(loads)){ 36 RiftConstraints(&converged,&num_unstable_constraints,loads, inputs,min_mechanical_constraints,analysis_type,sub_analysis_type);36 RiftConstraints(&converged,&num_unstable_constraints,loads,min_mechanical_constraints,analysis_type,sub_analysis_type); 37 37 } 38 38 else if(loads->MeltingIsPresent()){ 39 loads->MeltingConstraints(&converged,&num_unstable_constraints, inputs,analysis_type,sub_analysis_type);39 loads->MeltingConstraints(&converged,&num_unstable_constraints,analysis_type,sub_analysis_type); 40 40 } 41 41 else{ -
issm/trunk/src/c/PenaltyConstraintsx/PenaltyConstraintsx.h
r3612 r3673 11 11 /* local prototypes: */ 12 12 void PenaltyConstraintsx(int* pconverged, int* pnum_unstable_constraints, DataSet* elements,DataSet* nodes, DataSet* vertices, 13 DataSet* loads,DataSet* materials, DataSet* parameters,int analysis_type,int sub_analysis_type);13 DataSet* loads,DataSet* materials, Parameters* parameters,int analysis_type,int sub_analysis_type); 14 14 15 15 #endif /* _PENALTYCONSTRAINTSX_H */ -
issm/trunk/src/c/PenaltyConstraintsx/RiftConstraints.cpp
r3595 r3673 10 10 #define _ZIGZAGCOUNTER_ 11 11 12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int min_mechanical_constraints,int analysis_type,int sub_analysis_type){12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,int min_mechanical_constraints,int analysis_type,int sub_analysis_type){ 13 13 14 14 int num_unstable_constraints=0; … … 17 17 extern int my_rank; 18 18 19 Constrain(&num_unstable_constraints,loads, inputs,analysis_type);19 Constrain(&num_unstable_constraints,loads,analysis_type); 20 20 if(num_unstable_constraints==0)converged=1; 21 21 … … 27 27 else if(num_unstable_constraints<=min_mechanical_constraints){ 28 28 _printf_(" freezing constraints\n"); 29 FreezeConstraints(loads, inputs,analysis_type);29 FreezeConstraints(loads,analysis_type); 30 30 } 31 31 … … 35 35 } 36 36 37 int IsMaterialStable(DataSet* loads, ParameterInputs* inputs,int analysis_type){37 int IsMaterialStable(DataSet* loads,int analysis_type){ 38 38 39 39 int i; … … 50 50 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 51 51 52 if (riftfront->IsMaterialStable( inputs,analysis_type)){52 if (riftfront->IsMaterialStable(analysis_type)){ 53 53 found=1; 54 54 /*do not break! all penalties should get informed the non-linearity converged!*/ … … 150 150 } 151 151 152 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int analysis_type){152 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type){ 153 153 154 154 int i; … … 168 168 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 169 169 170 riftfront->PreConstrain(&unstable, inputs,analysis_type);170 riftfront->PreConstrain(&unstable,analysis_type); 171 171 172 172 num_unstable_constraints+=unstable; … … 185 185 } 186 186 187 int Constrain(int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int analysis_type){187 int Constrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type){ 188 188 189 189 int i; … … 203 203 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 204 204 205 riftfront->Constrain(&unstable, inputs,analysis_type);205 riftfront->Constrain(&unstable,analysis_type); 206 206 207 207 num_unstable_constraints+=unstable; … … 220 220 } 221 221 222 void FreezeConstraints(DataSet* loads, ParameterInputs* inputs,int analysis_type){222 void FreezeConstraints(DataSet* loads,int analysis_type){ 223 223 224 224 int i; … … 234 234 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 235 235 236 riftfront->FreezeConstraints( inputs,analysis_type);236 riftfront->FreezeConstraints(analysis_type); 237 237 238 238 } … … 273 273 } 274 274 275 int MaxPenetrationInInputs(DataSet* loads, ParameterInputs* inputs,int analysis_type){275 int MaxPenetrationInInputs(DataSet* loads,int analysis_type){ 276 276 277 277 int i; … … 295 295 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 296 296 297 riftfront->MaxPenetration(&penetration, inputs,analysis_type);297 riftfront->MaxPenetration(&penetration,analysis_type); 298 298 299 299 if (penetration>max_penetration)max_penetration=penetration; … … 308 308 309 309 /*feed max_penetration to inputs: */ 310 inputs->Add("max_penetration",max_penetration);311 } 312 313 int PotentialUnstableConstraints(DataSet* loads, ParameterInputs* inputs,int analysis_type){310 loads->AddInput(max_penetration,MaxPenetrationEnum); 311 } 312 313 int PotentialUnstableConstraints(DataSet* loads,int analysis_type){ 314 314 315 315 int i; … … 330 330 riftfront=(Riftfront*)loads->GetObjectByOffset(i); 331 331 332 riftfront->PotentialUnstableConstraint(&unstable, inputs,analysis_type);332 riftfront->PotentialUnstableConstraint(&unstable,analysis_type); 333 333 334 334 num_unstable_constraints+=unstable; -
issm/trunk/src/c/PenaltyConstraintsx/RiftConstraints.h
r3201 r3673 10 10 #include "../DataSet/DataSet.h" 11 11 12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int min_mechanical_constraints,int analysis_type,int sub_analysis_type);12 int RiftConstraints(int* pconverged, int* pnum_unstable_constraints,DataSet* loads,int min_mechanical_constraints,int analysis_type,int sub_analysis_type); 13 13 14 14 int RiftIsPresent(DataSet* loads); … … 18 18 int SetPreStable(DataSet* loads); 19 19 20 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int analysis_type_enum);20 int PreConstrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type_enum); 21 21 22 int Constrain(int* pnum_unstable_constraints,DataSet* loads, ParameterInputs* inputs,int analysis_type_enum);22 int Constrain(int* pnum_unstable_constraints,DataSet* loads,int analysis_type_enum); 23 23 24 void FreezeConstraints(DataSet* loads, ParameterInputs* inputs,int analysis_type);24 void FreezeConstraints(DataSet* loads,int analysis_type); 25 25 26 int MaxPenetrationInInputs(DataSet* loads, ParameterInputs* inputs,int analysis_type_enum);26 int MaxPenetrationInInputs(DataSet* loads,int analysis_type_enum); 27 27 28 int PotentialUnstableConstraints(DataSet* loads, ParameterInputs* inputs,int analysis_type_enum);28 int PotentialUnstableConstraints(DataSet* loads,int analysis_type_enum); 29 29 30 int IsMaterialStable(DataSet* loads, ParameterInputs* inputs,int analysis_type_enum);30 int IsMaterialStable(DataSet* loads,int analysis_type_enum); 31 31 32 32 int IsFrozen(DataSet* loads); -
issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.cpp
r3612 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, 13 13 int kflag,int pflag,int analysis_type,int sub_analysis_type){ 14 14 … … 29 29 30 30 /*Add penalties to stiffnesses, from loads: */ 31 if(kflag)loads->PenaltyCreateKMatrix(Kgg, inputs,kmax,analysis_type,sub_analysis_type);32 if(pflag)loads->PenaltyCreatePVector(pg, inputs,kmax,analysis_type,sub_analysis_type);31 if(kflag)loads->PenaltyCreateKMatrix(Kgg,kmax,analysis_type,sub_analysis_type); 32 if(pflag)loads->PenaltyCreatePVector(pg,kmax,analysis_type,sub_analysis_type); 33 33 34 34 /*Assemble matrices: */ -
issm/trunk/src/c/PenaltySystemMatricesx/PenaltySystemMatricesx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,12 void PenaltySystemMatricesx(Mat Kgg, Vec pg,double* pkmax, DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, 13 13 int kflag,int pflag,int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
r3567 r3673 15 15 #include "../EnumDefinitions/EnumDefinitions.h" 16 16 17 void ProcessParamsx( DataSet* parameters, Vec part){17 void ProcessParamsx( Parameters* parameters, Vec part){ 18 18 19 19 -
issm/trunk/src/c/ProcessParamsx/ProcessParamsx.h
r1 r3673 9 9 10 10 /* local prototypes: */ 11 void ProcessParamsx( DataSet* parameters, Vec partition);11 void ProcessParamsx( Parameters* parameters, Vec partition); 12 12 13 13 #endif /* _PROCESSPARAMSX_H */ -
issm/trunk/src/c/Qmux/DakotaResponses.cpp
r3570 r3673 16 16 #include "../Misfitx/Misfitx.h" 17 17 18 void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model,DataSet* results,DataSet* processed_results, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){18 void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,Model* model,DataSet* results,DataSet* processed_results,int analysis_type,int sub_analysis_type){ 19 19 20 20 int i,j; … … 258 258 if(!found)ISSMERROR(" could not find velocity to compute misfit"); 259 259 260 SplitSolutionVector(&vx,&vy,&vz,u_g,numberofnodes*numberofdofspernode); 261 260 262 /*Add to inputs: */ 261 inputs->Add("velocity",u_g_double,numberofdofspernode,numberofnodes); 262 inputs->Add("fit",fit[0]); 263 femmodel->elements->AddInput(vx,VxEnum); 264 femmodel->elements->AddInput(vy,VyEnum); 265 femmodel->elements->AddInput(vz,VzEnum); 266 femmodel->elements->AddInput(fit[0],FitEnum); 263 267 264 268 /*Compute misfit: */ 265 Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters, inputs,analysis_type,sub_analysis_type);269 Misfitx( &J, femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,analysis_type,sub_analysis_type); 266 270 267 271 -
issm/trunk/src/c/Qmux/Qmux.cpp
r3332 r3673 51 51 52 52 #ifdef _SERIAL_ 53 void Qmux(mxArray* model, mxArray* inputs,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file){53 void Qmux(mxArray* model,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file){ 54 54 #else 55 void Qmux(Model* model, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){55 void Qmux(Model* model,int analysis_type,int sub_analysis_type){ 56 56 #endif 57 57 … … 111 111 112 112 // Serial case: plug in derived Interface object without an analysisComm 113 interface.assign_rep(new SIM::DakotaPlugin(problem_db,(void*)model, (void*)inputs,analysis_type,sub_analysis_type), false);113 interface.assign_rep(new SIM::DakotaPlugin(problem_db,(void*)model,analysis_type,sub_analysis_type), false); 114 114 } 115 115 … … 120 120 #ifdef _PARALLEL_ 121 121 //Warn other cpus that we are done running the dakota iterator, by setting the counter to -1: 122 SpawnCore(NULL,0, NULL,NULL,0,model, inputs,analysis_type,sub_analysis_type,-1);122 SpawnCore(NULL,0, NULL,NULL,0,model,analysis_type,sub_analysis_type,-1); 123 123 #endif 124 124 … … 128 128 129 129 for(;;){ 130 if(!SpawnCore(NULL,0, NULL,NULL,0,model, inputs,analysis_type,sub_analysis_type,0))break; //counter came in at -1 on cpu0, bail out.130 if(!SpawnCore(NULL,0, NULL,NULL,0,model,analysis_type,sub_analysis_type,0))break; //counter came in at -1 on cpu0, bail out. 131 131 } 132 132 } -
issm/trunk/src/c/Qmux/Qmux.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model, void* inputs,int analysis_type,int sub_analysis_type,int counter);12 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,int analysis_type,int sub_analysis_type,int counter); 13 13 #ifdef _SERIAL_ 14 void Qmux(mxArray* model, mxArray* inputs,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file);15 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model, mxArray* inputs,int analysis_type,int sub_analysis_type,int counter);14 void Qmux(mxArray* model,int analysis_type,int sub_analysis_type,char* dakota_input_file,char* dakota_output_file,char* dakota_error_file); 15 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,int analysis_type,int sub_analysis_type,int counter); 16 16 #else 17 17 void Qmux(Model* model,int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/Qmux/SpawnCore.cpp
r3332 r3673 17 17 #include "../include/macros.h" 18 18 19 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model, void* inputs,int analysis_type,int sub_analysis_type,int counter){19 int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* model,int analysis_type,int sub_analysis_type,int counter){ 20 20 21 21 /*Branch into a serial SpawnCore and a parallel SpawnCore: */ 22 22 #ifdef _SERIAL_ 23 SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)model, (mxArray*)inputs,analysis_type,sub_analysis_type,counter);23 SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)model, analysis_type,sub_analysis_type,counter); 24 24 #else 25 25 /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */ 26 26 MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD); if(counter==-1)return 0; 27 27 28 SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (Model*)model, (ParameterInputs*)inputs,analysis_type,sub_analysis_type,counter);28 SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (Model*)model, analysis_type,sub_analysis_type,counter); 29 29 #endif 30 30 -
issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
r3595 r3673 34 34 #include "../parallel/parallel.h" 35 35 36 void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, Model* model, ParameterInputs* inputs,int analysis_type,int sub_analysis_type,int counter){36 void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, Model* model,int analysis_type,int sub_analysis_type,int counter){ 37 37 38 38 int i; … … 97 97 results=new DataSet(ResultsEnum); 98 98 99 /*Modify core inputs to reflect the dakota variables inputs: */100 inputs->UpdateFromDakota(variables,variables_descriptors,numvariables,model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters,qmu_part,qmu_npart); //diagnostic horiz model is the one holding the parameters for Dakota.99 /*Modify core inputs in objects contained in model, to reflect the dakota variables inputs: */ 100 model->UpdateFromDakota(variables,variables_descriptors,numvariables,model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters,qmu_part,qmu_npart); //diagnostic horiz model is the one holding the parameters for Dakota. 101 101 102 /*Run the analysis core solution sequence , with the updated inputs: */102 /*Run the analysis core solution sequence: */ 103 103 if(analysis_type==DiagnosticAnalysisEnum){ 104 104 105 105 if(verbose)_printf_("Starting diagnostic core\n"); 106 106 107 diagnostic_core(results,model ,inputs);107 diagnostic_core(results,model); 108 108 109 109 } … … 111 111 112 112 if(verbose)_printf_("Starting thermal core\n"); 113 thermal_core(results,model ,inputs);113 thermal_core(results,model); 114 114 115 115 } … … 117 117 118 118 if(verbose)_printf_("Starting prognostic core\n"); 119 prognostic_core(results,model ,inputs);119 prognostic_core(results,model); 120 120 121 121 } … … 123 123 124 124 if(verbose)_printf_("Starting transient core\n"); 125 transient_core(results,model ,inputs);125 transient_core(results,model); 126 126 127 127 } … … 137 137 /*compute responses on cpu 0: dummy for now! */ 138 138 if(verbose)_printf_("compute dakota responses:\n"); 139 DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results, inputs,analysis_type,sub_analysis_type);139 DakotaResponses(responses,responses_descriptors,numresponses,model,results,processed_results,analysis_type,sub_analysis_type); 140 140 141 141 /*Free ressources:*/ -
issm/trunk/src/c/Qmux/SpawnCoreSerial.cpp
r3332 r3673 19 19 #include "../include/macros.h" 20 20 21 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model, mxArray* inputs,int analysis_type,int sub_analysis_type,int counter){21 void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* model,int analysis_type,int sub_analysis_type,int counter){ 22 22 23 23 int i; … … 57 57 //call SpwanCore matlab routine. 58 58 array[0]=model; 59 array[1]=inputs;60 59 array[2]=mxvariables; 61 60 array[3]=mxvariabledescriptors; -
issm/trunk/src/c/SurfaceAreax/SurfaceAreax.cpp
r3446 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,13 ParameterInputs* inputs,int analysis_type,int sub_analysis_type){12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials,Parameters* parameters, 13 int analysis_type,int sub_analysis_type){ 14 14 15 15 /*output: */ … … 22 22 23 23 /*Compute gradients: */ 24 elements->SurfaceArea(&S, inputs,analysis_type,sub_analysis_type);24 elements->SurfaceArea(&S,analysis_type,sub_analysis_type); 25 25 26 26 /*Sum all J from all cpus of the cluster:*/ -
issm/trunk/src/c/SurfaceAreax/SurfaceAreax.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,12 void SurfaceAreax( double* pS, DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters, 13 13 int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/SystemMatricesx/SystemMatricesx.cpp
r3612 r3673 10 10 #include "../EnumDefinitions/EnumDefinitions.h" 11 11 12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, 13 13 int kflag,int pflag,int connectivity,int numberofdofspernode,int analysis_type,int sub_analysis_type){ 14 14 … … 40 40 41 41 /*Fill stiffness matrix and right hand side vector, from elements: */ 42 if(kflag)elements->CreateKMatrix(Kgg, inputs,analysis_type,sub_analysis_type);43 if(pflag)elements->CreatePVector(pg, inputs,analysis_type,sub_analysis_type);42 if(kflag)elements->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 43 if(pflag)elements->CreatePVector(pg,analysis_type,sub_analysis_type); 44 44 45 45 /*Fill stiffness matrix and right hand side vector, from loads: */ 46 if(kflag)loads->CreateKMatrix(Kgg, inputs,analysis_type,sub_analysis_type);47 if(pflag)loads->CreatePVector(pg, inputs,analysis_type,sub_analysis_type);46 if(kflag)loads->CreateKMatrix(Kgg,analysis_type,sub_analysis_type); 47 if(pflag)loads->CreatePVector(pg,analysis_type,sub_analysis_type); 48 48 49 49 /*Assemble matrices: */ -
issm/trunk/src/c/SystemMatricesx/SystemMatricesx.h
r3612 r3673 10 10 11 11 /* local prototypes: */ 12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, DataSet* parameters,12 void SystemMatricesx(Mat* pKgg, Vec* ppg,DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads,DataSet* materials, Parameters* parameters, 13 13 int kflag,int pflag,int connectivity,int numberofdofspernode,int analysis_type,int sub_analysis_type); 14 14 -
issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.cpp
r3567 r3673 12 12 13 13 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 14 DataSet* elements, DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,14 DataSet* elements, DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters, 15 15 Vec vec_newthickness,Vec vec_bed,Vec vec_surface){ 16 16 -
issm/trunk/src/c/UpdateGeometryx/UpdateGeometryx.h
r3446 r3673 11 11 /* local prototypes: */ 12 12 void UpdateGeometryx(Vec* poutthickness,Vec* poutbed,Vec* poutsurface, 13 DataSet* elements, DataSet* nodes,DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,13 DataSet* elements, DataSet* nodes,DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters, 14 14 Vec newthickness,Vec bed,Vec surface); 15 15 -
issm/trunk/src/c/UpdateInputsx/UpdateInputsx.cpp
r3612 r3673 9 9 #include "../EnumDefinitions/EnumDefinitions.h" 10 10 11 int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, DataSet* parameters,Vec solution, int analysis_type, int sub_analysis_type){11 int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices, DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type){ 12 12 13 13 int noerr=1; -
issm/trunk/src/c/UpdateInputsx/UpdateInputsx.h
r3599 r3673 10 10 11 11 /* local prototypes: */ 12 int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, DataSet* parameters,Vec solution, int analysis_type, int sub_analysis_type);12 int UpdateInputsx( DataSet* elements,DataSet* nodes, DataSet* vertices,DataSet* loads, DataSet* materials, Parameters* parameters,Vec solution, int analysis_type, int sub_analysis_type); 13 13 14 14 #endif /* _UPDATEINPUTSXX_H */ -
issm/trunk/src/c/io/FetchParams.cpp
r3570 r3673 20 20 void FetchParams(DataSet** pparameters, DataHandle dataref){ 21 21 22 int i,j ,count;22 int i,j; 23 23 24 24 /*output: */ 25 25 Param* param=NULL; 26 Numpar* numpar=NULL; 27 DataSet* parameters=NULL; 26 Parameters* parameters=NULL; 28 27 29 28 /*intermediary: */ … … 36 35 mxArray* pfield=NULL; 37 36 mxArray* pfield2=NULL; 37 int enum_type; 38 38 39 39 40 40 /*First, create parameters : */ 41 parameters=new DataSet();41 parameters=new Parameters(); 42 42 43 /*Then, create Numpar object, before building the params objects: */ 44 numpar= new Numpar(1); 45 parameters->AddObject(numpar); 46 47 /*now, go through matlab params structure, and create Param object for each field: */ 43 /*go through matlab params structure, and create Param object for each field: */ 48 44 49 45 nfields=mxGetNumberOfFields(dataref); … … 53 49 /*Get i'th field: */ 54 50 name=(char*)mxGetFieldNameByNumber(dataref,count); 51 enum_type=StringAsEnum(name); 55 52 pfield=mxGetFieldByNumber(dataref,0,count); 56 53 … … 65 62 ISSMERROR("%s%i (%s) %s%i%s%i%s","array in parameters structure field ",count,name," is of size (",M,",",N,")"); 66 63 } 67 68 64 if (M==1 && N==1){ 69 70 65 /*we have a simple scalar: */ 71 param= new Param(count+1,name,DOUBLE); 72 param->SetDouble(*mxGetPr(pfield)); 66 param= new DoubleParam(enum_type,*mxGetPr(pfield)); 73 67 parameters->AddObject(param); 74 68 … … 78 72 79 73 /*vector: */ 80 param= new Param(count+1,name,DOUBLEVEC); 81 param->SetDoubleVec(mxGetPr(pfield),M,1); 74 param= new DoubleVecParam(enum_type,mxGetPr(pfield),M); 82 75 parameters->AddObject(param); 83 76 84 77 } 85 78 else{ 86 87 79 /*matrix: first, transpose, then plug into Param */ 88 80 matrix=mxGetPr(pfield); … … 94 86 } 95 87 96 param= new Param(count+1,name,DOUBLEMAT); 97 param->SetDoubleMat(tmatrix,M,N); 88 param= new DoubleMatParam(enum_type,tmatrix,M,N); 98 89 parameters->AddObject(param); 99 90 100 91 /*Free ressources:*/ 101 92 xfree((void**)&tmatrix); 102 103 93 } 104 94 } … … 116 106 mxGetString(pfield,string,stringlen); 117 107 118 param= new Param(count+1,name,STRING); 119 param->SetString(string); 108 param= new StringParam(enum_type,string); 120 109 parameters->AddObject(param); 121 110 … … 135 124 } 136 125 137 param= new Param(count+1,name,STRINGARRAY); 138 param->SetStringArray(stringarray,M); 126 param= new StringArrayParam(enum_type,stringarray,M); 139 127 parameters->AddObject(param); 140 128 -
issm/trunk/src/c/io/WriteParams.cpp
r3621 r3673 18 18 #include "../include/macros.h" 19 19 20 void WriteParams(DataHandle* pdataref,DataSet* parameters){ 20 void WriteParams(DataHandle* pdataref,Parameters* parameters){ 21 22 int i; 21 23 22 24 /*output: */ … … 26 28 mwSize onebyone[2] = {1,1}; 27 29 mwSize ndim=2; 28 mxArray* pfield=NULL;29 mxArray* pfield2=NULL;30 30 31 31 /*intermediary: */ 32 int i,k;33 mxArray* field=NULL;34 32 Param* param=NULL; 35 int integer;36 double ddouble;37 char* string;38 double* doublevec=NULL;39 double* doublemat=NULL;40 Mat mat=NULL;41 Vec vec=NULL;42 char** stringarray=NULL;43 double* serial_vec=NULL;44 double* serial_mat=NULL;45 mwSize M,N;46 mwSize dims[2]={0};47 33 48 34 /*Recover data from the parameters dataset: */ 49 nfields=(mwSize)parameters->Size()-1; //don't include Numpar 50 35 nfields=(mwSize)parameters->Size(); 51 36 fnames=(const char**)xmalloc(nfields*sizeof(char*)); 52 37 53 38 /*Build structure in matlab workspace with all the parameter fields: */ 54 39 for(i=0;i<nfields;i++){ 55 param=(Param*)parameters->GetObjectByOffset(i+1); 56 fnames[i]=(const char*)xmalloc((strlen(param->GetParameterName())+1)*sizeof(char)); 57 strcpy((char*)fnames[i],param->GetParameterName()); 40 param=(Param*)parameters->GetObjectByOffset(i); 41 fnames[i]=param->GetParameterName(); 58 42 } 59 43 /*Initialize structure: */ … … 63 47 for(i=0;i<nfields;i++){ 64 48 65 param=(Param*)parameters->GetObjectByOffset(i+1); //skip the numpar object 49 param=(Param*)parameters->GetObjectByOffset(i); 50 param->SetMatlabField(dataref); 51 } 66 52 67 switch(param->GetType()){68 case INTEGER:69 param->GetParameterValue(&integer);70 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)integer));71 break;72 73 case DOUBLE:74 param->GetParameterValue(&ddouble);75 mxSetField( dataref, 0, param->GetParameterName(),mxCreateDoubleScalar((double)ddouble));76 break;77 78 case STRING:79 param->GetParameterValue(&string);80 mxSetField( dataref, 0, param->GetParameterName(),mxCreateString(string));81 break;82 83 case STRINGARRAY:84 param->GetParameterValue(&stringarray);85 M=param->GetM();86 dims[0]=M;87 dims[1]=1;88 pfield=mxCreateCellArray(2,dims);89 for(k=0;k<M;k++){90 char* string=stringarray[k];91 mxSetCell(pfield,k,mxCreateString(string));92 }93 mxSetField( dataref, 0, param->GetParameterName(),pfield);94 break;95 96 case DOUBLEVEC:97 param->GetParameterValue(&doublevec);98 M=param->GetM();99 pfield=mxCreateDoubleMatrix(0,0,mxREAL);100 mxSetM(pfield,M);101 mxSetN(pfield,1);102 mxSetPr(pfield,doublevec);103 mxSetField( dataref, 0, param->GetParameterName(),pfield);104 break;105 106 case DOUBLEMAT:107 param->GetParameterValue(&doublemat);108 M=param->GetM();109 N=param->GetN();110 pfield=mxCreateDoubleMatrix(0,0,mxREAL);111 mxSetM(pfield,N);112 mxSetN(pfield,M);113 mxSetPr(pfield,doublemat);114 //transpose the matrix, written directly to matlab! from C to matlab.115 mexCallMATLAB(1,&pfield2, 1, &pfield, "'");116 mxSetField( dataref, 0, param->GetParameterName(),pfield2);117 break;118 119 case PETSCVEC:120 param->GetParameterValue(&vec);121 VecToMPISerial(&serial_vec,vec);122 VecFree(&vec);123 M=param->GetM();124 pfield=mxCreateDoubleMatrix(0,0,mxREAL);125 mxSetM(pfield,M);126 mxSetN(pfield,1);127 mxSetPr(pfield,serial_vec);128 mxSetField( dataref, 0, param->GetParameterName(),pfield);129 break;130 131 case PETSCMAT:132 param->GetParameterValue(&mat);133 MatToSerial(&serial_mat,mat);134 MatFree(&mat);135 M=param->GetM();136 N=param->GetN();137 pfield=mxCreateDoubleMatrix(0,0,mxREAL);138 mxSetM(pfield,M);139 mxSetN(pfield,N);140 mxSetPr(pfield,serial_mat);141 mxSetField( dataref, 0, param->GetParameterName(),pfield);142 break;143 default:144 ISSMERROR("%s%i","unknown parameter type: ",param->GetType());145 break;146 }147 }148 149 53 /*Assign output pointers:*/ 150 54 *pdataref=dataref; -
issm/trunk/src/c/io/io.h
r3314 r3673 33 33 34 34 void WriteNodeSets(DataHandle* pdataref,NodeSets* nodesets); 35 void WriteParams(DataHandle* pdataref, DataSet* parameters);35 void WriteParams(DataHandle* pdataref,Parameters* parameters); 36 36 37 37 void FetchData(DataSet** pdataset,const mxArray* dataref); -
issm/trunk/src/c/objects/Beam.cpp
r3622 r3673 586 586 } 587 587 /*}}}*/ 588 /*FUNCTION Beam:: GetId{{{1*/589 int Beam:: GetId(void){ return id; }588 /*FUNCTION Beam::Id{{{1*/ 589 int Beam::Id(void){ return id; } 590 590 /*}}}*/ 591 591 /*FUNCTION Beam::GetJacobianDeterminant{{{1*/ … … 614 614 615 615 return matpar; 616 }617 /*}}}*/618 /*FUNCTION Beam::GetName{{{1*/619 char* Beam::GetName(void){620 return "beam";621 616 } 622 617 /*}}}*/ -
issm/trunk/src/c/objects/Beam.h
r3637 r3673 13 13 #include "./Matice.h" 14 14 #include "./Matpar.h" 15 #include "../shared/Exceptions/exceptions.h" 16 #include "../include/macros.h" 15 17 #include "../ModelProcessorx/IoModel.h" 16 18 #include "../DataSet/Inputs.h" … … 52 54 void Marshall(char** pmarshalled_dataset); 53 55 int MarshallSize(); 54 char* GetName();55 56 void Demarshall(char** pmarshalled_dataset); 56 57 int Enum(); 57 int GetId();58 int Id(); 58 59 int MyRank(); 59 60 void Configure(DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters); … … 94 95 void GetJacobianDeterminant(double* pJdet,double* z_list, double gauss_coord); 95 96 double MassFlux(double* segment,double* ug); 97 void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");} 96 98 /*}}}*/ 97 99 -
issm/trunk/src/c/objects/DakotaPlugin.cpp
r2048 r3673 44 44 45 45 //constructor 46 DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_model, void* in_inputs,int in_analysis_type, int in_sub_analysis_type):Dakota::DirectApplicInterface(problem_db){46 DakotaPlugin::DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* in_model, int in_analysis_type, int in_sub_analysis_type):Dakota::DirectApplicInterface(problem_db){ 47 47 48 48 49 49 model=in_model; 50 inputs=in_inputs;51 50 analysis_type=in_analysis_type; 52 51 sub_analysis_type=in_sub_analysis_type; … … 90 89 91 90 /*run core solution: */ 92 SpawnCore(responses,numFns, variables,variable_descriptors,numACV,model, inputs,analysis_type,sub_analysis_type,counter);91 SpawnCore(responses,numFns, variables,variable_descriptors,numACV,model,analysis_type,sub_analysis_type,counter); 93 92 94 93 /*populate responses: */ -
issm/trunk/src/c/objects/DakotaPlugin.h
r3637 r3673 24 24 public: 25 25 26 DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model, void* inputs,int analysis_type, int sub_analysis_type);26 DakotaPlugin(const Dakota::ProblemDescDB& problem_db,void* model, int analysis_type, int sub_analysis_type); 27 27 ~DakotaPlugin(); 28 28 29 29 /*these fields are used by core solutions: */ 30 30 void* model; 31 void* inputs;32 31 33 32 int analysis_type; -
issm/trunk/src/c/objects/DofVec.cpp
r3570 r3673 231 231 } 232 232 /*}}}*/ 233 /*FUNCTION DofVec:: GetId {{{1*/234 int DofVec:: GetId(void){233 /*FUNCTION DofVec::Id {{{1*/ 234 int DofVec::Id(void){ 235 235 ISSMERROR(" no id function for DofVec class"); 236 236 } 237 237 238 /*FUNCTION DofVec::GetName {{{1*/239 char* DofVec::GetName(void){240 char* string=NULL;241 string=(char*)xmalloc((strlen(this->name)+1)*sizeof(char));242 strcpy(string,this->name);243 return string;244 }245 /*}}}*/246 238 /*FUNCTION DofVec::GetVec {{{1*/ 247 239 Vec DofVec::GetVec(void){ -
issm/trunk/src/c/objects/DofVec.h
r3637 r3673 42 42 void Marshall(char** pmarshalled_dataset); 43 43 int MarshallSize(); 44 char* GetName();45 44 void Demarshall(char** pmarshalled_dataset); 46 45 int Enum(); 47 int GetId();46 int Id(); 48 47 int MyRank(); 49 48 int Size(); -
issm/trunk/src/c/objects/Element.h
r3637 r3673 22 22 23 23 virtual ~Element(){}; 24 virtual int Enum()=0;25 24 virtual void Configure(DataSet* loads,DataSet* nodes,DataSet* materials,Parameters* parameters)=0; 26 25 … … 45 44 virtual void ComputeStrainRate(Vec eps, int analysis_type,int sub_analysis_type)=0; 46 45 virtual double MassFlux(double* segment,double* ug)=0; 46 virtual void AddInput(double value, int enum_type)=0; 47 47 48 48 /*Implementation: */ -
issm/trunk/src/c/objects/FemModel.cpp
r3620 r3673 144 144 } 145 145 /*}}}*/ 146 /*FUNCTION FemModel:: GetId {{{1*/147 int FemModel:: GetId(void){146 /*FUNCTION FemModel::Id {{{1*/ 147 int FemModel::Id(void){ 148 148 ISSMERROR("not implemented yet!"); 149 149 } … … 164 164 } 165 165 /*}}}*/ 166 /*FUNCTION FemModel::GetName {{{1*/167 char* FemModel::GetName(void){168 ISSMERROR("not implemented yet!");169 }170 /*}}}*/171 166 /*FUNCTION FemModel::Demarshall {{{1*/ 172 167 void FemModel::Demarshall(char** pmarshalled_dataset){ … … 184 179 } 185 180 /*}}}*/ 186 /*FUNCTION FemModel::FindParam(double* pscalar, char* name) {{{1*/187 int FemModel::FindParam(double* pscalar, char* name){188 189 return parameters->FindParam(pscalar, name);190 191 } 192 /*}}}*/ 193 /*FUNCTION FemModel::FindParam(int* pinteger, char* name) {{{1*/194 int FemModel::FindParam(int* pinteger, char* name){195 196 return parameters->FindParam(pinteger, name);197 198 } 199 /*}}}*/ 200 /*FUNCTION FemModel::FindParam(char** pstring, char* name) {{{1*/201 int FemModel::FindParam(char** pstring, char* name){202 203 return parameters->FindParam(pstring, name);204 205 } 206 /*}}}*/ 207 /*FUNCTION FemModel::FindParam(char*** pstringarray,int* pM, char* name) {{{1*/208 int FemModel::FindParam(char*** pstringarray,int* pM, char* name){209 210 return parameters->FindParam(pstringarray,pM, name);211 212 } 213 /*}}}*/ 214 /*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int* pN, char* name) {{{1*/215 int FemModel::FindParam(double** pdoublearray,int* pM,int* pN, char* name){216 217 return parameters->FindParam(pdoublearray,pM,pN, name);218 219 } 220 /*}}}*/ 221 /*FUNCTION FemModel::FindParam(Vec* pvec, char* name) {{{1*/222 int FemModel::FindParam(Vec* pvec, char* name){223 224 return parameters->FindParam(pvec, name);225 226 } 227 /*}}}*/ 228 /*FUNCTION FemModel::FindParam(Mat* pmat, char* name) {{{1*/229 int FemModel::FindParam(Mat* pmat, char* name){230 231 return parameters->FindParam(pmat, name);181 /*FUNCTION FemModel::FindParam(double* pscalar,int enum_type) {{{1*/ 182 int FemModel::FindParam(double* pscalar,int enum_type){ 183 184 return parameters->FindParam(pscalar,enum_type); 185 186 } 187 /*}}}*/ 188 /*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/ 189 int FemModel::FindParam(int* pinteger,int enum_type){ 190 191 return parameters->FindParam(pinteger,enum_type); 192 193 } 194 /*}}}*/ 195 /*FUNCTION FemModel::FindParam(char** pstring,int enum_type) {{{1*/ 196 int FemModel::FindParam(char** pstring,int enum_type){ 197 198 return parameters->FindParam(pstring,enum_type); 199 200 } 201 /*}}}*/ 202 /*FUNCTION FemModel::FindParam(char*** pstringarray,int* pM,int enum_type) {{{1*/ 203 int FemModel::FindParam(char*** pstringarray,int* pM,int enum_type){ 204 205 return parameters->FindParam(pstringarray,pM,enum_type); 206 207 } 208 /*}}}*/ 209 /*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int* pN,int enum_type) {{{1*/ 210 int FemModel::FindParam(double** pdoublearray,int* pM,int* pN,int enum_type){ 211 212 return parameters->FindParam(pdoublearray,pM,pN,enum_type); 213 214 } 215 /*}}}*/ 216 /*FUNCTION FemModel::FindParam(Vec* pvec,int enum_type) {{{1*/ 217 int FemModel::FindParam(Vec* pvec,int enum_type){ 218 219 return parameters->FindParam(pvec,enum_type); 220 221 } 222 /*}}}*/ 223 /*FUNCTION FemModel::FindParam(Mat* pmat,int enum_type) {{{1*/ 224 int FemModel::FindParam(Mat* pmat,int enum_type){ 225 226 return parameters->FindParam(pmat,enum_type); 232 227 233 228 } -
issm/trunk/src/c/objects/FemModel.h
r3637 r3673 50 50 void Echo(); 51 51 void DeepEcho(); 52 int GetId();52 int Id(); 53 53 int MyRank(); 54 54 void Marshall(char** pmarshalled_dataset); 55 55 int MarshallSize(); 56 char* GetName();57 56 void Demarshall(char** pmarshalled_dataset); 58 57 int Enum(); 59 58 Object* copy(); 60 59 61 int FindParam(double* pscalar, char* name);62 int FindParam(int* pinteger, char* name);63 int FindParam(char** pstring, char* name);64 int FindParam(char*** pstringarray,int* pM, char* name);65 int FindParam(double** pdoublearray,int* pM, int* pN, char* name);66 int FindParam(Vec* pvec, char* name);67 int FindParam(Mat* pmat, char* name);60 int FindParam(double* pscalar,int enum_type); 61 int FindParam(int* pinteger,int enum_type); 62 int FindParam(char** pstring,int enum_type); 63 int FindParam(char*** pstringarray,int* pM,int enum_type); 64 int FindParam(double** pdoublearray,int* pM, int* pN,int enum_type); 65 int FindParam(Vec* pvec,int enum_type); 66 int FindParam(Mat* pmat,int enum_type); 68 67 DataSet* get_elements(void); 69 68 DataSet* get_nodes(void); -
issm/trunk/src/c/objects/Hook.cpp
r3612 r3673 77 77 this->num=input->GetNum(); 78 78 input_objects=input->GetObjects(); 79 input_ids=input-> GetIds();79 input_ids=input->Ids(); 80 80 input_offsets=input->GetOffsets(); 81 81 … … 195 195 /*Check whether existing this->objects are correct: */ 196 196 if(this->objects[i]){ 197 if(this->objects[i]-> GetId()==this->ids[i]) continue; //this node is good.197 if(this->objects[i]->Id()==this->ids[i]) continue; //this node is good. 198 198 else this->objects[i]=NULL; //this node was incorrect, reset it. 199 199 } … … 204 204 * we are good: */ 205 205 object=(Object*)dataset->GetObjectByOffset(this->offsets[i]); 206 if (object-> GetId()==this->ids[i]){206 if (object->Id()==this->ids[i]){ 207 207 this->objects[i]=object; 208 208 continue; … … 215 215 this->objects[i]=(Object*)dataset->GetObjectById(this->offsets+i,this->ids[i]); //remember the offset for later on. 216 216 /*check the id is correct!: */ 217 if (this->objects[i]-> GetId()!=this->ids[i]) ISSMERROR("%s%i%s%i%s"," wrong id: ",this->objects[i]->GetId()," vs ",this->ids[i]," in resolved pointer!");217 if (this->objects[i]->Id()!=this->ids[i]) ISSMERROR("%s%i%s%i%s"," wrong id: ",this->objects[i]->Id()," vs ",this->ids[i]," in resolved pointer!"); 218 218 } 219 219 } … … 294 294 } 295 295 /*}}}*/ 296 /*FUNCTION Hook:: GetIds{{{1*/297 int* Hook:: GetIds(void){296 /*FUNCTION Hook::Ids{{{1*/ 297 int* Hook::Ids(void){ 298 298 return this->ids; 299 299 } -
issm/trunk/src/c/objects/Hook.h
r3637 r3673 45 45 Hook* Spawn(int* indices, int numindices); 46 46 Object** GetObjects(void); 47 int* GetIds(void);47 int* Ids(void); 48 48 int* GetOffsets(void); 49 49 int GetNum(void); -
issm/trunk/src/c/objects/Icefront.cpp
r3637 r3673 41 41 } 42 42 /*}}}*/ 43 /*FUNCTION Icefront::Icefront(int id, Hook* hnodes, Hook* helement, Hook* hmatpar, DataSet* parameters, Inputs* icefront_inputs) {{{1*/43 /*FUNCTION Icefront::Icefront(int id, Hook* hnodes, Hook* helement, Hook* hmatpar, Parameters* parameters, Inputs* icefront_inputs) {{{1*/ 44 44 Icefront::Icefront(int icefront_id,Hook* icefront_hnodes, Hook* icefront_helement, Hook* icefront_hmatpar, Parameters* icefront_parameters, Inputs* icefront_inputs): 45 45 hnodes(icefront_hnodes), … … 214 214 } 215 215 /*}}}*/ 216 /*FUNCTION Icefront GetId {{{1*/ 217 int Icefront::GetId(void){ return id; } 218 /*}}}*/ 219 /*FUNCTION Icefront GetName {{{1*/ 220 char* Icefront::GetName(void){ 221 return "icefront"; 222 } 216 /*FUNCTION Icefront Id {{{1*/ 217 int Icefront::Id(void){ return id; } 223 218 /*}}}*/ 224 219 /*FUNCTION Icefront::Marshall {{{1*/ -
issm/trunk/src/c/objects/Icefront.h
r3637 r3673 52 52 void Echo(); 53 53 int Enum(); 54 int GetId(); 55 char* GetName(); 54 int Id(); 56 55 void Marshall(char** pmarshalled_dataset); 57 56 int MarshallSize(); -
issm/trunk/src/c/objects/Load.h
r3637 r3673 25 25 virtual void Echo()=0; 26 26 virtual void DeepEcho()=0; 27 virtual int GetId()=0;27 virtual int Id()=0; 28 28 virtual int MyRank()=0; 29 29 virtual void Marshall(char** pmarshalled_dataset)=0; 30 30 virtual int MarshallSize()=0; 31 virtual char* GetName()=0;32 31 virtual void Demarshall(char** pmarshalled_dataset)=0; 33 32 virtual void Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* vertices,DataSet* materials,Parameters* parameters)=0; -
issm/trunk/src/c/objects/Material.h
r3637 r3673 20 20 virtual void Echo()=0; 21 21 virtual void DeepEcho()=0; 22 virtual int GetId()=0;22 virtual int Id()=0; 23 23 virtual int MyRank()=0; 24 24 virtual void Marshall(char** pmarshalled_dataset)=0; 25 25 virtual int MarshallSize()=0; 26 virtual char* GetName()=0;27 26 virtual void Demarshall(char** pmarshalled_dataset)=0; 28 27 virtual void UpdateFromInputs(void* inputs)=0; -
issm/trunk/src/c/objects/Matice.cpp
r3622 r3673 180 180 } 181 181 /*}}}*/ 182 /*FUNCTION Matice:: GetId {{{1*/183 int Matice:: GetId(void){ return mid; }182 /*FUNCTION Matice::Id {{{1*/ 183 int Matice::Id(void){ return mid; } 184 184 /*}}}*/ 185 185 /*FUNCTION Matice::GetN {{{1*/ 186 186 double Matice::GetN(){ 187 187 return n; 188 }189 /*}}}*/190 /*FUNCTION Matice::GetName {{{1*/191 char* Matice::GetName(void){192 return "matice";193 188 } 194 189 /*}}}*/ -
issm/trunk/src/c/objects/Matice.h
r3637 r3673 32 32 void Marshall(char** pmarshalled_dataset); 33 33 int MarshallSize(); 34 char* GetName();35 34 void Demarshall(char** pmarshalled_dataset); 36 35 int Enum(); 37 int GetId();36 int Id(); 38 37 int MyRank(); 39 38 void DistributeNumDofs(int* numdofspernode,int analysis_type); -
issm/trunk/src/c/objects/Matpar.cpp
r3622 r3673 230 230 } 231 231 /*}}}1*/ 232 /*FUNCTION Matpar:: GetId {{{1*/233 int Matpar:: GetId(void){ return mid; }232 /*FUNCTION Matpar::Id {{{1*/ 233 int Matpar::Id(void){ return mid; } 234 234 /*}}}1*/ 235 235 /*FUNCTION Matpar::GetLatentHeat {{{1*/ … … 246 246 double Matpar::GetMixedLayerCapacity(){ 247 247 return mixed_layer_capacity; 248 }249 /*}}}1*/250 /*FUNCTION Matpar::GetName {{{1*/251 char* Matpar::GetName(void){252 return "matpar";253 248 } 254 249 /*}}}1*/ -
issm/trunk/src/c/objects/Matpar.h
r3637 r3673 41 41 void Marshall(char** pmarshalled_dataset); 42 42 int MarshallSize(); 43 char* GetName();44 43 void Demarshall(char** pmarshalled_dataset); 45 44 int Enum(); 46 int GetId();45 int Id(); 47 46 int MyRank(); 48 47 void DistributeNumDofs(int* numdofspernode,int analysis_type); -
issm/trunk/src/c/objects/Model.cpp
r3632 r3673 3 3 */ 4 4 5 #include "./objects.h"6 #include "../io/io.h"7 #include "../shared/shared.h"8 #include "../include/macros.h"9 5 #include "../issm.h" 10 6 … … 16 12 17 13 #include "./Model.h" 14 #include "../EnumDefinitions/EnumDefinitions.h" 18 15 #include "stdio.h" 19 16 … … 205 202 } 206 203 /*}}}1*/ 207 /*FUNCTION Model::FindParam(int* pparameter, char* parametername {{{1*/208 209 int Model::FindParam(int* pparameter, char* parametername){204 /*FUNCTION Model::FindParam(int* pparameter,int enum_type {{{1*/ 205 206 int Model::FindParam(int* pparameter,int enum_type){ 210 207 211 208 FemModel* femmodel=NULL; … … 219 216 if(!femmodel)return 0; 220 217 221 femmodel->FindParam(pparameter, parametername);222 223 } 224 /*}}}1*/ 225 /*FUNCTION Model::FindParam(double* pparameter, char* parametername ){{{1*/226 int Model::FindParam(double* pparameter, char* parametername){218 femmodel->FindParam(pparameter,enum_type); 219 220 } 221 /*}}}1*/ 222 /*FUNCTION Model::FindParam(double* pparameter,int enum_type ){{{1*/ 223 int Model::FindParam(double* pparameter,int enum_type){ 227 224 228 225 FemModel* femmodel=NULL; … … 236 233 if(!femmodel)return 0; 237 234 238 femmodel->FindParam(pparameter, parametername);239 240 241 } 242 /*}}}1*/ 243 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int *pN, char* parametername) {{{1*/244 int Model::FindParam(double** pparameter,int* pM, int *pN, char* parametername){235 femmodel->FindParam(pparameter,enum_type); 236 237 238 } 239 /*}}}1*/ 240 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int *pN,int enum_type) {{{1*/ 241 int Model::FindParam(double** pparameter,int* pM, int *pN,int enum_type){ 245 242 246 243 FemModel* femmodel=NULL; … … 254 251 if(!femmodel)return 0; 255 252 256 femmodel->FindParam(pparameter,pM, pN, parametername);257 258 259 } 260 /*}}}1*/ 261 /*FUNCTION Model::FindParam(char** pparameter, char* parametername) {{{1*/262 int Model::FindParam(char** pparameter, char* parametername){253 femmodel->FindParam(pparameter,pM, pN,enum_type); 254 255 256 } 257 /*}}}1*/ 258 /*FUNCTION Model::FindParam(char** pparameter,int enum_type) {{{1*/ 259 int Model::FindParam(char** pparameter,int enum_type){ 263 260 264 261 FemModel* femmodel=NULL; … … 272 269 if(!femmodel)return 0; 273 270 274 femmodel->FindParam(pparameter, parametername);275 276 } 277 /*}}}1*/ 278 /*FUNCTION Model::FindParam(int* pparameter, char* parametername,int analysis_type,int sub_analysis_type) {{{1*/279 int Model::FindParam(int* pparameter, char* parametername,int analysis_type,int sub_analysis_type){271 femmodel->FindParam(pparameter,enum_type); 272 273 } 274 /*}}}1*/ 275 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 276 int Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){ 280 277 281 278 FemModel* femmodel=NULL; … … 287 284 288 285 /*extract our parameter from the found formulation: */ 289 femmodel->FindParam(pparameter, parametername);290 } 291 /*}}}1*/ 292 /*FUNCTION Model::FindParam(double* pparameter, char* parametername,int analysis_type,int sub_analysis_type) {{{1*/293 int Model::FindParam(double* pparameter, char* parametername,int analysis_type,int sub_analysis_type){286 femmodel->FindParam(pparameter,enum_type); 287 } 288 /*}}}1*/ 289 /*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 290 int Model::FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type){ 294 291 295 292 FemModel* femmodel=NULL; … … 301 298 302 299 /*extract our parameter from the found formulation: */ 303 femmodel->FindParam(pparameter, parametername);304 } 305 /*}}}1*/ 306 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN, char* parametername,int analysis_type,int sub_analysis_type) {{{1*/307 int Model::FindParam(double** pparameter,int* pM, int* pN, char* parametername,int analysis_type,int sub_analysis_type){300 femmodel->FindParam(pparameter,enum_type); 301 } 302 /*}}}1*/ 303 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 304 int Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type){ 308 305 309 306 FemModel* femmodel=NULL; … … 315 312 316 313 /*extract our parameter from the found formulation: */ 317 femmodel->FindParam(pparameter,pM, pN, parametername);318 } 319 /*}}}1*/ 320 /*FUNCTION Model::FindParam(char** pparameter, char* parametername,int analysis_type,int sub_analysis_type) {{{1*/321 int Model::FindParam(char** pparameter, char* parametername,int analysis_type,int sub_analysis_type){314 femmodel->FindParam(pparameter,pM, pN,enum_type); 315 } 316 /*}}}1*/ 317 /*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 318 int Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){ 322 319 323 320 FemModel* femmodel=NULL; … … 329 326 330 327 /*extract our parameter from the found formulation: */ 331 femmodel->FindParam(pparameter, parametername);332 } 333 /*}}}1*/ 334 /*FUNCTION Model::FindParam(int* pparameter, char* parametername,int analysis_type) {{{1*/335 int Model::FindParam(int* pparameter, char* parametername,int analysis_type){328 femmodel->FindParam(pparameter,enum_type); 329 } 330 /*}}}1*/ 331 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type) {{{1*/ 332 int Model::FindParam(int* pparameter,int enum_type,int analysis_type){ 336 333 337 334 FemModel* femmodel=NULL; … … 343 340 344 341 /*extract our parameter from the found formulation: */ 345 femmodel->FindParam(pparameter, parametername);346 } 347 /*}}}1*/ 348 /*FUNCTION Model::FindParam(double* pparameter, char* parametername,int analysis_type) {{{1*/349 int Model::FindParam(double* pparameter, char* parametername,int analysis_type){342 femmodel->FindParam(pparameter,enum_type); 343 } 344 /*}}}1*/ 345 /*FUNCTION Model::FindParam(double* pparameter,int enum_type,int analysis_type) {{{1*/ 346 int Model::FindParam(double* pparameter,int enum_type,int analysis_type){ 350 347 351 348 FemModel* femmodel=NULL; … … 357 354 358 355 /*extract our parameter from the found formulation: */ 359 femmodel->FindParam(pparameter, parametername);360 } 361 /*}}}1*/ 362 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN, char* parametername,int analysis_type) {{{1*/363 int Model::FindParam(double** pparameter,int* pM, int* pN, char* parametername,int analysis_type){356 femmodel->FindParam(pparameter,enum_type); 357 } 358 /*}}}1*/ 359 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type) {{{1*/ 360 int Model::FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type){ 364 361 365 362 FemModel* femmodel=NULL; … … 371 368 372 369 /*extract our parameter from the found formulation: */ 373 femmodel->FindParam(pparameter,pM,pN, parametername);374 } 375 /*}}}1*/ 376 /*FUNCTION Model::FindParam(char** pparameter, char* parametername,int analysis_type) {{{1*/377 int Model::FindParam(char** pparameter, char* parametername,int analysis_type){370 femmodel->FindParam(pparameter,pM,pN,enum_type); 371 } 372 /*}}}1*/ 373 /*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type) {{{1*/ 374 int Model::FindParam(char** pparameter,int enum_type,int analysis_type){ 378 375 379 376 FemModel* femmodel=NULL; … … 385 382 386 383 /*extract our parameter from the found formulation: */ 387 femmodel->FindParam(pparameter, parametername);384 femmodel->FindParam(pparameter,enum_type); 388 385 } 389 386 /*}}}1*/ … … 407 404 408 405 femmodel=(FemModel*)femmodels->GetObjectByOffset(i); 409 femmodel->FindParam(&femmodel_analysis_type, "analysis_type");410 femmodel->FindParam(&femmodel_sub_analysis_type, "sub_analysis_type");406 femmodel->FindParam(&femmodel_analysis_type,AnalysisTypeEnum); 407 femmodel->FindParam(&femmodel_sub_analysis_type,SubAnalysisTypeEnum); 411 408 412 409 if((analysis_type==femmodel_analysis_type) && (sub_analysis_type==femmodel_sub_analysis_type)){ … … 436 433 437 434 femmodel=(FemModel*)femmodels->GetObjectByOffset(i); 438 femmodel->FindParam(&femmodel_analysis_type, "analysis_type");435 femmodel->FindParam(&femmodel_analysis_type,AnalysisTypeEnum); 439 436 440 437 if((analysis_type==femmodel_analysis_type)){ -
issm/trunk/src/c/objects/Model.h
r3637 r3673 35 35 36 36 /*all overloaded forms of the FindParam routine: */ 37 int FindParam(int* pparameter, char* parametername);38 int FindParam(double* pparameter, char* parametername);39 int FindParam(double** pparameter,int* pM,int* pN, char* parametername);40 int FindParam(char** pparameter, char* parametername);37 int FindParam(int* pparameter,int enum_type); 38 int FindParam(double* pparameter,int enum_type); 39 int FindParam(double** pparameter,int* pM,int* pN,int enum_type); 40 int FindParam(char** pparameter,int enum_type); 41 41 42 int FindParam(int* pparameter, char* parametername,int analysis_type,int sub_analysis_type);43 int FindParam(double* pparameter, char* parametername,int analysis_type,int sub_analysis_type);44 int FindParam(double** pparameter,int* pM, int* pN, char* parametername,int analysis_type,int sub_analysis_type);45 int FindParam(char** pparameter, char* parametername,int analysis_type,int sub_analysis_type);42 int FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type); 43 int FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type); 44 int FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type); 45 int FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type); 46 46 47 int FindParam(int* pparameter, char* parametername,int analysis_type);48 int FindParam(double* pparameter, char* parametername,int analysis_type);49 int FindParam(double** pparameter,int* pM,int* pN, char* parametername,int analysis_type);50 int FindParam(char** pparameter, char* parametername,int analysis_type);47 int FindParam(int* pparameter,int enum_type,int analysis_type); 48 int FindParam(double* pparameter,int enum_type,int analysis_type); 49 int FindParam(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type); 50 int FindParam(char** pparameter,int enum_type,int analysis_type); 51 51 52 52 FemModel* GetFormulation(int analysis_type,int sub_analysis_type); -
issm/trunk/src/c/objects/Node.cpp
r3649 r3673 336 336 } 337 337 /*}}}*/ 338 /*FUNCTION Node::GetId{{{2*/ 339 int Node::GetId(void){ return id; } 340 /*}}}*/ 341 /*FUNCTION Node::GetName{{{2*/ 342 char* Node::GetName(void){ 343 return "node"; 344 } 338 /*FUNCTION Node::Id{{{2*/ 339 int Node::Id(void){ return id; } 345 340 /*}}}*/ 346 341 /*FUNCTION Node::GetVertexDof {{{2*/ -
issm/trunk/src/c/objects/Node.h
r3649 r3673 44 44 void Echo(); 45 45 int Enum(); 46 int GetId(void); 47 char* GetName(); 46 int Id(void); 48 47 int GetVertexDof(void); 49 48 void Marshall(char** pmarshalled_dataset); -
issm/trunk/src/c/objects/Numericalflux.cpp
r3649 r3673 37 37 } 38 38 /*}}}*/ 39 /*FUNCTION Numericalflux::Numericalflux(int id, Hook* hnodes, Hook* helements, DataSet* parameters, Inputs* numericalflux_inputs) {{{1*/39 /*FUNCTION Numericalflux::Numericalflux(int id, Hook* hnodes, Hook* helements, Parameters* parameters, Inputs* numericalflux_inputs) {{{1*/ 40 40 Numericalflux::Numericalflux(int numericalflux_id,Hook* numericalflux_hnodes, Hook* numericalflux_helements, Parameters* numericalflux_parameters, Inputs* numericalflux_inputs): 41 41 hnodes(numericalflux_hnodes), … … 352 352 /*recover parameters: */ 353 353 if (analysis_type==Prognostic2AnalysisEnum){ 354 parameters->FindParam(&dt, "dt");354 parameters->FindParam(&dt,DtEnum); 355 355 } 356 356 else if (analysis_type==Balancedthickness2AnalysisEnum){ … … 467 467 /*recover parameters: */ 468 468 if (analysis_type==Prognostic2AnalysisEnum){ 469 parameters->FindParam(&dt, "dt");469 parameters->FindParam(&dt,DtEnum); 470 470 } 471 471 else if (analysis_type==Balancedthickness2AnalysisEnum){ … … 612 612 /*recover parameters: */ 613 613 if (analysis_type==Prognostic2AnalysisEnum){ 614 parameters->FindParam(&dt, "dt");614 parameters->FindParam(&dt,DtEnum); 615 615 } 616 616 else if (analysis_type==Balancedthickness2AnalysisEnum){ … … 737 737 } 738 738 /*}}}*/ 739 /*FUNCTION Numericalflux:: GetId {{{1*/740 int Numericalflux:: GetId(void){739 /*FUNCTION Numericalflux::Id {{{1*/ 740 int Numericalflux::Id(void){ 741 741 return id; 742 742 } … … 778 778 } 779 779 /*}}}*/ 780 /*FUNCTION Numericalflux::GetName {{{1*/781 char* Numericalflux::GetName(void){782 return "numericalflux";783 }784 /*}}}*/785 780 /*FUNCTION Numericalflux::GetNodalFunctions{{{1*/ 786 781 void Numericalflux::GetNodalFunctions(double* l1l4, double gauss_coord){ -
issm/trunk/src/c/objects/Numericalflux.h
r3649 r3673 38 38 void Echo(); 39 39 int Enum(); 40 int GetId(); 41 char* GetName(); 40 int Id(); 42 41 void Marshall(char** pmarshalled_dataset); 43 42 int MarshallSize(); -
issm/trunk/src/c/objects/Object.h
r3463 r3673 18 18 virtual void Echo()=0; 19 19 virtual void DeepEcho()=0; 20 virtual int GetId()=0;20 virtual int Id()=0; 21 21 virtual int MyRank()=0; 22 22 virtual void Marshall(char** pmarshalled_dataset)=0; 23 23 virtual int MarshallSize()=0; 24 virtual char* GetName()=0;25 24 virtual void Demarshall(char** pmarshalled_dataset)=0; 26 25 virtual int Enum()=0; -
issm/trunk/src/c/objects/Pengrid.cpp
r3647 r3673 51 51 } 52 52 /*}}}*/ 53 /*FUNCTION Pengrid::Pengrid(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* pengrid_inputs) {{{1*/53 /*FUNCTION Pengrid::Pengrid(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* pengrid_inputs) {{{1*/ 54 54 Pengrid::Pengrid(int pengrid_id,Hook* pengrid_hnode, Hook* pengrid_helement,Hook* pengrid_hmatpar, Parameters* pengrid_parameters, Inputs* pengrid_inputs): 55 55 hnode(pengrid_hnode), … … 191 191 } 192 192 /*}}}1*/ 193 /*FUNCTION Pengrid::GetId {{{1*/ 194 int Pengrid::GetId(void){ return id; } 195 /*}}}1*/ 196 /*FUNCTION Pengrid::GetName {{{1*/ 197 char* Pengrid::GetName(void){ 198 return "pengrid"; 199 } 193 /*FUNCTION Pengrid::Id {{{1*/ 194 int Pengrid::Id(void){ return id; } 200 195 /*}}}1*/ 201 196 /*FUNCTION Pengrid::Marshall {{{1*/ … … 371 366 meltingpoint=matpar->GetMeltingPoint(); 372 367 beta=matpar->GetBeta(); 373 parameters->FindParam(&stabilize_constraints, "stabilize_constraints");368 parameters->FindParam(&stabilize_constraints,StabilizeConstraintsEnum); 374 369 375 370 if(reset_penalties)zigzag_counter=0; … … 467 462 468 463 /*recover parameters: */ 469 parameters->FindParam(&penalty_offset, "penalty_offset");464 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 470 465 471 466 //Create elementary matrix: add penalty to contrain wb (wb=ub*db/dx+vb*db/dy) … … 515 510 516 511 /*recover parameters: */ 517 parameters->FindParam(&penalty_offset, "penalty_offset");512 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 518 513 519 514 /*Get dof list: */ … … 549 544 550 545 /*recover parameters: */ 551 parameters->FindParam(&penalty_offset, "penalty_offset");546 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 552 547 553 548 /*Get dof list: */ … … 625 620 penta->inputs->GetParameterValue(&temperature,node,TemperatureEnum); 626 621 inputs->GetParameterValue(&melting_offset,MeltingOffsetEnum); 627 parameters->FindParam(&dt, "dt");628 parameters->FindParam(&penalty_offset, "penalty_offset");622 parameters->FindParam(&dt,DtEnum); 623 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 629 624 630 625 meltingpoint=matpar->GetMeltingPoint(); … … 690 685 //First recover pressure and penalty_offset 691 686 penta->inputs->GetParameterValue(&pressure,node,PressureEnum); 692 parameters->FindParam(&penalty_offset, "penalty_offset");687 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 693 688 694 689 //Compute pressure melting point -
issm/trunk/src/c/objects/Pengrid.h
r3637 r3673 48 48 void Echo(); 49 49 int Enum(); 50 int GetId(); 51 char* GetName(); 50 int Id(); 52 51 void Marshall(char** pmarshalled_dataset); 53 52 int MarshallSize(); -
issm/trunk/src/c/objects/Penpair.cpp
r3632 r3673 170 170 } 171 171 /*}}}1*/ 172 /*FUNCTION Penpair::GetId {{{1*/ 173 int Penpair::GetId(void){ return id; } 174 /*}}}1*/ 175 /*FUNCTION Penpair::GetName {{{1*/ 176 char* Penpair::GetName(void){ 177 return "penpair"; 178 } 172 /*FUNCTION Penpair::Id {{{1*/ 173 int Penpair::Id(void){ return id; } 179 174 /*}}}1*/ 180 175 /*FUNCTION Penpair::MyRank {{{1*/ -
issm/trunk/src/c/objects/Penpair.h
r3637 r3673 33 33 void Marshall(char** pmarshalled_dataset); 34 34 int MarshallSize(); 35 char* GetName();36 35 void Demarshall(char** pmarshalled_dataset); 37 36 int Enum(); 38 int GetId();37 int Id(); 39 38 int MyRank(); 40 39 void Configure(DataSet* elements,DataSet* loads,DataSet* nodes,DataSet* vertices,DataSet* materials,Parameters* parameters); -
issm/trunk/src/c/objects/Penta.cpp
r3629 r3673 41 41 } 42 42 /*}}}*/ 43 /*FUNCTION Penta::Penta(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* penta_inputs) {{{1*/43 /*FUNCTION Penta::Penta(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* penta_inputs) {{{1*/ 44 44 Penta::Penta(int penta_id,Hook* penta_hnodes, Hook* penta_hmatice, Hook* penta_hmatpar, Parameters* penta_parameters, Inputs* penta_inputs): 45 45 hnodes(penta_hnodes), … … 510 510 511 511 /*retrieve some parameters: */ 512 this->parameters->FindParam(&stokesreconditioning, "stokesreconditioning");512 this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 513 513 514 514 if(!onbed){ … … 900 900 901 901 /*retrieve some parameters: */ 902 this->parameters->FindParam(&viscosity_overshoot, "viscosity_overshoot");902 this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum); 903 903 904 904 /*If on water, skip stiffness: */ … … 1144 1144 1145 1145 /*retrieve some parameters: */ 1146 this->parameters->FindParam(&stokesreconditioning, "stokesreconditioning");1146 this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 1147 1147 1148 1148 /* Get node coordinates and dof list: */ … … 1665 1665 1666 1666 /*retrieve some parameters: */ 1667 this->parameters->FindParam(&dt, "dt");1668 this->parameters->FindParam(&artdiff, "art_diff");1669 this->parameters->FindParam(&epsvel, "epsvel");1667 this->parameters->FindParam(&dt,DtEnum); 1668 this->parameters->FindParam(&artdiff,ArtDiffEnum); 1669 this->parameters->FindParam(&epsvel,EpsVelEnum); 1670 1670 1671 1671 /* Get gaussian points and weights. Penta is an extrusion of a Tria, we therefore … … 2164 2164 2165 2165 /*retrieve some parameters: */ 2166 this->parameters->FindParam(&stokesreconditioning, "stokesreconditioning");2166 this->parameters->FindParam(&stokesreconditioning,StokesReconditioningEnum); 2167 2167 2168 2168 /*If on water, skip load: */ … … 2613 2613 2614 2614 /*retrieve some parameters: */ 2615 this->parameters->FindParam(&dt, "dt");2615 this->parameters->FindParam(&dt,DtEnum); 2616 2616 2617 2617 /*If on water, skip: */ … … 3368 3368 } 3369 3369 /*}}}*/ 3370 /*FUNCTION GetId {{{1*/3371 int Penta:: GetId(void){3370 /*FUNCTION Id {{{1*/ 3371 int Penta::Id(void){ 3372 3372 return id; 3373 3373 } … … 3709 3709 } 3710 3710 /*}}}*/ 3711 /*FUNCTION GetName {{{1*/3712 char* Penta::GetName(void){3713 return "penta";3714 }3715 /*}}}*/3716 3711 /*FUNCTION GetNodalFunctions {{{1*/ 3717 3712 void Penta::GetNodalFunctions(double* l1l6, double* gauss_coord){ -
issm/trunk/src/c/objects/Penta.h
r3637 r3673 20 20 #include "./Matice.h" 21 21 #include "./Tria.h" 22 #include "../shared/Exceptions/exceptions.h" 23 #include "../include/macros.h" 22 24 #include "./Hook.h" 23 25 #include "../ModelProcessorx/IoModel.h" … … 54 56 void Echo(); 55 57 int Enum(); 56 int GetId(); 57 char* GetName(); 58 int Id(); 58 59 void Marshall(char** pmarshalled_dataset); 59 60 int MarshallSize(); … … 147 148 void UpdateInputsBalancedthickness2( double* solution,int analysis_type,int sub_analysis_type); 148 149 void UpdateInputsBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type); 150 void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");} 149 151 150 152 /*}}}*/ -
issm/trunk/src/c/objects/Result.cpp
r3612 r3673 234 234 } 235 235 /*}}}1*/ 236 /*FUNCTION Result::GetId {{{1*/ 237 int Result::GetId(void){ return id; } 238 /*}}}1*/ 239 /*FUNCTION Result::GetName {{{1*/ 240 char* Result::GetName(void){ 241 return "result"; 242 } 236 /*FUNCTION Result::Id {{{1*/ 237 int Result::Id(void){ return id; } 243 238 /*}}}1*/ 244 239 /*FUNCTION Result::GetStep {{{1*/ -
issm/trunk/src/c/objects/Result.h
r3637 r3673 36 36 void Echo(); 37 37 void DeepEcho(); 38 int GetId(void);38 int Id(void); 39 39 int MyRank(void); 40 40 void Marshall(char** pmarshalled_dataset); 41 41 int MarshallSize(); 42 char* GetName();43 42 void Demarshall(char** pmarshalled_dataset); 44 43 int Enum(); -
issm/trunk/src/c/objects/Rgb.cpp
r3567 r3673 134 134 } 135 135 /*}}}1*/ 136 /*FUNCTION Rgb::GetId {{{1*/ 137 int Rgb::GetId(void){ return id; } 138 /*}}}1*/ 139 /*FUNCTION Rgb::GetName {{{1*/ 140 char* Rgb::GetName(void){ 141 return "rgb"; 142 } 136 /*FUNCTION Rgb::Id {{{1*/ 137 int Rgb::Id(void){ return id; } 143 138 /*}}}1*/ 144 139 /*FUNCTION Rgb::GetNodeId1{{{1*/ -
issm/trunk/src/c/objects/Rgb.h
r3637 r3673 30 30 void Marshall(char** pmarshalled_dataset); 31 31 int MarshallSize(); 32 char* GetName();33 32 void Demarshall(char** pmarshalled_dataset); 34 33 int Enum(); 35 int GetId();34 int Id(); 36 35 int MyRank(); 37 36 -
issm/trunk/src/c/objects/Riftfront.cpp
r3647 r3673 41 41 } 42 42 /*}}}*/ 43 /*FUNCTION Riftfront::Riftfront(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* riftfront_inputs) {{{1*/43 /*FUNCTION Riftfront::Riftfront(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* riftfront_inputs) {{{1*/ 44 44 Riftfront::Riftfront(int riftfront_id,Hook* riftfront_hnodes, Hook* riftfront_hmatpar, Parameters* riftfront_parameters, Inputs* riftfront_inputs): 45 45 hnodes(riftfront_hnodes), … … 213 213 } 214 214 /*}}}1*/ 215 /*FUNCTION Riftfront::GetId {{{1*/ 216 int Riftfront::GetId(void){ return id; } 217 /*}}}1*/ 218 /*FUNCTION Riftfront::GetName {{{1*/ 219 char* Riftfront::GetName(void){ 220 return "riftfront"; 221 } 215 /*FUNCTION Riftfront::Id {{{1*/ 216 int Riftfront::Id(void){ return id; } 222 217 /*}}}1*/ 223 218 /*FUNCTION Riftfront::Marshall {{{1*/ … … 358 353 this->fraction+=fractionincrement; 359 354 if (this->fraction>1)this->fraction=(double)1.0; 360 //printf("riftfront %i fraction: %g\n",this-> GetId(),this->fraction);355 //printf("riftfront %i fraction: %g\n",this->Id(),this->fraction); 361 356 } 362 357 … … 373 368 this->active=activate; 374 369 375 //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n", GetId());370 //if ((penetration>0) & (this->active==1))printf("Riftfront %i wants to be released\n",Id()); 376 371 377 372 /*assign output pointer: */ … … 504 499 505 500 /*recover id of penalty: */ 506 row_id=this-> GetId()-1; //c indexing, ids were matlab indexed501 row_id=this->Id()-1; //c indexing, ids were matlab indexed 507 502 value=(double)this->fraction; 508 503 … … 552 547 553 548 /*Get some parameters: */ 554 this->parameters->FindParam(&penalty_offset, "penalty_offset");549 this->parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 555 550 this->inputs->GetParameterValue(&friction,FrictionEnum); 556 551 -
issm/trunk/src/c/objects/Riftfront.h
r3637 r3673 57 57 void Echo(); 58 58 int Enum(); 59 int GetId(); 60 char* GetName(); 59 int Id(); 61 60 void Marshall(char** pmarshalled_dataset); 62 61 int MarshallSize(); -
issm/trunk/src/c/objects/Sing.cpp
r3622 r3673 451 451 } 452 452 /*}}}*/ 453 /*FUNCTION Sing:: GetId {{{1*/454 int Sing:: GetId(void){ return id; }453 /*FUNCTION Sing::Id {{{1*/ 454 int Sing::Id(void){ return id; } 455 455 /*}}}*/ 456 456 /*FUNCTION Sing::GetMatPar {{{1*/ … … 464 464 465 465 return matpar; 466 }467 /*}}}*/468 /*FUNCTION Sing::GetName {{{1*/469 char* Sing::GetName(void){470 return "sing";471 466 } 472 467 /*}}}*/ -
issm/trunk/src/c/objects/Sing.h
r3637 r3673 13 13 #include "./Matpar.h" 14 14 #include "../ModelProcessorx/IoModel.h" 15 #include "../include/macros.h" 16 #include "../shared/Exceptions/exceptions.h" 15 17 #include "./Hook.h" 16 18 #include "../DataSet/Inputs.h" … … 48 50 void Echo(); 49 51 int Enum(); 50 int GetId(); 51 char* GetName(); 52 int Id(); 52 53 void Marshall(char** pmarshalled_dataset); 53 54 int MarshallSize(); … … 83 84 double CostFunction(int,int); 84 85 double MassFlux(double* segment,double* ug); 86 void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");} 85 87 /*}}}*/ 86 88 -
issm/trunk/src/c/objects/SolPar.h
r3637 r3673 32 32 void Echo(); 33 33 void DeepEcho(); 34 int GetId();34 int Id(); 35 35 int MyRank(); 36 36 void Marshall(char** pmarshalled_dataset); 37 37 int MarshallSize(); 38 char* GetName();39 38 void Demarshall(char** pmarshalled_dataset); 40 39 int Enum(); -
issm/trunk/src/c/objects/Spc.cpp
r3567 r3673 139 139 } 140 140 /*}}}1*/ 141 /*FUNCTION Spc::GetId {{{1*/ 142 int Spc::GetId(void){ return sid; } 143 /*}}}1*/ 144 /*FUNCTION Spc::GetName {{{1*/ 145 char* Spc::GetName(void){ 146 return "spc"; 147 } 141 /*FUNCTION Spc::Id {{{1*/ 142 int Spc::Id(void){ return sid; } 148 143 /*}}}1*/ 149 144 /*FUNCTION Spc::GetNodeId {{{1*/ -
issm/trunk/src/c/objects/Spc.h
r3637 r3673 30 30 void Marshall(char** pmarshalled_dataset); 31 31 int MarshallSize(); 32 char* GetName();33 32 void Demarshall(char** pmarshalled_dataset); 34 33 int Enum(); 35 int GetId();34 int Id(); 36 35 int MyRank(); 37 36 void DistributeNumDofs(int* numdofspernode,int analysis_type); -
issm/trunk/src/c/objects/Tria.cpp
r3637 r3673 47 47 } 48 48 /*}}}*/ 49 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, DataSet* parameters, Inputs* tria_inputs) {{{1*/49 /*FUNCTION Tria::Tria(int id, Hook* hnodes, Hook* hmatice, Hook* hmatpar, Parameters* parameters, Inputs* tria_inputs) {{{1*/ 50 50 Tria::Tria(int tria_id,Hook* tria_hnodes, Hook* tria_hmatice, Hook* tria_hmatpar, Parameters* tria_parameters, Inputs* tria_inputs): 51 51 hnodes(tria_hnodes), … … 597 597 598 598 /*retrieve some parameters: */ 599 this->parameters->FindParam(&control_type, "control_type");600 this->parameters->FindParam(&cm_noisedmp, "cm_noisedmp");599 this->parameters->FindParam(&control_type,ControlTypeEnum); 600 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 601 601 602 602 /* Get node coordinates and dof list: */ … … 773 773 774 774 /*retrieve some parameters: */ 775 this->parameters->FindParam(&artdiff, "artdiff");775 this->parameters->FindParam(&artdiff,ArtDiffEnum); 776 776 777 777 //Create Artificial diffusivity once for all if requested … … 1045 1045 1046 1046 /*retrieve some parameters: */ 1047 this->parameters->FindParam(&artdiff, "artdiff");1047 this->parameters->FindParam(&artdiff,ArtDiffEnum); 1048 1048 1049 1049 /* Get node coordinates and dof list: */ … … 1221 1221 1222 1222 /*retrieve some parameters: */ 1223 this->parameters->FindParam(&viscosity_overshoot, "viscosity_overshoot");1223 this->parameters->FindParam(&viscosity_overshoot,ViscosityOvershootEnum); 1224 1224 1225 1225 /*First, if we are on water, return empty matrix: */ … … 1763 1763 1764 1764 /*retrieve some parameters: */ 1765 this->parameters->FindParam(&dt, "dt");1766 this->parameters->FindParam(&artdiff, "artdiff");1765 this->parameters->FindParam(&dt,DtEnum); 1766 this->parameters->FindParam(&artdiff,ArtDiffEnum); 1767 1767 1768 1768 /* Get node coordinates and dof list: */ … … 1939 1939 1940 1940 /*retrieve some parameters: */ 1941 this->parameters->FindParam(&dt, "dt");1941 this->parameters->FindParam(&dt,DtEnum); 1942 1942 1943 1943 /* Get node coordinates and dof list: */ … … 2147 2147 2148 2148 /*retrieve some parameters: */ 2149 this->parameters->FindParam(&dt, "dt");2149 this->parameters->FindParam(&dt,DtEnum); 2150 2150 2151 2151 /* Get node coordinates and dof list: */ … … 2788 2788 2789 2789 /*retrieve some parameters: */ 2790 this->parameters->FindParam(&dt, "dt");2790 this->parameters->FindParam(&dt,DtEnum); 2791 2791 2792 2792 /* Get node coordinates and dof list: */ … … 2877 2877 2878 2878 /*retrieve some parameters: */ 2879 this->parameters->FindParam(&dt, "dt");2879 this->parameters->FindParam(&dt,DtEnum); 2880 2880 2881 2881 /* Get node coordinates and dof list: */ … … 3085 3085 3086 3086 /*retrieve some solution parameters: */ 3087 this->parameters->FindParam(&dt, "dt");3087 this->parameters->FindParam(&dt,DtEnum); 3088 3088 3089 3089 /* Ice/ocean heat exchange flux on ice shelf base */ … … 3201 3201 3202 3202 /*retrieve some parameters: */ 3203 this->parameters->FindParam(&dt, "dt");3203 this->parameters->FindParam(&dt,DtEnum); 3204 3204 3205 3205 … … 3351 3351 3352 3352 /*retrieve some parameters: */ 3353 this->parameters->FindParam(&meanvel, "meanvel");3354 this->parameters->FindParam(&epsvel, "epsvel");3353 this->parameters->FindParam(&meanvel,MeanVelEnum); 3354 this->parameters->FindParam(&epsvel,EpsVelEnum); 3355 3355 3356 3356 /* Get node coordinates and dof list: */ … … 3790 3790 } 3791 3791 /*}}}*/ 3792 /*FUNCTION Tria:: GetId {{{1*/3793 int Tria:: GetId(){ return id; }3792 /*FUNCTION Tria::Id {{{1*/ 3793 int Tria::Id(){ return id; } 3794 3794 /*}}}*/ 3795 3795 /*FUNCTION Tria::GetJacobian {{{1*/ … … 3945 3945 } 3946 3946 /*}}}*/ 3947 /*FUNCTION Tria::GetName {{{1*/3948 char* Tria::GetName(void){3949 return "tria";3950 }3951 /*}}}*/3952 3947 /*FUNCTION Tria::GetNodalFunctions {{{1*/ 3953 3948 void Tria::GetNodalFunctions(double* l1l2l3, double* gauss_l1l2l3){ … … 4226 4221 4227 4222 /*retrieve some parameters: */ 4228 this->parameters->FindParam(&cm_noisedmp, "cm_noisedmp");4229 this->parameters->FindParam(&cm_mindmp_value, "cm_mindmp_value");4230 this->parameters->FindParam(&cm_mindmp_slope, "cm_mindmp_slope");4231 this->parameters->FindParam(&cm_maxdmp_value, "cm_maxdmp_value");4232 this->parameters->FindParam(&cm_maxdmp_slope, "cm_maxdmp_slope");4223 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 4224 this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum); 4225 this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum); 4226 this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum); 4227 this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum); 4233 4228 4234 4229 /* Get node coordinates and dof list: */ … … 4394 4389 4395 4390 /*retrieve some parameters: */ 4396 this->parameters->FindParam(&cm_noisedmp,"cm_noisedmp"); 4397 this->parameters->FindParam(&cm_mindmp_value,"cm_mindmp_value"); 4398 this->parameters->FindParam(&cm_mindmp_slope,"cm_mindmp_slope"); 4399 this->parameters->FindParam(&cm_maxdmp_value,"cm_maxdmp_value"); 4400 this->parameters->FindParam(&cm_maxdmp_slope,"cm_maxdmp_slope"); 4391 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 4392 this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum); 4393 this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum); 4394 this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum); 4395 this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum); 4396 4401 4397 4402 4398 /*Get out if shelf*/ … … 4600 4596 4601 4597 /*retrieve some parameters: */ 4602 this->parameters->FindParam(&cm_noisedmp, "cm_noisedmp");4603 this->parameters->FindParam(&cm_mindmp_value, "cm_mindmp_value");4604 this->parameters->FindParam(&cm_mindmp_slope, "cm_mindmp_slope");4605 this->parameters->FindParam(&cm_maxdmp_value, "cm_maxdmp_value");4606 this->parameters->FindParam(&cm_maxdmp_slope, "cm_maxdmp_slope");4598 this->parameters->FindParam(&cm_noisedmp,CmNoiseDmpEnum); 4599 this->parameters->FindParam(&cm_mindmp_value,CmMinDmpValueEnum); 4600 this->parameters->FindParam(&cm_mindmp_slope,CmMinDmpSlopeEnum); 4601 this->parameters->FindParam(&cm_maxdmp_value,CmMaxDmpValueEnum); 4602 this->parameters->FindParam(&cm_maxdmp_slope,CmMaxDmpSlopeEnum); 4607 4603 4608 4604 /*Get out if shelf*/ … … 4906 4902 4907 4903 /*retrieve some parameters: */ 4908 this->parameters->FindParam(&meanvel, "meanvel");4909 this->parameters->FindParam(&epsvel, "epsvel");4904 this->parameters->FindParam(&meanvel,MeanVelEnum); 4905 this->parameters->FindParam(&epsvel,EpsVelEnum); 4910 4906 4911 4907 /* Compute Misfit at the 3 nodes … … 5084 5080 /*inputs: */ 5085 5081 bool onwater; 5082 int fit; 5086 5083 5087 5084 /*retrieve inputs :*/ 5085 inputs->GetParameterValue(&fit,FitEnum); 5088 5086 inputs->GetParameterValue(&onwater,ElementOnWaterEnum); 5087 5088 /*If fit!=3, do not compute surface: */ 5089 if(fit!=3)return 0; 5089 5090 5090 5091 /*recover objects from hooks: */ -
issm/trunk/src/c/objects/Tria.h
r3637 r3673 10 10 #include "./Object.h" 11 11 #include "./Element.h" 12 #include "../include/macros.h" 13 #include "../shared/Exceptions/exceptions.h" 12 14 #include "./Hook.h" 13 15 #include "./Node.h" … … 45 47 void Echo(); 46 48 int Enum(); 47 int GetId(); 48 char* GetName(); 49 int Id(); 49 50 void Marshall(char** pmarshalled_dataset); 50 51 int MarshallSize(); … … 126 127 void UpdateInputsBalancedthickness2( double* solution,int analysis_type,int sub_analysis_type); 127 128 void UpdateInputsBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type); 129 void AddInput(double value, int enum_type){ISSMERROR("not supporte yet!");} 128 130 129 131 /*}}}*/ -
issm/trunk/src/c/objects/Vertex.cpp
r3622 r3673 120 120 } 121 121 /*}}}*/ 122 /*FUNCTION GetId{{{2*/ 123 int Vertex::GetId(void){ return id; } 124 /*}}}*/ 125 /*FUNCTION GetName{{{2*/ 126 char* Vertex::GetName(void){ 127 return "node"; 128 } 122 /*FUNCTION Id{{{2*/ 123 int Vertex::Id(void){ return id; } 129 124 /*}}}*/ 130 125 /*FUNCTION Marshall {{{2*/ -
issm/trunk/src/c/objects/Vertex.h
r3637 r3673 43 43 void Echo(); 44 44 int Enum(); 45 int GetId(void); 46 char* GetName(); 45 int Id(void); 47 46 void Marshall(char** pmarshalled_dataset); 48 47 int MarshallSize(); -
issm/trunk/src/c/objects/objects.h
r3649 r3673 27 27 #include "./Numericalflux.h" 28 28 #include "./Param.h" 29 #include "./DoubleParam.h" 29 30 #include "./Element.h" 30 31 #include "./NodeSets.h" … … 33 34 #include "./TriaVertexInput.h" 34 35 #include "./Vertex.h" 35 #include "./Numpar.h"36 36 #include "./BoolInput.h" 37 37 #include "./IntInput.h" -
issm/trunk/src/c/parallel/convergence.cpp
r3332 r3673 6 6 #include "../issm.h" 7 7 8 void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf, DataSet* parameters){8 void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){ 9 9 10 10 /*output*/ -
issm/trunk/src/c/parallel/diagnostic.cpp
r3595 r3673 32 32 Result* result=NULL; 33 33 34 ParameterInputs* inputs=NULL;35 34 double waitonlock=0; 36 35 int numberofnodes; … … 41 40 Param* param=NULL; 42 41 int count; 43 DataSet* parameters=NULL;42 Parameters* parameters=NULL; 44 43 45 44 /*time*/ -
issm/trunk/src/c/parallel/parallel.h
r3612 r3673 30 30 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, DataSet* loads, FemModel* fem,int analysis_type,int sub_analysis_type); 31 31 void diagnostic_core_linear(Vec* ppg,FemModel* fem,int analysis_type,int sub_analysis_type); 32 void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old, DataSet* parameters);32 void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters); 33 33 34 34 void transient_core(DataSet* results,Model* model); -
issm/trunk/src/c/shared/Elements/ResolvePointers.cpp
r3570 r3673 30 30 /*Check whether existing objects are correct: */ 31 31 if(objects[i]){ 32 if(objects[i]-> GetId()==object_ids[i]) continue; //this node is good.32 if(objects[i]->Id()==object_ids[i]) continue; //this node is good. 33 33 else objects[i]=NULL; //this node was incorrect, reset it. 34 34 } … … 39 39 * we are good: */ 40 40 object=(Object*)dataset->GetObjectByOffset(object_offsets[i]); 41 if (object-> GetId()==object_ids[i]){41 if (object->Id()==object_ids[i]){ 42 42 objects[i]=object; 43 43 continue; … … 50 50 objects[i]=(Object*)dataset->GetObjectById(object_offsets+i,object_ids[i]); //remember the offset for later on. 51 51 /*check the id is correct!: */ 52 if (objects[i]-> GetId()!=object_ids[i])ISSMERROR("%s%i%s%i%s"," wrong id: ",objects[i]->GetId()," vs ",object_ids[i]," in resolved pointer!");52 if (objects[i]->Id()!=object_ids[i])ISSMERROR("%s%i%s%i%s"," wrong id: ",objects[i]->Id()," vs ",object_ids[i]," in resolved pointer!"); 53 53 } 54 54 } -
issm/trunk/src/c/shared/Numerics/OptFunc.cpp
r3332 r3673 20 20 double J; 21 21 22 mxArray* inputs[ 8];22 mxArray* inputs[7]; 23 23 mxArray* psearch_scalar=NULL; 24 24 mxArray* mxJ=NULL; … … 27 27 inputs[0]=psearch_scalar; 28 28 inputs[1]=optargs->models; 29 inputs[2]=optargs->inputs;30 29 inputs[3]=optargs->param_g; 31 30 inputs[4]=optargs->grad_g; -
issm/trunk/src/c/shared/Numerics/numerics.h
r1439 r3673 8 8 #include "./GaussPoints.h" 9 9 #include "./isnan.h" 10 #include "../../objects/objects.h" 10 #include "../../objects/OptArgs.h" 11 #include "../../objects/OptPars.h" 11 12 12 13 double min(double a,double b);
Note:
See TracChangeset
for help on using the changeset viewer.