[issm-svn] r12330 - issm/trunk/src/c
morlighe at issm.ess.uci.edu
morlighe at issm.ess.uci.edu
Fri Jun 1 17:26:03 PDT 2012
Author: morlighe
Date: 2012-06-01 17:26:03 -0700 (Fri, 01 Jun 2012)
New Revision: 12330
Added:
issm/trunk/src/c/Container/Observations.cpp
issm/trunk/src/c/Container/Observations.h
issm/trunk/src/c/issm-binding.h
issm/trunk/src/c/matlab/
issm/trunk/src/c/matlab/include/
issm/trunk/src/c/matlab/include/matlab_macros.h
issm/trunk/src/c/matlab/io/
issm/trunk/src/c/matlab/io/CheckNumMatlabArguments.cpp
issm/trunk/src/c/matlab/io/FetchMatlabData.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToSeqMat.cpp
issm/trunk/src/c/matlab/io/MatlabNArrayToNArray.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToPetscVector.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToSeqVec.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToVector.cpp
issm/trunk/src/c/matlab/io/OptionParse.cpp
issm/trunk/src/c/matlab/io/PrintfFunction.cpp
issm/trunk/src/c/matlab/io/WriteMatlabData.cpp
issm/trunk/src/c/matlab/io/matlabio.h
issm/trunk/src/c/matlab/io/mxGetAssignedField.cpp
issm/trunk/src/c/matlab/matlab-binding.h
issm/trunk/src/c/modules/Krigingx/
issm/trunk/src/c/modules/Krigingx/Krigingx.cpp
issm/trunk/src/c/modules/Krigingx/Krigingx.h
issm/trunk/src/c/objects/Bamg/BamgQuadtree.cpp
issm/trunk/src/c/objects/Bamg/BamgQuadtree.h
issm/trunk/src/c/objects/Kriging/
issm/trunk/src/c/objects/Kriging/ExponentialVariogram.cpp
issm/trunk/src/c/objects/Kriging/ExponentialVariogram.h
issm/trunk/src/c/objects/Kriging/GaussianVariogram.cpp
issm/trunk/src/c/objects/Kriging/GaussianVariogram.h
issm/trunk/src/c/objects/Kriging/Observation.cpp
issm/trunk/src/c/objects/Kriging/Observation.h
issm/trunk/src/c/objects/Kriging/PowerVariogram.cpp
issm/trunk/src/c/objects/Kriging/PowerVariogram.h
issm/trunk/src/c/objects/Kriging/Quadtree.cpp
issm/trunk/src/c/objects/Kriging/Quadtree.h
issm/trunk/src/c/objects/Kriging/SphericalVariogram.cpp
issm/trunk/src/c/objects/Kriging/SphericalVariogram.h
issm/trunk/src/c/objects/Kriging/Variogram.h
issm/trunk/src/c/python/
issm/trunk/src/c/python/include/
issm/trunk/src/c/python/include/python_macros.h
issm/trunk/src/c/python/io/
issm/trunk/src/c/python/io/CheckNumPythonArguments.cpp
issm/trunk/src/c/python/io/FetchPythonData.cpp
issm/trunk/src/c/python/io/WritePythonData.cpp
issm/trunk/src/c/python/io/pythonio.h
issm/trunk/src/c/python/python-binding.h
issm/trunk/src/c/shared/Alloc/alloc_module.cpp
issm/trunk/src/c/shared/Alloc/alloc_module.h
issm/trunk/src/c/shared/Alloc/xNewDelete.h
issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp
issm/trunk/src/c/toolkits/petsc/patches/PetscVectorToDoubleVector.cpp
Removed:
issm/trunk/src/c/io/Matlab/
issm/trunk/src/c/io/Python/
issm/trunk/src/c/matlab/include/
issm/trunk/src/c/matlab/include/matlab_macros.h
issm/trunk/src/c/matlab/io/
issm/trunk/src/c/matlab/io/CheckNumMatlabArguments.cpp
issm/trunk/src/c/matlab/io/FetchMatlabData.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToPetscMatrix.cpp
issm/trunk/src/c/matlab/io/MatlabMatrixToSeqMat.cpp
issm/trunk/src/c/matlab/io/MatlabNArrayToNArray.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToDoubleVector.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToPetscVector.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToSeqVec.cpp
issm/trunk/src/c/matlab/io/MatlabVectorToVector.cpp
issm/trunk/src/c/matlab/io/OptionParse.cpp
issm/trunk/src/c/matlab/io/PrintfFunction.cpp
issm/trunk/src/c/matlab/io/WriteMatlabData.cpp
issm/trunk/src/c/matlab/io/matlabio.h
issm/trunk/src/c/matlab/io/mxGetAssignedField.cpp
issm/trunk/src/c/matlab/matlab-binding.h
issm/trunk/src/c/modules/Dakotax/SpawnCoreSerial.cpp
issm/trunk/src/c/modules/Krigingx/Krigingx.cpp
issm/trunk/src/c/modules/Krigingx/Krigingx.h
issm/trunk/src/c/objects/Bamg/QuadTree.cpp
issm/trunk/src/c/objects/Bamg/QuadTree.h
issm/trunk/src/c/objects/Kriging/ExponentialVariogram.cpp
issm/trunk/src/c/objects/Kriging/ExponentialVariogram.h
issm/trunk/src/c/objects/Kriging/GaussianVariogram.cpp
issm/trunk/src/c/objects/Kriging/GaussianVariogram.h
issm/trunk/src/c/objects/Kriging/Observation.cpp
issm/trunk/src/c/objects/Kriging/Observation.h
issm/trunk/src/c/objects/Kriging/PowerVariogram.cpp
issm/trunk/src/c/objects/Kriging/PowerVariogram.h
issm/trunk/src/c/objects/Kriging/Quadtree.cpp
issm/trunk/src/c/objects/Kriging/Quadtree.h
issm/trunk/src/c/objects/Kriging/SphericalVariogram.cpp
issm/trunk/src/c/objects/Kriging/SphericalVariogram.h
issm/trunk/src/c/objects/Kriging/Variogram.h
issm/trunk/src/c/python/include/
issm/trunk/src/c/python/include/python_macros.h
issm/trunk/src/c/python/io/
issm/trunk/src/c/python/io/CheckNumPythonArguments.cpp
issm/trunk/src/c/python/io/FetchPythonData.cpp
issm/trunk/src/c/python/io/WritePythonData.cpp
issm/trunk/src/c/python/io/pythonio.h
issm/trunk/src/c/python/python-binding.h
issm/trunk/src/c/shared/Numerics/OptFunc.cpp
issm/trunk/src/c/shared/Sorting/Quicksort.c
issm/trunk/src/c/toolkits/double/
issm/trunk/src/c/toolkits/matlab/
issm/trunk/src/c/toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp
issm/trunk/src/c/toolkits/petsc/patches/MatlabVectorToPetscVector.cpp
issm/trunk/src/c/toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp
issm/trunk/src/c/toolkits/petsc/patches/PetscVectorToMatlabVector.cpp
Modified:
issm/trunk/src/c/Container/Constraints.cpp
issm/trunk/src/c/Container/DataSet.cpp
issm/trunk/src/c/Container/DataSet.h
issm/trunk/src/c/Container/Elements.cpp
issm/trunk/src/c/Container/Loads.cpp
issm/trunk/src/c/Container/Nodes.cpp
issm/trunk/src/c/Container/Options.cpp
issm/trunk/src/c/Container/Options.h
issm/trunk/src/c/Container/Parameters.h
issm/trunk/src/c/Container/Results.cpp
issm/trunk/src/c/Container/Results.h
issm/trunk/src/c/Container/Vertices.cpp
issm/trunk/src/c/Container/Vertices.h
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
issm/trunk/src/c/EnumDefinitions/Synchronize.sh
issm/trunk/src/c/Makefile.am
issm/trunk/src/c/include/macros.h
issm/trunk/src/c/include/types.h
issm/trunk/src/c/io/PrintfFunction.cpp
issm/trunk/src/c/io/io.h
issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp
issm/trunk/src/c/modules/ConstraintsStatex/ThermalConstraintsState.cpp
issm/trunk/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp
issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.h
issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.h
issm/trunk/src/c/modules/Dakotax/Dakotax.cpp
issm/trunk/src/c/modules/Dakotax/Dakotax.h
issm/trunk/src/c/modules/Dakotax/SpawnCore.cpp
issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp
issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp
issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp
issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
issm/trunk/src/c/modules/MassFluxx/MassFluxx.cpp
issm/trunk/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp
issm/trunk/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp
issm/trunk/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp
issm/trunk/src/c/modules/MaxVelx/MaxVelx.cpp
issm/trunk/src/c/modules/MaxVxx/MaxVxx.cpp
issm/trunk/src/c/modules/MaxVyx/MaxVyx.cpp
issm/trunk/src/c/modules/MaxVzx/MaxVzx.cpp
issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
issm/trunk/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp
issm/trunk/src/c/modules/MinVelx/MinVelx.cpp
issm/trunk/src/c/modules/MinVxx/MinVxx.cpp
issm/trunk/src/c/modules/MinVyx/MinVyx.cpp
issm/trunk/src/c/modules/MinVzx/MinVzx.cpp
issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
issm/trunk/src/c/modules/NodalValuex/NodalValuex.cpp
issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h
issm/trunk/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.h
issm/trunk/src/c/modules/Solverx/Solverx.cpp
issm/trunk/src/c/modules/Solverx/SolverxPetsc.cpp
issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
issm/trunk/src/c/modules/SurfaceAreax/SurfaceAreax.cpp
issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp
issm/trunk/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp
issm/trunk/src/c/modules/TimeAdaptx/TimeAdaptx.cpp
issm/trunk/src/c/modules/TriMeshx/TriMeshx.cpp
issm/trunk/src/c/modules/TriMeshx/TriMeshx.h
issm/trunk/src/c/modules/modules.h
issm/trunk/src/c/objects/Bamg/BamgGeom.cpp
issm/trunk/src/c/objects/Bamg/BamgGeom.h
issm/trunk/src/c/objects/Bamg/BamgMesh.cpp
issm/trunk/src/c/objects/Bamg/BamgMesh.h
issm/trunk/src/c/objects/Bamg/BamgOpts.cpp
issm/trunk/src/c/objects/Bamg/BamgOpts.h
issm/trunk/src/c/objects/Bamg/Geometry.cpp
issm/trunk/src/c/objects/Bamg/Geometry.h
issm/trunk/src/c/objects/Bamg/Mesh.cpp
issm/trunk/src/c/objects/Bamg/Mesh.h
issm/trunk/src/c/objects/Bamg/Metric.h
issm/trunk/src/c/objects/Constraints/Constraint.h
issm/trunk/src/c/objects/Constraints/SpcDynamic.cpp
issm/trunk/src/c/objects/Constraints/SpcDynamic.h
issm/trunk/src/c/objects/Constraints/SpcStatic.cpp
issm/trunk/src/c/objects/Constraints/SpcStatic.h
issm/trunk/src/c/objects/Constraints/SpcTransient.cpp
issm/trunk/src/c/objects/Constraints/SpcTransient.h
issm/trunk/src/c/objects/Contour.cpp
issm/trunk/src/c/objects/Contour.h
issm/trunk/src/c/objects/DofIndexing.cpp
issm/trunk/src/c/objects/DofIndexing.h
issm/trunk/src/c/objects/ElementResults/BoolElementResult.cpp
issm/trunk/src/c/objects/ElementResults/BoolElementResult.h
issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp
issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h
issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp
issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h
issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp
issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h
issm/trunk/src/c/objects/Elements/Penta.cpp
issm/trunk/src/c/objects/Elements/Penta.h
issm/trunk/src/c/objects/Elements/Tria.cpp
issm/trunk/src/c/objects/Elements/Tria.h
issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h
issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h
issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h
issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h
issm/trunk/src/c/objects/ExternalResults/ExternalResult.h
issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h
issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h
issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h
issm/trunk/src/c/objects/FemModel.cpp
issm/trunk/src/c/objects/Hook.cpp
issm/trunk/src/c/objects/Hook.h
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
issm/trunk/src/c/objects/Inputs/BoolInput.h
issm/trunk/src/c/objects/Inputs/ControlInput.cpp
issm/trunk/src/c/objects/Inputs/ControlInput.h
issm/trunk/src/c/objects/Inputs/DatasetInput.cpp
issm/trunk/src/c/objects/Inputs/DatasetInput.h
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
issm/trunk/src/c/objects/Inputs/DoubleInput.h
issm/trunk/src/c/objects/Inputs/IntInput.cpp
issm/trunk/src/c/objects/Inputs/IntInput.h
issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp
issm/trunk/src/c/objects/Inputs/PentaP1Input.h
issm/trunk/src/c/objects/Inputs/TransientInput.cpp
issm/trunk/src/c/objects/Inputs/TransientInput.h
issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp
issm/trunk/src/c/objects/Inputs/TriaP1Input.h
issm/trunk/src/c/objects/IoModel.cpp
issm/trunk/src/c/objects/IoModel.h
issm/trunk/src/c/objects/Loads/Icefront.cpp
issm/trunk/src/c/objects/Loads/Icefront.h
issm/trunk/src/c/objects/Loads/Numericalflux.cpp
issm/trunk/src/c/objects/Loads/Numericalflux.h
issm/trunk/src/c/objects/Loads/Pengrid.cpp
issm/trunk/src/c/objects/Loads/Pengrid.h
issm/trunk/src/c/objects/Loads/Penpair.cpp
issm/trunk/src/c/objects/Loads/Penpair.h
issm/trunk/src/c/objects/Loads/Riftfront.cpp
issm/trunk/src/c/objects/Loads/Riftfront.h
issm/trunk/src/c/objects/Materials/Matice.cpp
issm/trunk/src/c/objects/Materials/Matice.h
issm/trunk/src/c/objects/Materials/Matpar.cpp
issm/trunk/src/c/objects/Materials/Matpar.h
issm/trunk/src/c/objects/Node.cpp
issm/trunk/src/c/objects/Node.h
issm/trunk/src/c/objects/Numerics/ElementVector.cpp
issm/trunk/src/c/objects/Numerics/ElementVector.h
issm/trunk/src/c/objects/Numerics/Matrix.cpp
issm/trunk/src/c/objects/Numerics/Matrix.h
issm/trunk/src/c/objects/Numerics/Vector.cpp
issm/trunk/src/c/objects/Numerics/Vector.h
issm/trunk/src/c/objects/Object.h
issm/trunk/src/c/objects/OptArgs.h
issm/trunk/src/c/objects/OptPars.h
issm/trunk/src/c/objects/Options/Option.h
issm/trunk/src/c/objects/Options/OptionCell.h
issm/trunk/src/c/objects/Options/OptionChar.h
issm/trunk/src/c/objects/Options/OptionDouble.cpp
issm/trunk/src/c/objects/Options/OptionDouble.h
issm/trunk/src/c/objects/Options/OptionLogical.h
issm/trunk/src/c/objects/Options/OptionStruct.h
issm/trunk/src/c/objects/Params/BoolParam.cpp
issm/trunk/src/c/objects/Params/BoolParam.h
issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp
issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h
issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
issm/trunk/src/c/objects/Params/DoubleMatParam.h
issm/trunk/src/c/objects/Params/DoubleParam.cpp
issm/trunk/src/c/objects/Params/DoubleParam.h
issm/trunk/src/c/objects/Params/DoubleTransientMatParam.h
issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
issm/trunk/src/c/objects/Params/DoubleVecParam.h
issm/trunk/src/c/objects/Params/FileParam.cpp
issm/trunk/src/c/objects/Params/FileParam.h
issm/trunk/src/c/objects/Params/IntMatParam.cpp
issm/trunk/src/c/objects/Params/IntMatParam.h
issm/trunk/src/c/objects/Params/IntParam.cpp
issm/trunk/src/c/objects/Params/IntParam.h
issm/trunk/src/c/objects/Params/IntVecParam.cpp
issm/trunk/src/c/objects/Params/IntVecParam.h
issm/trunk/src/c/objects/Params/MatrixParam.cpp
issm/trunk/src/c/objects/Params/MatrixParam.h
issm/trunk/src/c/objects/Params/Param.h
issm/trunk/src/c/objects/Params/StringArrayParam.cpp
issm/trunk/src/c/objects/Params/StringArrayParam.h
issm/trunk/src/c/objects/Params/StringParam.cpp
issm/trunk/src/c/objects/Params/StringParam.h
issm/trunk/src/c/objects/Params/VectorParam.cpp
issm/trunk/src/c/objects/Params/VectorParam.h
issm/trunk/src/c/objects/Patch.cpp
issm/trunk/src/c/objects/Patch.h
issm/trunk/src/c/objects/Segment.cpp
issm/trunk/src/c/objects/Segment.h
issm/trunk/src/c/objects/Update.h
issm/trunk/src/c/objects/Vertex.cpp
issm/trunk/src/c/objects/Vertex.h
issm/trunk/src/c/objects/objects.h
issm/trunk/src/c/shared/Alloc/alloc.cpp
issm/trunk/src/c/shared/Elements/elements.h
issm/trunk/src/c/shared/Exceptions/Exceptions.cpp
issm/trunk/src/c/shared/Exceptions/exceptions.h
issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp
issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp
issm/trunk/src/c/shared/Exp/exp.h
issm/trunk/src/c/shared/Numerics/OptionsFromAnalysis.cpp
issm/trunk/src/c/shared/Numerics/Synchronize.sh
issm/trunk/src/c/shared/Numerics/Verbosity.cpp
issm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp
issm/trunk/src/c/shared/Sorting/binary_search.cpp
issm/trunk/src/c/shared/Sorting/sorting.h
issm/trunk/src/c/shared/Threads/LaunchThread.cpp
issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp
issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
issm/trunk/src/c/shared/TriMesh/trimesh.h
issm/trunk/src/c/shared/Wrapper/wrappershared.h
issm/trunk/src/c/shared/shared.h
issm/trunk/src/c/solutions/ProcessArguments.cpp
issm/trunk/src/c/solutions/issm.cpp
issm/trunk/src/c/solvers/solver_newton.cpp
issm/trunk/src/c/solvers/solver_nonlinear.cpp
issm/trunk/src/c/toolkits/issm/SeqMat.cpp
issm/trunk/src/c/toolkits/issm/SeqMat.h
issm/trunk/src/c/toolkits/issm/SeqVec.cpp
issm/trunk/src/c/toolkits/issm/SeqVec.h
issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp
issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
issm/trunk/src/c/toolkits/python/pythonincludes.h
issm/trunk/src/c/toolkits/toolkits.h
issm/trunk/src/c/toolkits/triangle/triangleincludes.h
Log:
merged trunk-jpl and trunk for revision 12326M
Modified: issm/trunk/src/c/Container/Constraints.cpp
===================================================================
--- issm/trunk/src/c/Container/Constraints.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Constraints.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -47,12 +47,13 @@
localconstraints=this->Size();
/*figure out total number of constraints combining all the cpus (no clones here)*/
- #ifdef _PARALLEL_
- MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
- MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
+ #ifdef _HAVE_MPI_
+ MPI_Reduce(&localconstraints,&numberofconstraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
+ MPI_Bcast(&numberofconstraints,1,MPI_INT,0,MPI_COMM_WORLD);
#else
- numberofconstraints=localconstraints;
+ numberofconstraints=localconstraints;
#endif
+
return numberofconstraints;
}
Modified: issm/trunk/src/c/Container/DataSet.cpp
===================================================================
--- issm/trunk/src/c/Container/DataSet.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/DataSet.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,6 +10,7 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
+#include <cstring>
#include <vector>
#include <functional>
#include <algorithm>
@@ -83,331 +84,6 @@
}
/*}}}*/
-/*I/O*/
-#ifdef _SERIAL_
-/*FUNCTION DataSet::Marshall{{{1*/
-char* DataSet::Marshall(){
-
- vector<Object*>::iterator object;
- int object_size;
- int marshalled_dataset_size=0;
- char* marshalled_dataset=NULL;
- char* old_marshalled_dataset=NULL;
-
- /*First get size of marshalled dataset: */
- object_size=(int)objects.size();
-
- marshalled_dataset_size=MarshallSize();
-
- /*Allocate marshalled dataset: */
- marshalled_dataset=(char*)xmalloc(marshalled_dataset_size*sizeof(char));
-
- /*Keep track of old_marshalled_dataset: */
- old_marshalled_dataset=marshalled_dataset;
-
- /*Store internals of dataset first: */
- memcpy(marshalled_dataset,&object_size,sizeof(int)); marshalled_dataset+=sizeof(int);
- memcpy(marshalled_dataset,&sorted,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(sorted){
- if(object_size)memcpy(marshalled_dataset,sorted_ids,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
- if(object_size)memcpy(marshalled_dataset,id_offsets,object_size*sizeof(int)); marshalled_dataset+=object_size*sizeof(int);
- }
-
- for ( object=objects.begin() ; object < objects.end(); object++ ){
- (*object)->Marshall(&marshalled_dataset);
- }
-
- /* Ok, marshalled_dataset now points to the end of the original marshalled_dataset pointer
- * before we started the loop on objects. Get object to point right again: */
- marshalled_dataset-=marshalled_dataset_size;
-
- /*We should be back to old_marshalled_dataset: check and abort if that's not the case,
- * because this is a nasty error: */
- if (marshalled_dataset!=old_marshalled_dataset){
- _error_("final marshalled dataset \"%s\" is different from initial one!",EnumToStringx(enum_type));
- abort();
- }
-
- /*Return: */
- return marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DataSet::MarshallSize{{{1*/
-int DataSet::MarshallSize(){
-
- vector<Object*>::iterator object;
- int marshalled_dataset_size=0;
-
-
- for ( object=objects.begin() ; object < objects.end(); object++ ){
- marshalled_dataset_size+= (*object)->MarshallSize();
- }
-
- marshalled_dataset_size+=sizeof(int); //objects size
- marshalled_dataset_size+=sizeof(int); //sorted size
- if(sorted){
- marshalled_dataset_size+=(int)objects.size()*sizeof(int); //sorted ids
- marshalled_dataset_size+=(int)objects.size()*sizeof(int); //id offsets
- }
-
- return marshalled_dataset_size;
-}
-/*}}}*/
-/*FUNCTION DataSet::Demarshall{{{1*/
-DataSet* DataSetDemarshall(char* marshalled_dataset){
-
- return DataSetDemarshallRaw(&marshalled_dataset);
-
-}
-/*}}}*/
-/*FUNCTION DataSet::DemarshallRaw{{{1*/
-DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset){
-
- int i;
-
- DataSet* dataset=NULL;
- int numobjects=0;
- int enum_type;
- Object* object=NULL;
- int sorted;
- int* sorted_ids=NULL;
- int* id_offsets=NULL;
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset pointer: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*initialize dataset: */
- dataset=new DataSet();
-
- /*Get internals first: */
- memcpy(&numobjects,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- memcpy(&sorted,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(sorted){
- if(numobjects){
- sorted_ids=(int*)xmalloc(numobjects*sizeof(int));
- id_offsets=(int*)xmalloc(numobjects*sizeof(int));
- memcpy(sorted_ids,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
- memcpy(id_offsets,marshalled_dataset,numobjects*sizeof(int)); marshalled_dataset+=numobjects*sizeof(int);
- }
- dataset->SetSorting(sorted_ids,id_offsets);
- }
-
- for(i=0;i<numobjects;i++){
-
- /*get enum type of object: */
- memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-
- switch(enum_type){
- case NodeEnum:{
- Node* node=NULL;
- node=new Node();
- node->Demarshall(&marshalled_dataset);
- dataset->AddObject(node);}
- break;
- case VertexEnum:{
- Vertex* vertex=NULL;
- vertex=new Vertex();
- vertex->Demarshall(&marshalled_dataset);
- dataset->AddObject(vertex);}
- break;
- case DoubleParamEnum:{
- DoubleParam* doubleparam=NULL;
- doubleparam=new DoubleParam();
- doubleparam->Demarshall(&marshalled_dataset);
- dataset->AddObject(doubleparam);}
- break;
- case TriaEnum:{
- Tria* tria=NULL;
- tria=new Tria();
- tria->Demarshall(&marshalled_dataset);
- dataset->AddObject(tria);}
- break;
- case TriaP1InputEnum:{
- TriaP1Input* triavertexinput=NULL;
- triavertexinput=new TriaP1Input();
- triavertexinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(triavertexinput);}
- break;
- #ifdef _HAVE_3D_
- case PentaP1InputEnum:{
- PentaP1Input* pentavertexinput=NULL;
- pentavertexinput=new PentaP1Input();
- pentavertexinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(pentavertexinput);}
- break;
- #endif
- case TransientInputEnum:{
- TransientInput* transientinput=NULL;
- transientinput=new TransientInput();
- transientinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(transientinput);}
- break;
- #ifdef _HAVE_CONTROL_
- case ControlInputEnum:{
- ControlInput* controlinputinput=NULL;
- controlinputinput=new ControlInput();
- controlinputinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(controlinputinput);}
- break;
- #endif
- case DatasetInputEnum:{
- DatasetInput* datasetinputinput=NULL;
- datasetinputinput=new DatasetInput();
- datasetinputinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(datasetinputinput);}
- break;
- case TriaP1ElementResultEnum:{
- TriaP1ElementResult* triavertexelementresult=NULL;
- triavertexelementresult=new TriaP1ElementResult();
- triavertexelementresult->Demarshall(&marshalled_dataset);
- dataset->AddObject(triavertexelementresult);}
- break;
- #ifdef _HAVE_3D_
- case PentaP1ElementResultEnum:{
- PentaP1ElementResult* pentavertexelementresult=NULL;
- pentavertexelementresult=new PentaP1ElementResult();
- pentavertexelementresult->Demarshall(&marshalled_dataset);
- dataset->AddObject(pentavertexelementresult);}
- break;
- case PentaEnum:{
- Penta* penta=NULL;
- penta=new Penta();
- penta->Demarshall(&marshalled_dataset);
- dataset->AddObject(penta);}
- break;
- #endif
- case MaticeEnum:{
- Matice* matice=NULL;
- matice=new Matice();
- matice->Demarshall(&marshalled_dataset);
- dataset->AddObject(matice);}
- break;
- case MatparEnum:{
- Matpar* matpar=NULL;
- matpar=new Matpar();
- matpar->Demarshall(&marshalled_dataset);
- dataset->AddObject(matpar);}
- break;
- case SpcStaticEnum:{
- SpcStatic* spcstatic=NULL;
- spcstatic=new SpcStatic();
- spcstatic->Demarshall(&marshalled_dataset);
- dataset->AddObject(spcstatic);}
- break;
- case SpcDynamicEnum:{
- SpcDynamic* spcdynamic=NULL;
- spcdynamic=new SpcDynamic();
- spcdynamic->Demarshall(&marshalled_dataset);
- dataset->AddObject(spcdynamic);}
- break;
- case SpcTransientEnum:{
- SpcTransient* spctransient=NULL;
- spctransient=new SpcTransient();
- spctransient->Demarshall(&marshalled_dataset);
- dataset->AddObject(spctransient);}
- break;
- case PengridEnum:{
- Pengrid* pengrid=NULL;
- pengrid=new Pengrid();
- pengrid->Demarshall(&marshalled_dataset);
- dataset->AddObject(pengrid);}
- break;
- case PenpairEnum:{
- Penpair* penpair=NULL;
- penpair=new Penpair();
- penpair->Demarshall(&marshalled_dataset);
- dataset->AddObject(penpair);}
- break;
- case IcefrontEnum:{
- Icefront* icefront=NULL;
- icefront=new Icefront();
- icefront->Demarshall(&marshalled_dataset);
- dataset->AddObject(icefront);}
- break;
- case NumericalfluxEnum:{
- Numericalflux* numericalflux=NULL;
- numericalflux=new Numericalflux();
- numericalflux->Demarshall(&marshalled_dataset);
- dataset->AddObject(numericalflux);}
- break;
- #ifdef _HAVE_RIFTS_
- case RiftfrontEnum:{
- Riftfront* riftfront=NULL;
- riftfront=new Riftfront();
- riftfront->Demarshall(&marshalled_dataset);
- dataset->AddObject(riftfront);}
- break;
- #endif
- case DoubleInputEnum:{
- DoubleInput* doubleinput=NULL;
- doubleinput=new DoubleInput();
- doubleinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(doubleinput);}
- break;
- case IntInputEnum:{
- IntInput* intinput=NULL;
- intinput=new IntInput();
- intinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(intinput);}
- break;
- case BoolInputEnum:{
- BoolInput* boolinput=NULL;
- boolinput=new BoolInput();
- boolinput->Demarshall(&marshalled_dataset);
- dataset->AddObject(boolinput);}
- break;
- case IntParamEnum:{
- IntParam* intparam=NULL;
- intparam=new IntParam();
- intparam->Demarshall(&marshalled_dataset);
- dataset->AddObject(intparam);}
- break;
- case BoolParamEnum:{
- BoolParam* boolparam=NULL;
- boolparam=new BoolParam();
- boolparam->Demarshall(&marshalled_dataset);
- dataset->AddObject(boolparam);}
- break;
- case StringParamEnum:{
- StringParam* stringparam=NULL;
- stringparam=new StringParam();
- stringparam->Demarshall(&marshalled_dataset);
- dataset->AddObject(stringparam);}
- break;
- case DoubleVecExternalResultEnum:{
- DoubleVecExternalResult* doublevecexternalresult=NULL;
- doublevecexternalresult=new DoubleVecExternalResult();
- doublevecexternalresult->Demarshall(&marshalled_dataset);
- dataset->AddObject(doublevecexternalresult);}
- break;
- case DoubleExternalResultEnum:{
- DoubleExternalResult* doubleexternalresult=NULL;
- doubleexternalresult=new DoubleExternalResult();
- doubleexternalresult->Demarshall(&marshalled_dataset);
- dataset->AddObject(doubleexternalresult);}
- break;
- #ifdef _HAVE_GROUNDINGLINE_
- case BoolElementResultEnum:{
- BoolElementResult* boolelementresult=NULL;
- boolelementresult=new BoolElementResult();
- boolelementresult->Demarshall(&marshalled_dataset);
- dataset->AddObject(boolelementresult);}
- break;
- #endif
- default:
- _error_("could not recognize enum type: %s",EnumToStringx(enum_type));
- }
- }
-
- /*Assign output pointers:*/
- *pmarshalled_dataset=marshalled_dataset;
-
- return dataset;
-}
-/*}}}*/
-#endif
-
/*Specific methods*/
/*FUNCTION DataSet::AddObject{{{1*/
int DataSet::AddObject(Object* object){
Modified: issm/trunk/src/c/Container/DataSet.h
===================================================================
--- issm/trunk/src/c/Container/DataSet.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/DataSet.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -48,10 +48,6 @@
int GetEnum(int offset);
void Echo();
void DeepEcho();
- #ifdef _SERIAL_
- char* Marshall();
- int MarshallSize();
- #endif
int AddObject(Object* object);
int DeleteObject(int id);
int Size();
@@ -68,12 +64,4 @@
};
-/*This routine cannot be object oriented, but need for demarshalling: */
-#ifdef _SERIAL_
-DataSet* DataSetDemarshall(char* marshalled_dataset);
-DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset);
#endif
-
-
-
-#endif
Modified: issm/trunk/src/c/Container/Elements.cpp
===================================================================
--- issm/trunk/src/c/Container/Elements.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Elements.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -123,8 +123,8 @@
if(element_numnodes>numnodes)numnodes=element_numnodes;
}
- #ifdef _PARALLEL_
/*Synchronize across cluster, so as to not end up with different sizes for each patch on each cpu: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&max_numvertices,1,MPI_INT,0,MPI_COMM_WORLD);
numvertices=max_numvertices;
@@ -192,9 +192,13 @@
/*No patch here, we prepare vectors*/
/*Get rank of first cpu that has results*/
+ #ifdef _HAVE_MPI_
if(this->Size()) rank=my_rank;
else rank=num_procs;
MPI_Allreduce (&rank,&minrank,1,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
+ #else
+ minrank=my_rank;
+ #endif
/*see what the first element of this partition has in stock (this is common to all partitions)*/
if(my_rank==minrank){
@@ -202,10 +206,13 @@
Element* element=(Element*)this->GetObjectByOffset(0);
element->ListResultsInfo(&resultsenums,&resultssizes,&resultstimes,&resultssteps,&numberofresults);
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&numberofresults,1,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
+ #endif
/*Get out if there is no results. Otherwise broadcast info*/
if(!numberofresults) return;
+ #ifdef _HAVE_MPI_
if(my_rank!=minrank){
resultsenums=(int*)xmalloc(numberofresults*sizeof(int));
resultssizes=(int*)xmalloc(numberofresults*sizeof(int));
@@ -216,6 +223,7 @@
MPI_Bcast(resultssizes,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
MPI_Bcast(resultstimes,numberofresults,MPI_DOUBLE,minrank,MPI_COMM_WORLD);
MPI_Bcast(resultssteps,numberofresults,MPI_INT,minrank,MPI_COMM_WORLD);
+ #endif
/*Loop over all results and get nodal vector*/
for(int i=0;i<numberofresults;i++){
@@ -249,9 +257,7 @@
patch=this->ResultsToPatch();
/*Gather onto master cpu 0, if needed: */
-#ifdef _PARALLEL_
if(io_gather)patch->Gather();
-#endif
/*create result object and add to results dataset:*/
if (patch->maxvertices && patch->maxnodes){
@@ -275,11 +281,11 @@
int local_nelem=0;
int numberofelements;
- #ifdef _PARALLEL_
local_nelem=this->Size();
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&local_nelem,(void*)&numberofelements,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
#else
- numberofelements=this->Size();
+ numberofelements=local_nelem;
#endif
return numberofelements;
Modified: issm/trunk/src/c/Container/Loads.cpp
===================================================================
--- issm/trunk/src/c/Container/Loads.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Loads.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -62,13 +62,14 @@
localloads=this->Size();
/*figure out total number of loads combining all the cpus (no clones here)*/
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce(&localloads,&numberofloads,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&numberofloads,1,MPI_INT,0,MPI_COMM_WORLD);
#else
numberofloads=localloads;
#endif
+
return numberofloads;
}
/*}}}*/
Modified: issm/trunk/src/c/Container/Nodes.cpp
===================================================================
--- issm/trunk/src/c/Container/Nodes.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Nodes.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -82,10 +82,14 @@
/* Now every object has distributed dofs, but locally, and with a dof count starting from
* 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
* cpus by the total last dofs of the previus cpu, starting from 0.
- * First: bet number of dofs for each cpu*/
+ * First: get number of dofs for each cpu*/
alldofcount=(int*)xmalloc(num_procs*sizeof(int));
+ #ifdef _HAVE_MPI_
MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
MPI_Bcast(alldofcount,num_procs,MPI_INT,0,MPI_COMM_WORLD);
+ #else
+ alldofcount[0]=dofcount;
+ #endif
/* Every cpu should start its own dof count at the end of the dofcount from cpu-1*/
dofcount=0;
@@ -118,8 +122,13 @@
node->ShowTrueDofs(truedofs,maxdofspernode,setenum);//give maxdofspernode, column size, so that nodes can index into truedofs
}
}
- MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+ #ifdef _HAVE_MPI_
+ MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+ #else
+ for(i=0;i<numnodes*maxdofspernode;i++)alltruedofs[i]=truedofs[i];
+ #endif
+
/* Now every cpu knows the true dofs of everyone else that is not a clone*/
for (i=0;i<this->Size();i++){
Node* node=(Node*)this->GetObjectByOffset(i);
@@ -144,7 +153,6 @@
int* minranks=NULL;
int numnodes;
-
/*Figure out number of nodes for this analysis: */
numnodes=this->NumberOfNodes(analysis_type);
@@ -161,7 +169,11 @@
* when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been
* dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
* order of cpu rank. This is also why we initialized this array to num_procs.*/
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)ranks,(void*)minranks,numnodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
+ #else
+ for(i=0;i<numnodes;i++)minranks[i]=ranks[i];
+ #endif
/*Now go through all objects, and use minranks to flag which objects are cloned: */
for(i=0;i<this->Size();i++){
@@ -203,11 +215,11 @@
}
}
-#ifdef _PARALLEL_
/*Grab max of all cpus: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
max=allmax;
-#endif
+ #endif
return max;
}
@@ -238,7 +250,11 @@
}
/*Gather from all cpus: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&numdofs,(void*)&allnumdofs,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+ #else
+ allnumdofs=numdofs;
+ #endif
return allnumdofs;
}
/*}}}*/
@@ -261,7 +277,11 @@
}
/*Gather from all cpus: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&numnodes,(void*)&allnumnodes,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
+ #else
+ allnumnodes=numnodes;
+ #endif
return allnumnodes;
}
@@ -287,11 +307,11 @@
}
}
- #ifdef _PARALLEL_
- MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
- MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
- max_sid=node_max_sid;
- #endif
+ #ifdef _HAVE_MPI_
+ MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
+ MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
+ max_sid=node_max_sid;
+ #endif
if(max_sid==1){
return 0;
Modified: issm/trunk/src/c/Container/Options.cpp
===================================================================
--- issm/trunk/src/c/Container/Options.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Options.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -12,6 +12,7 @@
#include <vector>
#include <algorithm>
+#include <cstring>
#include "./DataSet.h"
#include "../shared/shared.h"
@@ -19,9 +20,7 @@
#include "../include/include.h"
#include "../shared/shared.h"
#include "../EnumDefinitions/EnumDefinitions.h"
-#if _SERIAL_
#include "../io/io.h"
-#endif
/*}}}*/
/*Object constructors and destructor*/
@@ -30,32 +29,6 @@
return;
}
/*}}}*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-/*FUNCTION Options::Options(int istart, int nrhs, const mxArray* prhs[]){{{1*/
-Options::Options(int istart, int nrhs, const mxArray* prhs[]){
-
- int i;
- char *name = NULL;
- Option *option = NULL;
-
- /*loop over each name and value*/
- for (i=istart; i<nrhs; i=i+2){
- if (!mxIsClass(prhs[i],"char")) _error_("Argument %d must be name of option.",i+1);
-
- FetchData(&name,prhs[i]);
- if (i+1 == nrhs) _error_("Argument %d must exist and be value of option \"%s\".",i+2,name);
-
- //_printf_(true," Processing option \"%s\" of class \"%s\".\n",name,mxGetClassName(prhs[i+1]));
- option=(Option*)OptionParse(name,&prhs[i+1]);
- this->AddOption(option);
- option=NULL;
- }
-
- /*echo the dataset */
- //if (this->Size()) for(i=0;i<this->Size();i++) ((Option*)this->GetObjectByOffset(i))->Echo();
-}
-/*}}}*/
-#endif
/*FUNCTION Options::~Options(){{{1*/
Options::~Options(){
return;
@@ -94,6 +67,44 @@
return 1;
}
/*}}}*/
+/*FUNCTION Options::Get(int* pvalue, char* name){{{1*/
+void Options::Get(int* pvalue,const char* name){
+
+ vector<Object*>::iterator object;
+ Option* option=NULL;
+
+ /*Get option*/
+ option=GetOption(name);
+
+ /*If the pointer is not NULL, the option has been found*/
+ if(option){
+ option->Get(pvalue);
+ }
+ /*Else, the Option does not exist, no default provided*/
+ else{
+ _error_("option of name \"%s\" not found, and no default value has been provided",name);
+ }
+}
+/*}}}*/
+/*FUNCTION Options::Get(int* pvalue, char* name,int default_value){{{1*/
+void Options::Get(int* pvalue,const char* name,int default_value){
+
+ vector<Object*>::iterator object;
+ Option* option=NULL;
+
+ /*Get option*/
+ option=GetOption(name);
+
+ /*If the pointer is not NULL, the option has been found*/
+ if(option){
+ option->Get(pvalue);
+ }
+ /*Else, the Option does not exist, a default is provided here*/
+ else{
+ *pvalue=default_value;
+ }
+}
+/*}}}*/
/*FUNCTION Options::Get(double* pvalue, char* name){{{1*/
void Options::Get(double* pvalue,const char* name){
Modified: issm/trunk/src/c/Container/Options.h
===================================================================
--- issm/trunk/src/c/Container/Options.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Options.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,9 +14,6 @@
/*constructors, destructors*/
Options();
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- Options(int istart, int nrhs, const mxArray* prhs[]);
- #endif
~Options();
/*numerics*/
@@ -24,6 +21,8 @@
Option* GetOption(const char* name);
void Get(double* pvalue,const char* name);
void Get(double* pvalue,const char* name,double default_value);
+ void Get(int* pvalue,const char* name);
+ void Get(int* pvalue,const char* name,int default_value);
void Get(bool* pvalue,const char* name);
void Get(bool* pvalue,const char* name,bool default_value);
void Get(char** pvalue,const char* name);
Modified: issm/trunk/src/c/Container/Parameters.h
===================================================================
--- issm/trunk/src/c/Container/Parameters.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Parameters.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -4,6 +4,7 @@
#ifndef _CONTAINER_PARAMETERS_H_
#define _CONTAINER_PARAMETERS_H_
+#include <stdio.h>
/*forward declarations */
class Matrix;
Modified: issm/trunk/src/c/Container/Results.cpp
===================================================================
--- issm/trunk/src/c/Container/Results.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Results.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -64,90 +64,6 @@
}
/*}}}*/
/*FUNCTION Results::Write{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void Results::Write(mxArray** pdataref){
-
- int i,j;
- int count;
-
- /*output: */
- mxArray* dataref=NULL;
- mxArray* processeddataref=NULL;
- mwSize nfields;
- mwSize maxfields;
- mwSize nsteps;
- mwSize step;
- const char **fnames = NULL;
- int *enums = NULL;
- int baseenum;
- mwSize onebyone[2] = {1,1};
- mwSize ndim = 2;
-
- /*How many time steps do we have? : */
- nsteps=0;
- for(i=0;i<this->Size();i++){
- ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
- step=result->GetStep();
- if(step>nsteps)nsteps=step;
- }
- onebyone[0]=nsteps;
-
- /*How many field names do we have. First, figure out how many result types we have: */
- maxfields=(mwSize)this->Size();
- enums=(int*)xmalloc(maxfields*sizeof(int));
- for(i=0;i<maxfields;i++){
- ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
- enums[i]=result->InstanceEnum();
- }
- /*Now, make result types unique: */
- for(i=0;i<maxfields;i++){
- if(enums[i]>=0){//if <0, it means this enum was found to replicate another one previously
- baseenum=enums[i];
- /*is the baseenum repeated later on?:*/
- for(j=i+1;j<maxfields;j++){
- if (enums[j]==baseenum)enums[j]=-1;
- }
- }
- else continue;
- }
-
- /*Now, go through enums, and whatever is not null is a non repeated field name: */
- nfields=0;
- for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++;
-
- /*Add 2 fields for time and step: */
- nfields=nfields+2;
-
- /*Fill the names of the structure field: */
- fnames=(const char**)xmalloc(nfields*sizeof(char*));
- count=0;
- for(i=0;i<maxfields;i++){
- if (enums[i]>0){
- fnames[count]=EnumToStringx(enums[i]);
- count++;
- }
- }
- /*don't forget the extra fields "time" and "step":*/
- fnames[nfields-2]="time";
- fnames[nfields-1]="step";
-
- /*Initialize structure: */
- dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
-
- /*Fill each field: */
- for(i=0;i<this->Size();i++){ //do not include the last one used for time
- ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
- result->SetMatlabField(dataref);
- }
-
- /*Now, process the patch in the dataref structure, by calling MatlabProcessPatch.m
- *on the current dataref structure: */
- mexCallMATLAB(1,&processeddataref,1,&dataref, "MatlabProcessPatch");
-
- /*Assign output pointers:*/
- *pdataref=processeddataref;
-}
-#else
void Results::Write(Parameters* parameters){
int i;
@@ -166,5 +82,4 @@
}
}
-#endif
/*}}}*/
Modified: issm/trunk/src/c/Container/Results.h
===================================================================
--- issm/trunk/src/c/Container/Results.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Results.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -25,11 +25,7 @@
/*}}}*/
/*numerics: {{{1*/
Results* SpawnTriaResults(int* indices);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void Write(mxArray** pdataref);
- #else
void Write(Parameters* parameters);
- #endif
/*}}}*/
};
#endif //ifndef _RESULTS_H_
Modified: issm/trunk/src/c/Container/Vertices.cpp
===================================================================
--- issm/trunk/src/c/Container/Vertices.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Vertices.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -60,8 +60,12 @@
* cpus by the total last dofs of the previus cpu, starting from 0.
* First: bet number of dofs for each cpu*/
alldofcount=(int*)xmalloc(num_procs*sizeof(int));
+ #ifdef _HAVE_MPI_
MPI_Gather(&dofcount,1,MPI_INT,alldofcount,1,MPI_INT,0,MPI_COMM_WORLD);
MPI_Bcast(alldofcount,num_procs,MPI_INT,0,MPI_COMM_WORLD);
+ #else
+ alldofcount[0]=dofcount;
+ #endif
/* Every cpu should start its own dof count at the end of the dofcount from cpu-1*/
dofcount=0;
@@ -84,7 +88,11 @@
Vertex* vertex=(Vertex*)this->GetObjectByOffset(i);
vertex->ShowTrueDofs(truedofs);
}
+ #ifdef _HAVE_MPI_
MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numberofobjects*numberofdofsperobject,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+ #else
+ for(i=0;i<numberofobjects*numberofdofsperobject;i++)alltruedofs[i]=truedofs[i];
+ #endif
/* Now every cpu knows the true dofs of everyone else that is not a clone*/
for (i=0;i<this->Size();i++){
@@ -120,7 +128,11 @@
* when we start building the dof list for all vertexs, a cpu can check whether its vertex already has been
* dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
* order of cpu rank. This is also why we initialized this array to num_procs.*/
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
+ #else
+ for(i=0;i<numberofobjects;i++)minranks[i]=ranks[i];
+ #endif
/*Now go through all objects, and use minranks to flag which objects are cloned: */
for(i=0;i<this->Size();i++){
@@ -148,7 +160,7 @@
if (sid>max_sid)max_sid=sid;
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&max_sid,&vertex_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&vertex_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
max_sid=vertex_max_sid;
Modified: issm/trunk/src/c/Container/Vertices.h
===================================================================
--- issm/trunk/src/c/Container/Vertices.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Container/Vertices.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,7 +31,4 @@
};
-
-
#endif //ifndef _VERTICES_H_
-
Modified: issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -152,6 +152,7 @@
PetscProfilingCurrentMemEnum,
PetscProfilingCurrentFlopsEnum,
PetscProfilingSolutionTimeEnum,
+ MaxIterationConvergenceFlagEnum,
SteadystateMaxiterEnum,
SteadystateNumRequestedOutputsEnum,
SteadystateReltolEnum,
Modified: issm/trunk/src/c/EnumDefinitions/Synchronize.sh
===================================================================
--- issm/trunk/src/c/EnumDefinitions/Synchronize.sh 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/EnumDefinitions/Synchronize.sh 2012-06-02 00:26:03 UTC (rev 12330)
@@ -1,20 +1,20 @@
#!/bin/bash
#Synchronize EnumToStringx.cpp and StringToEnumx.cpp and matlab Enums
-#Get all lines of EnumDefinitions2.h which hold Enum | remove all comas | add line number in the first column > put everything in file temp
-cat EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-zA-Z]Enum," | grep -v include | sed -e "s/,//g" | awk '{ printf "%s %s\n", NR, $0 }' > temp
+#Get all lines of EnumDefinitions2.h which hold Enum | remove all comas > put everything in file temp
+cat EnumDefinitions.h | grep -e "[0-9]Enum," -e "[a-zA-Z]Enum," | grep -v include | sed -e "s/,/ /g" | awk '{print $1}' > temp
#Removed existing files
-rm $ISSM_TIER/src/m/enum/*.m
-rm $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
-rm $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
+rm $ISSM_DIR/src/m/enum/*.m
+rm $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
+rm $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
#Get number of enums
NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}');
-#Build EnumToStringx.cpp {{{1
+#Build EnumToStringx.cpp {{{
#Header
-cat <<END > $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
+cat <<END > $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
/*
* \file EnumToStringx.cpp:
* \brief: output string associated with enum
@@ -34,9 +34,9 @@
END
#core
-cat temp | awk '{print "\t\t" "case " $2" : return \"" substr($2,1,length($2)-4) "\";"}' >> $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
+cat temp | awk '{print "\t\t" "case " $1" : return \"" substr($1,1,length($1)-4) "\";"}' >> $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
#Footer
-cat <<END >> $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
+cat <<END >> $ISSM_DIR/src/c/modules/EnumToStringx/EnumToStringx.cpp
default : return "unknown";
}
@@ -56,7 +56,7 @@
#}}}
#Build StringToEnumx.cpp {{{1
#Header
-cat <<END > $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
+cat <<END > $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
/*
* \file StringToEnumx.cpp:
* \brief: output enum associated with string
@@ -80,11 +80,11 @@
i1=1;
i2=120;
for (( i=1 ; i<=100 ; i++ )); do
- echo " if(stage==$i){" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+ echo " if(stage==$i){" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
awk -v i1=$i1 -v i2=$i2 '{if(NR>=i1 && NR<=i2) print $0 }' temp |
- awk '{print "\t" ((NR==1)?" if":" else if") " (strcmp(name,\"" substr($2,1,length($2)-4) "\")==0) return " $2 ";"}' >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
- echo " else stage=$(($i+1));" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
- echo " }" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+ awk '{print "\t" ((NR==1)?" if":" else if") " (strcmp(name,\"" substr($1,1,length($1)-4) "\")==0) return " $1 ";"}' >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
+ echo " else stage=$(($i+1));" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
+ echo " }" >> $ISSM_DIR//src/c/modules/StringToEnumx/StringToEnumx.cpp
if [ $i2 -ge $NUMENUMS ]; then break; fi
let i1=$i1+120
@@ -92,7 +92,7 @@
done
#footer
-cat <<END >> $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
+cat <<END >> $ISSM_DIR/src/c/modules/StringToEnumx/StringToEnumx.cpp
/*If we reach this point, the string provided has not been found*/
_error_("Enum %s not found",name);
}
@@ -100,33 +100,32 @@
#}}}
# go through the lines of temp
-for (( i=1 ; i<=$NUMENUMS ; i++ )); do
+ENUM=0;
+for NAMEENUM in $(cat temp); do
#Get name and enum of the line i
- NAMEENUM=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$2);}');
NAME=$(echo $NAMEENUM | sed -e "s/Enum//g")
- ENUM=$i;
#offset Enum by one (Enum begins with 0 and not 1!)
- let ENUM=$ENUM-1
+ let ENUM=$ENUM+1
#print info {{{
- if [ $i -lt 10 ]
+ if [ $ENUM -lt 10 ]
then
printf "\r "
- printf "\r $i/$NUMENUMS Adding "$NAME"..."
+ printf "\r $ENUM/$NUMENUMS Adding "$NAME"..."
else
- if [ $i -lt 100 ]
+ if [ $ENUM -lt 100 ]
then
printf "\r "
- printf "\r $i/$NUMENUMS Adding "$NAME"..."
+ printf "\r $ENUM/$NUMENUMS Adding "$NAME"..."
else
printf "\r "
- printf "\r$i/$NUMENUMS Adding "$NAME"..."
+ printf "\r$ENUM/$NUMENUMS Adding "$NAME"..."
fi
fi
#}}}
#Add case to matlabenum file{{{
- cat <<END > $ISSM_TIER"/src/m/enum/"$(echo $NAMEENUM".m")
+ cat <<END > $ISSM_DIR"/src/m/enum/"$(echo $NAMEENUM".m")
function macro=$(echo $NAMEENUM)()
%$(echo $NAMEENUM | awk {'print toupper($1)'}) - Enum of $(echo $NAME)
%
@@ -142,7 +141,24 @@
#}}}
done
+#MaximumNumberOfEnums{{{
+cat <<END > $ISSM_DIR/src/m/enum/MaximumNumberOfEnums.m
+function macro=MaximumNumberOfEnums()
+%$(echo "MaximumNumberOfEnums" | awk {'print toupper($1)'}) - Enum of MaximumNumberOfEnums
+%
+% WARNING: DO NOT MODIFY THIS FILE
+% this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+% Please read src/c/EnumDefinitions/README for more information
+%
+% Usage:
+% macro=MaximumNumberOfEnums()
+macro=$(cat EnumDefinitions.h | grep -e "[0-9]Enum" -e "[a-zA-Z]Enum" | grep -v include \
+ | awk '{ printf "%s %s\n", NR-1, $0 }' \
+ | grep "MaximumNumberOfEnums" | awk '{print $1}');
+END
+#}}}
+
#clean up{{{
rm temp
#}}}
Modified: issm/trunk/src/c/Makefile.am
===================================================================
--- issm/trunk/src/c/Makefile.am 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/Makefile.am 2012-06-02 00:26:03 UTC (rev 12330)
@@ -3,25 +3,23 @@
EXEEXT=$(ISSMEXT)
#Library declaration {{{1
-#Compile serial library, and then try and compile parallel library
-if NOSERIAL
-if NOPARALLEL
-lib_LIBRARIES =
-else
-lib_LIBRARIES = libpISSM.a libOverload.a
+lib_LIBRARIES = libISSMCore.a libISSMOverload.a
+if PYTHON
+lib_LIBRARIES += libISSMPython.a
endif
-else
-if NOPARALLEL
-lib_LIBRARIES = libISSM.a libOverload.a
-else
-lib_LIBRARIES = libISSM.a libpISSM.a libOverload.a
+if MATLAB
+lib_LIBRARIES += libISSMMatlab.a
endif
+if MODULES
+lib_LIBRARIES += libISSMModules.a
endif
#}}}
#sources
#Core sources{{{1
-core_sources = ./include/macros.h\
+core_sources = ./issm.h\
+ ./issm-binding.h\
+ ./include/macros.h\
./include/typedefs.h\
./include/types.h\
./include/include.h\
@@ -210,20 +208,12 @@
./shared/Wrapper/wrappershared.h\
./shared/Wrapper/ModuleBoot.cpp\
./shared/Wrapper/ModuleEnd.cpp\
- ./toolkits/mpi/mpiincludes.h\
- ./toolkits/mpi/patches/mpipatches.h\
- ./toolkits/mpi/patches/DetermineLocalSize.cpp\
- ./toolkits/mpi/patches/MPI_Upperrow.cpp\
- ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
- ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
./toolkits/metis/metisincludes.h\
./toolkits/issm/issmtoolkit.h\
./toolkits/issm/SeqVec.h\
./toolkits/issm/SeqVec.cpp\
./toolkits/issm/SeqMat.h\
./toolkits/issm/SeqMat.cpp\
- ./toolkits/metis/patches/metispatches.h\
- ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp\
./toolkits/triangle/triangleincludes.h\
./toolkitsenums.h\
./toolkits.h\
@@ -361,23 +351,23 @@
./modules/Dakotax/DescriptorIndex.cpp\
./modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp\
./modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp\
- ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h
-dakota_psources= ./modules/Dakotax/SpawnCoreParallel.cpp
+ ./modules/AverageOntoPartitionx/AverageOntoPartitionx.h\
+ ./modules/Dakotax/SpawnCoreParallel.cpp
#}}}
#Transient sources {{{1
-transient_sources = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
-transient_psources = ./solutions/transient_core.cpp
+transient_sources = ./modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp \
+ ./solutions/transient_core.cpp
#}}}
#Steadystate sources {{{1
-steadystate_psources = ./solutions/steadystate_core.cpp\
- ./solutions/steadystateconvergence.cpp
+steadystate_sources = ./solutions/steadystate_core.cpp\
+ ./solutions/steadystateconvergence.cpp
#}}}
#Prognostic sources {{{1
prognostic_sources = ./modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp\
./modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp\
./modules/ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp\
- ./modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp
-prognostic_psources = ./solutions/prognostic_core.cpp
+ ./modules/ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp\
+ ./solutions/prognostic_core.cpp
#}}}
#Thermal sources {{{1
thermal_sources = ./modules/ModelProcessorx/Thermal/UpdateElementsThermal.cpp\
@@ -394,11 +384,10 @@
./modules/ModelProcessorx/Melting/CreateLoadsMelting.cpp\
./modules/ConstraintsStatex/ThermalConstraintsState.cpp\
./modules/ConstraintsStatex/ThermalIsPresent.cpp\
- ./modules/ResetConstraintsx/ThermalConstraintsReset.cpp
-
-thermal_psources = ./solutions/thermal_core.cpp\
- ./solutions/enthalpy_core.cpp\
- ./solvers/solver_thermal_nonlinear.cpp
+ ./modules/ResetConstraintsx/ThermalConstraintsReset.cpp \
+ ./solutions/thermal_core.cpp\
+ ./solutions/enthalpy_core.cpp\
+ ./solvers/solver_thermal_nonlinear.cpp
#}}}
#Control sources {{{1
control_sources= ./modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp\
@@ -442,10 +431,8 @@
./objects/Inputs/ControlInput.h\
./objects/Inputs/ControlInput.cpp\
./shared/Numerics/BrentSearch.cpp\
- ./shared/Numerics/OptimalSearch.cpp\
- ./shared/Numerics/OptFunc.cpp
-
-control_psources=./solutions/control_core.cpp\
+ ./shared/Numerics/OptimalSearch.cpp \
+ ./solutions/control_core.cpp\
./solutions/controltao_core.cpp\
./solutions/controlrestart.cpp\
./solutions/controlconvergence.cpp\
@@ -461,10 +448,9 @@
hydrology_sources = ./modules/ModelProcessorx/Hydrology/UpdateElementsHydrology.cpp\
./modules/ModelProcessorx/Hydrology/CreateNodesHydrology.cpp\
./modules/ModelProcessorx/Hydrology/CreateConstraintsHydrology.cpp\
- ./modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp
-
-hydrology_psources = ./solutions/hydrology_core.cpp\
- ./solutions/hydrology_core_step.cpp
+ ./modules/ModelProcessorx/Hydrology/CreateLoadsHydrology.cpp \
+ ./solutions/hydrology_core.cpp\
+ ./solutions/hydrology_core_step.cpp
#}}}
#Diagnostic sources {{{1
diagnostic_sources = ./modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp\
@@ -479,20 +465,20 @@
./modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp \
./modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \
./modules/ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp \
- ./shared/Elements/CoordinateSystemTransform.cpp\
- ./shared/Elements/TransformLoadVectorCoord.cpp \
- ./shared/Elements/TransformStiffnessMatrixCoord.cpp \
- ./shared/Elements/TransformInvStiffnessMatrixCoord.cpp \
- ./shared/Elements/TransformSolutionCoord.cpp
-diagnostic_psources =./solutions/diagnostic_core.cpp\
- ./solvers/solver_stokescoupling_nonlinear.cpp
+ ./shared/Elements/CoordinateSystemTransform.cpp\
+ ./shared/Elements/TransformLoadVectorCoord.cpp \
+ ./shared/Elements/TransformStiffnessMatrixCoord.cpp \
+ ./shared/Elements/TransformInvStiffnessMatrixCoord.cpp \
+ ./shared/Elements/TransformSolutionCoord.cpp\
+ ./solutions/diagnostic_core.cpp\
+ ./solvers/solver_stokescoupling_nonlinear.cpp
#}}}
#Balanced sources {{{1
balanced_sources = ./modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp\
./modules/ModelProcessorx/Balancethickness/CreateNodesBalancethickness.cpp\
./modules/ModelProcessorx/Balancethickness/CreateConstraintsBalancethickness.cpp\
- ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp
-balanced_psources = ./solutions/balancethickness_core.cpp
+ ./modules/ModelProcessorx/Balancethickness/CreateLoadsBalancethickness.cpp\
+ ./solutions/balancethickness_core.cpp
#}}}
#Responses sources {{{1
responses_sources = ./modules/MinVelx/MinVelx.h\
@@ -532,8 +518,8 @@
./modules/ModelProcessorx/SurfaceSlope/UpdateElementsSurfaceSlope.cpp\
./modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp \
./modules/ModelProcessorx/SurfaceSlope/CreateConstraintsSurfaceSlope.cpp\
- ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp
-slope_psources = ./solutions/surfaceslope_core.cpp\
+ ./modules/ModelProcessorx/SurfaceSlope/CreateLoadsSurfaceSlope.cpp\
+ ./solutions/surfaceslope_core.cpp\
./solutions/bedslope_core.cpp
#}}}
#Groundingline sources {{{1
@@ -588,8 +574,8 @@
./objects/Bamg/EigenMetric.cpp\
./objects/Bamg/Metric.cpp\
./objects/Bamg/Metric.h\
- ./objects/Bamg/QuadTree.cpp\
- ./objects/Bamg/QuadTree.h\
+ ./objects/Bamg/BamgQuadtree.cpp\
+ ./objects/Bamg/BamgQuadtree.h\
./objects/Bamg/R2.h\
./objects/Bamg/SetOfE4.cpp\
./objects/Bamg/SetOfE4.h\
@@ -625,6 +611,26 @@
./modules/BamgTriangulatex/BamgTriangulatex.cpp\
./modules/BamgTriangulatex/BamgTriangulatex.h
#}}}
+#Kriging sources {{{1
+kriging_sources = ./Container/Observations.h\
+ ./Container/Observations.cpp\
+ ./objects/Kriging/Variogram.h \
+ ./objects/Kriging/GaussianVariogram.h\
+ ./objects/Kriging/GaussianVariogram.cpp\
+ ./objects/Kriging/ExponentialVariogram.h\
+ ./objects/Kriging/ExponentialVariogram.cpp\
+ ./objects/Kriging/SphericalVariogram.h\
+ ./objects/Kriging/SphericalVariogram.cpp\
+ ./objects/Kriging/PowerVariogram.h\
+ ./objects/Kriging/PowerVariogram.cpp\
+ ./objects/Kriging/Quadtree.h\
+ ./objects/Kriging/Quadtree.cpp\
+ ./objects/Kriging/Observation.h\
+ ./objects/Kriging/Observation.cpp\
+ ./modules/Krigingx/Krigingx.cpp\
+ ./modules/Krigingx/Krigingx.h
+
+#}}}
#Kml sources {{{1
kml_sources = ./modules/Exp2Kmlx/Exp2Kmlx.h\
./modules/Exp2Kmlx/Exp2Kmlx.cpp\
@@ -693,34 +699,11 @@
./objects/KML/KMLFileReadUtils.cpp\
./objects/KML/KMLFileReadUtils.h
#}}}
-#Matlab sources {{{1
-matlab_sources= ./toolkits/matlab/matlabincludes.h\
- ./toolkits/matlab/MatlabNArrayToNArray.cpp\
- ./toolkits/double/MatlabVectorToDoubleVector.cpp\
- ./toolkits/double/double.h\
- ./toolkits/double/MatlabMatrixToDoubleMatrix.cpp\
- ./io/Matlab/matlabio.h\
- ./io/Matlab/CheckNumMatlabArguments.cpp\
- ./io/Matlab/mxGetAssignedField.cpp\
- ./io/Matlab/WriteMatlabData.cpp\
- ./io/Matlab/FetchMatlabData.cpp\
- ./io/Matlab/OptionParse.cpp
-#}}}
-#Python sources {{{1
-python_sources= ./io/Python/pythonio.h\
- ./io/Python/WritePythonData.cpp\
- ./io/Python/CheckNumPythonArguments.cpp\
- ./io/Python/FetchPythonData.cpp
-#}}}
#Petsc sources {{{1
petsc_sources= ./toolkits/petsc\
./toolkits/petsc/patches\
./toolkits/petsc/patches/SolverEnum.h\
./toolkits/petsc/patches/petscpatches.h\
- ./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
- ./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
- ./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
- ./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
./toolkits/petsc/patches/VecTranspose.cpp\
./toolkits/petsc/patches/VecToMPISerial.cpp\
./toolkits/petsc/patches/MatToSerial.cpp\
@@ -731,6 +714,8 @@
./toolkits/petsc/patches/NewMat.cpp\
./toolkits/petsc/patches/SerialToVec.cpp\
./toolkits/petsc/patches/VecFree.cpp\
+ ./toolkits/petsc/patches/PetscMatrixToDoubleMatrix.cpp\
+ ./toolkits/petsc/patches/PetscVectorToDoubleVector.cpp\
./toolkits/petsc/patches/VecDuplicatePatch.cpp\
./toolkits/petsc/patches/KSPFree.cpp\
./toolkits/petsc/patches/ISFree.cpp\
@@ -753,8 +738,50 @@
gsl_sources= ./modules/Solverx/SolverxGsl.cpp
#}}}
-#Serialsources {{{1
-serial_sources= ./objects/Options/Option.cpp\
+#Mpi sources {{{1
+mpi_sources= ./toolkits/mpi/mpiincludes.h\
+ ./toolkits/mpi/patches/mpipatches.h\
+ ./toolkits/mpi/patches/DetermineLocalSize.cpp\
+ ./toolkits/mpi/patches/MPI_Upperrow.cpp\
+ ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
+ ./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp
+#}}}
+#Metis sources {{{1
+metis_sources= ./toolkits/metis/patches/metispatches.h\
+ ./toolkits/metis/patches/METIS_PartMeshNodalPatch.cpp
+#}}}
+#Python sources {{{1
+python_sources= ./python/io/pythonio.h\
+ ./python/python-binding.h\
+ ./python/io/WritePythonData.cpp\
+ ./python/io/CheckNumPythonArguments.cpp\
+ ./python/io/FetchPythonData.cpp
+
+#}}}
+#Matlab sources {{{1
+matlab_sources= ./toolkits/matlab/matlabincludes.h\
+ ./matlab/matlab-binding.h\
+ ./matlab/io/matlabio.h\
+ ./matlab/io/MatlabNArrayToNArray.cpp\
+ ./matlab/io/CheckNumMatlabArguments.cpp\
+ ./matlab/io/mxGetAssignedField.cpp\
+ ./matlab/io/WriteMatlabData.cpp\
+ ./matlab/io/FetchMatlabData.cpp\
+ ./matlab/io/OptionParse.cpp\
+ ./matlab/io/MatlabMatrixToMatrix.cpp\
+ ./matlab/io/MatlabVectorToVector.cpp\
+ ./matlab/io/MatlabVectorToDoubleVector.cpp\
+ ./matlab/io/MatlabMatrixToDoubleMatrix.cpp\
+ ./matlab/io/MatlabMatrixToSeqMat.cpp\
+ ./matlab/io/MatlabVectorToSeqVec.cpp
+#}}}
+#Matlab and Petsc sources {{{1
+matlabpetsc_sources= ./matlab/io/MatlabMatrixToPetscMatrix.cpp\
+ ./matlab/io/MatlabVectorToPetscVector.cpp
+
+#}}}
+#Modules sources{{{1
+module_sources= ./objects/Options/Option.cpp\
./objects/Options/Option.h\
./objects/Options/OptionDouble.cpp\
./objects/Options/OptionDouble.h\
@@ -768,6 +795,8 @@
./objects/Options/OptionCell.h\
./objects/Options/OptionUtilities.cpp\
./objects/Options/OptionUtilities.h\
+ ./shared/Alloc/alloc_module.h\
+ ./shared/Alloc/alloc_module.cpp\
./shared/Threads/issm_threads.h\
./shared/Threads/LaunchThread.cpp\
./shared/Threads/PartitionRange.cpp\
@@ -789,7 +818,6 @@
./modules/Chacox/input_parse.cpp\
./modules/Chacox/chaco_seconds.cpp\
./modules/Chacox/user_params.cpp\
- ./modules/Dakotax/SpawnCoreSerial.cpp\
./modules/TriaSearchx/TriaSearchx.h\
./modules/TriaSearchx/TriaSearchx.cpp\
./modules/TriMeshx/TriMeshx.h\
@@ -840,69 +868,57 @@
./modules/PropagateFlagsFromConnectivityx/PropagateFlagsFromConnectivityx.h
#}}}
+#{{{1 Conditional build-up of sources
#ISSM sources are a combination of core sources and sources related to specific capabilities (which can
#be activated by autotools conditionals
-#{{{1
+
#First the core
issm_sources = $(core_sources)
-issm_psources =
#Now the optional source
if DAKOTA
issm_sources += $(dakota_sources)
-issm_psources += $(dakota_psources)
endif
if PETSC
issm_sources += $(petsc_sources)
-issm_psources += $(petsc_psources)
endif
if GSL
issm_sources += $(gsl_sources)
-issm_psources += $(gsl_psources)
endif
-
if TRANSIENT
issm_sources += $(transient_sources)
-issm_psources += $(transient_psources)
endif
if STEADYSTATE
issm_sources += $(steadystate_sources)
-issm_psources += $(steadystate_psources)
endif
if PROGNOSTIC
issm_sources += $(prognostic_sources)
-issm_psources += $(prognostic_psources)
endif
if THERMAL
issm_sources += $(thermal_sources)
-issm_psources += $(thermal_psources)
endif
if CONTROL
issm_sources += $(control_sources)
-issm_psources += $(control_psources)
endif
if HYDROLOGY
issm_sources += $(hydrology_sources)
-issm_psources += $(hydrology_psources)
endif
if DIAGNOSTIC
issm_sources += $(diagnostic_sources)
-issm_psources += $(diagnostic_psources)
endif
if BALANCED
issm_sources += $(balanced_sources)
-issm_psources += $(balanced_psources)
endif
if RESPONSES
@@ -911,7 +927,6 @@
if SLOPE
issm_sources += $(slope_sources)
-issm_psources += $(slope_psources)
endif
if GROUNDINGLINE
@@ -925,72 +940,84 @@
if THREED
issm_sources += $(threed_sources)
endif
+
+if MPI
+issm_sources += $(mpi_sources)
+endif
+
+if METIS
+issm_sources += $(metis_sources)
+endif
+
+if PETSC
+if MATLAB
+issm_sources += $(matlabpetsc_sources)
+endif
+endif
+
+
#}}}
+#Library flags and sources {{{1
+ALLCXXFLAGS= -fPIC -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_ $(CXXFLAGS) $(CXXOPTFLAGS)
-#ISSM serial library {{{1
-if SERIAL
-libISSM_a_SOURCES = $(issm_sources)
-libISSM_a_SOURCES += $(serial_sources)
-libISSM_a_SOURCES += $(bamg_sources)
-libISSM_a_SOURCES += $(kml_sources)
-libISSM_a_CXXFLAGS = -fPIC -D_SERIAL_ -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_ $(CXXFLAGS) $(CXXOPTFLAGS)
-#libISSM_a_CXXFLAGS = -D_SERIAL_ -DTRILIBRARY -DANSI_DECLARATORS -DNO_TIMER $(CXXFLAGS) $(CXXOPTFLAGS)
+libISSMCore_a_SOURCES = $(issm_sources)
+libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
+if MODULES
+libISSMModules_a_SOURCES = $(module_sources)
+libISSMModules_a_SOURCES += $(bamg_sources)
+libISSMModules_a_SOURCES += $(kriging_sources)
+libISSMModules_a_SOURCES += $(kml_sources)
+libISSMModules_a_CXXFLAGS = $(ALLCXXFLAGS)
+endif
+
if PYTHON
-libISSM_a_CXXFLAGS+= -DNPY_NO_DEPRECATED_API
-libISSM_a_SOURCES += $(python_sources)
+libISSMPython_a_SOURCES = $(python_sources)
+libISSMPython_a_CXXFLAGS= $(ALLCXXFLAGS)
endif
if MATLAB
-libISSM_a_SOURCES += $(matlab_sources)
+libISSMMatlab_a_SOURCES = $(matlab_sources)
+libISSMMatlab_a_CXXFLAGS= $(ALLCXXFLAGS)
endif
-endif
#}}}
-#ISSM parallel library {{{1
-if PARALLEL
-libpISSM_a_SOURCES = $(issm_sources)
-libpISSM_a_SOURCES += $(issm_psources)
-libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_ -D_C_ $(CXXFLAGS) $(CXXOPTFLAGS)
-endif
-#}}}
#Overload library, to overload any non-standard symbols. {{{1
-libOverload_a_SOURCES = ./shared/String/stricmp.c
-libOverload_a_CFLAGS = -fPIC -D_PARALLEL_ -D_C_ $(COPTFLAGS) $(CFLAGS)
+libISSMOverload_a_SOURCES = ./shared/String/stricmp.c
+libISSMOverload_a_CFLAGS = -fPIC -D_C_ $(COPTFLAGS) $(CFLAGS)
#}}}
#Executable {{{1
-if NOPARALLEL
-bin_PROGRAMS =
-else
bin_PROGRAMS = issm
-endif
#Standard libraries
-LDADD = ./libpISSM.a ./libOverload.a
+LDADD = ./libISSMCore.a ./libISSMOverload.a
#External packages
-LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)
+LDADD += $(PETSCLIB) $(TAOLIB) $(PLAPACKLIB) $(MUMPSLIB) $(SCALAPACKLIB) $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(OSLIBS) $(GSLLIB)
+if FORTRAN
+LDADD += $(FLIBS)
+endif
+
issm_SOURCES = solutions/issm.cpp
-issm_CXXFLAGS= -fPIC -D_PARALLEL_ $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
+issm_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
#}}}
#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
if ADIC2
-lib_LIBRARIES += libAD.a libpISSMRose.a
+lib_LIBRARIES += libAD.a libISSMRose.a
#ADIC2 library, for automatic differentiation
#libAD_a_SOURCES = ./mini1.ad.c
libAD_a_SOURCES =
-libAD_a_CFLAGS = -fPIC -D_PARALLEL_ -D_C_ $(COPTFLAGS)
+libAD_a_CFLAGS = -fPIC -D_C_ $(COPTFLAGS)
-
#test rose preprocessing
%.r2cpp.cpp : %.cpp
- testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_PARALLEL_ -D_C_ -I. -I../.. $(INCLUDES) $<
-libpISSMRose_a_SOURCES = $(libpISSM_a_SOURCES:.cpp=.r2cpp.cpp)
-libpISSMRose_a_CXXFLAGS= -fPIC -D_PARALLEL_ -D_C_ $(CXXOPTFLAGS)
+ testTranslator -rose:o $@ -rose:skipfinalCompileStep -DHAVE_CONFIG_H -D_C_ -I. -I../.. $(INCLUDES) $<
+libISSMRose_a_SOURCES = $(libISSMCore_a_SOURCES:.cpp=.r2cpp.cpp)
+libISSMRose_a_CXXFLAGS= -fPIC -D_C_ $(CXXOPTFLAGS)
@@ -1002,9 +1029,9 @@
#Executable
bin_PROGRAMS += issmRose.exe
-issmRose_exe_LDADD = ./libpISSMRose.a $(LDADD)
+issmRose_exe_LDADD = ./libISSMRose.a $(LDADD)
issmRose_exe_SOURCES = solutions/issm.cpp
-issmRose_exe_CXXFLAGS= -fPIC -D_PARALLEL_ $(CXXOPTFLAGS) $(COPTFLAGS)
+issmRose_exe_CXXFLAGS= -fPIC $(CXXOPTFLAGS) $(COPTFLAGS)
LDADD += $(ADIC2LIB)
endif #}}}
Modified: issm/trunk/src/c/include/macros.h
===================================================================
--- issm/trunk/src/c/include/macros.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/include/macros.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -39,93 +39,27 @@
((void) 0)
#endif
/*}}}*/
+/* ISSMBOOT/ISSMEND {{{1*/
-/* MODULEBOOT/MODULEEND {{{1*/
-
/*The following macros hide the error exception handling in a matlab module. Just put
- * MODULEBOOT(); and MODULEEND(); at the beginning and end of a module, and c++ exceptions
+ * ISSMBOOT(); and ISSMEND(); at the beginning and end of a module, and c++ exceptions
* will be trapped. Really nifty!*/
-#ifdef _SERIAL_
-#ifdef _HAVE_MATLAB_ //{{{2
-#define MODULEBOOT(); ModuleBoot(); \
+#define ISSMBOOT(); \
try{
-#define MODULEEND(); ModuleEnd(); }\
+#define ISSMEND(); }\
catch(ErrorException &exception){\
exception.Report(); \
- mexErrMsgTxt(""); \
- }\
- catch (exception& e) {\
- _printf_(true,"Standard exception: %s\n",e.what());\
- mexErrMsgTxt(" ");\
- }
-#endif //}}}
-#ifdef _HAVE_PYTHON_ //{{{2
-#define MODULEBOOT(); ModuleBoot(); \
- PyObject* output = PyTuple_New(NLHS); if (!output) return NULL;
-
-#define MODULEEND(); ModuleEnd(); \
- return output;
-#endif //}}}
-#else
-//{{{2
-#define MODULEBOOT(); \
- try{
-
-#define MODULEEND(); }\
- catch(ErrorException &exception){\
- exception.Report(); \
return 1;\
}\
catch (exception& e) {\
_printf_(true,"Standard exception: %s\n",e.what());\
return 1;\
+ }\
+ catch(...){\
+ _printf_(true,"An unexpected error occurred");\
}
-//}}}
-#endif
/*}}}*/
-/* WRAPPER {{{1*/
-#ifdef _HAVE_MATLAB_
-#define WRAPPER(modulename,...) void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
-#endif
-#ifdef _HAVE_PYTHON_
-#define WRAPPER(modulename,...) \
-\
-static PyObject* modulename(PyObject* self,PyObject* args);\
-static PyMethodDef modulename##_funcs[] = {\
- {#modulename, (PyCFunction)modulename, METH_VARARGS, ""},\
- {NULL,NULL,0,NULL}\
-};\
-\
-static struct PyModuleDef modulename##module= {\
- PyModuleDef_HEAD_INIT,\
- #modulename, /* name of module */\
- NULL, /* module documentation, may be NULL */\
- -1, /* size of per-interpreter state of the module,\
- or -1 if the module keeps state in global variables. */\
- modulename##_funcs\
-};\
-\
-PyMODINIT_FUNC PyInit_##modulename(void){\
-\
- import_array();\
- return PyModule_Create(&modulename##module);\
-}\
-\
-static PyObject* modulename(PyObject* self,PyObject* args)
#endif
-
-/*}}}*/
-/* CHECKARGUMENTS {{{1*/
-#ifdef _HAVE_MATLAB_
-#define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,functionpointer)
-#endif
-#ifdef _HAVE_PYTHON_
-#define CHECKARGUMENTS(NLHS,NRHS,functionpointer) CheckNumPythonArguments(args, NRHS,functionpointer)
-#endif
-/*}}}*/
-
-
-#endif
Modified: issm/trunk/src/c/include/types.h
===================================================================
--- issm/trunk/src/c/include/types.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/include/types.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,14 +15,6 @@
#include <stdio.h>
/*Define abstract type for I/O: */
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-typedef const mxArray* ConstDataHandle; //serially, we are reading data from a matlab array.
-typedef mxArray* DataHandle;
-#else
-typedef FILE* ConstDataHandle; //in parallel, we are reading data from a file.
-typedef FILE* DataHandle;
-#endif
enum param_type { STRING, INTEGER, STRINGARRAY, DOUBLE, DOUBLEVEC, DOUBLEMAT, PETSCVEC, PETSCMAT };
/*here are our abstracted types: inspired on petsc */
@@ -34,7 +26,12 @@
//#define MPIU_INT MPI_INT already defined in petsc
#endif
-typedef double IssmDouble;
+#ifdef _HAVE_ADOLC_
+typedef adouble IssmDouble;
+#else
+typedef double IssmDouble;
+#endif
+
typedef bool IssmBool;
Modified: issm/trunk/src/c/io/PrintfFunction.cpp
===================================================================
--- issm/trunk/src/c/io/PrintfFunction.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/io/PrintfFunction.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -8,10 +8,6 @@
#include "../shared/shared.h"
#include "../include/include.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
-
int PrintfFunction(const char* format,...){
/*http://linux.die.net/man/3/vsnprintf*/
@@ -52,11 +48,7 @@
}
/*Ok, if we are running in parallel, get node 0 to print*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mexPrintf(buffer);
-#else
if(my_rank==0)printf(buffer);
-#endif
/*Clean up and return*/
xfree((void**)&buffer);
Modified: issm/trunk/src/c/io/io.h
===================================================================
--- issm/trunk/src/c/io/io.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/io/io.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,14 +14,6 @@
#include "./Disk/diskio.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "./Matlab/matlabio.h"
-#endif
-
-#if defined(_HAVE_PYTHON_) && defined(_SERIAL_)
-#include "./Python/pythonio.h"
-#endif
-
/*printf: */
int PrintfFunction(const char* format,...);
Modified: issm/trunk/src/c/modules/Bamgx/Bamgx.cpp
===================================================================
--- issm/trunk/src/c/modules/Bamgx/Bamgx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Bamgx/Bamgx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -91,7 +91,7 @@
Mesh BTh(bamggeom_in,bamgmesh_in,bamgopts);
//Make Quadtree from background mesh
- BTh.MakeQuadTree();
+ BTh.MakeBamgQuadtree();
//Bound hmin and hmax
bamgopts->hmin=Max(bamgopts->hmin,BTh.MinimalHmin());
Modified: issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp
===================================================================
--- issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ConstraintsStatex/RiftConstraintsState.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,7 +31,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);
found=mpi_found;
@@ -94,7 +94,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);
num_unstable_constraints=sum_num_unstable_constraints;
@@ -134,7 +134,7 @@
}
/*Is there just one found? that would mean we have frozen! : */
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);
found=mpi_found;
@@ -194,7 +194,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);
found=mpi_found;
@@ -227,7 +227,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);
found=mpi_found;
@@ -288,7 +288,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);
num_unstable_constraints=sum_num_unstable_constraints;
@@ -328,7 +328,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&max_penetration,&mpi_max_penetration,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_max_penetration,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
max_penetration=mpi_max_penetration;
@@ -367,7 +367,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);
num_unstable_constraints=sum_num_unstable_constraints;
Modified: issm/trunk/src/c/modules/ConstraintsStatex/ThermalConstraintsState.cpp
===================================================================
--- issm/trunk/src/c/modules/ConstraintsStatex/ThermalConstraintsState.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ConstraintsStatex/ThermalConstraintsState.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -35,7 +35,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&num_unstable_constraints,&sum_num_unstable_constraints,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&sum_num_unstable_constraints,1,MPI_INT,0,MPI_COMM_WORLD);
num_unstable_constraints=sum_num_unstable_constraints;
Modified: issm/trunk/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp
===================================================================
--- issm/trunk/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ConstraintsStatex/ThermalIsPresent.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -27,7 +27,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Reduce (&found,&mpi_found,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&mpi_found,1,MPI_INT,0,MPI_COMM_WORLD);
found=mpi_found;
Modified: issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.cpp
===================================================================
--- issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,7 +10,7 @@
#include "./ContourToMeshx.h"
-int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue) {
+int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
int noerr=1;
int i;
@@ -36,7 +36,6 @@
in_elem=new Vector(nel);
/*initialize thread parameters: */
- gate.numcontours=numcontours;
gate.contours=contours;
gate.nods=nods;
gate.edgevalue=edgevalue;
Modified: issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.h
===================================================================
--- issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -12,8 +12,7 @@
/*threading: */
typedef struct{
- int numcontours;
- Contour** contours;
+ DataSet* contours;
int nods;
int edgevalue;
Vector* in_nod;
@@ -24,7 +23,7 @@
/* local prototypes: */
-int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,Contour** contours,int numcontours,char* interptype,int nel,int nods, int edgevalue);
+int ContourToMeshx( Vector** pin_nods,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue);
void* ContourToMeshxt(void* vContourToMeshxThreadStruct);
Modified: issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
===================================================================
--- issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -25,15 +25,9 @@
int i;
/*Contour:*/
- Contour* contouri=NULL;
- int numnodes;
- double* xc=NULL;
- double* yc=NULL;
+ DataSet* contours=NULL;
-
/*parameters: */
- int numcontours;
- Contour** contours=NULL;
int nods;
int edgevalue;
double* x=NULL;
@@ -48,7 +42,6 @@
num_threads=handle->num;
/*recover parameters :*/
- numcontours=gate->numcontours;
contours=gate->contours;
nods=gate->nods;
edgevalue=gate->edgevalue;
@@ -60,12 +53,9 @@
PartitionRange(&i0,&i1,nods,num_threads,my_thread);
/*Loop through all contours: */
- for (i=0;i<numcontours;i++){
- contouri=*(contours+i);
- numnodes=contouri->nods;
- xc=contouri->x;
- yc=contouri->y;
- IsInPoly(in_nod,xc,yc,numnodes,x,y,i0,i1,edgevalue);
+ for (i=0;i<contours->Size();i++){
+ Contour* contour=(Contour*)contours->GetObjectByOffset(i);
+ IsInPoly(in_nod,contour->x,contour->y,contour->nods,x,y,i0,i1,edgevalue);
}
return NULL;
Modified: issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
===================================================================
--- issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -37,3 +37,37 @@
return 1;
}
+
+int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue){
+
+ int i;
+ int m,n;
+
+ /*Contour:*/
+ Contour* contouri=NULL;
+ int numnodes;
+ double* xc=NULL;
+ double* yc=NULL;
+ double value;
+
+ /*output: */
+ Vector* flags=NULL;
+
+ flags=new Vector(nods);
+
+ /*Loop through all contours: */
+ if(contours){
+ for (i=0;i<contours->Size();i++){
+ Contour* contour=(Contour*)contours->GetObjectByOffset(i);
+ IsInPoly(flags,contour->x,contour->y,contour->nods,x,y,0,nods,edgevalue);
+ }
+ }
+
+ /*Assemble vector: */
+ flags->Assemble();
+
+ /*Assign output pointers: */
+ *pflags=flags;
+
+ return 1;
+}
Modified: issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.h
===================================================================
--- issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -11,6 +11,7 @@
/* local prototypes: */
int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, Contour** contours,int numcontours,int edgevalue);
+int ContourToNodesx( Vector** pflags,double* x, double* y, int nods, DataSet* contours, int edgevalue);
#endif /* _CONTOURTONODESX_H */
Modified: issm/trunk/src/c/modules/Dakotax/Dakotax.cpp
===================================================================
--- issm/trunk/src/c/modules/Dakotax/Dakotax.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Dakotax/Dakotax.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -50,11 +50,7 @@
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void Dakotax(mxArray* femmodel){
-#else
void Dakotax(FemModel* femmodel){
-#endif
#ifdef _HAVE_DAKOTA_ //only works if dakota library has been compiled in.
@@ -68,28 +64,18 @@
Parameters* parameters = NULL;
/*Retrieve parameters: */
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- FetchData((Parameters**)¶meters,mxGetField((mxArray*)femmodel,0,"parameters"));
- #else
parameters=femmodel->parameters;
- #endif
/*Recover dakota_input_file, dakota_output_file and dakota_error_file, in the parameters dataset in parallel */
parameters->FindParam(&dakota_input_file,QmuInNameEnum);
parameters->FindParam(&dakota_output_file,QmuOutNameEnum);
parameters->FindParam(&dakota_error_file,QmuErrNameEnum);
- #ifdef _PARALLEL_
if(my_rank==0){
- #endif
// Instantiate/initialize the parallel library and problem description
// database objects.
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- Dakota::ParallelLibrary parallel_lib; //use Dakota's standard library mode constructor
- #else
- Dakota::ParallelLibrary parallel_lib("serial"); //use our own ISSM Dakota library mode constructor, which only fires up Dakota on CPU 0.
- #endif
+ Dakota::ParallelLibrary parallel_lib("serial"); //use our own ISSM Dakota library mode constructor, which only fires up Dakota on CPU 0.
Dakota::ProblemDescDB problem_db(parallel_lib);
// Manage input file parsing, output redirection, and restart processing
@@ -122,12 +108,9 @@
problem_db.lock(); // prevent run-time DB queries
selected_strategy.run_strategy();
- #ifdef _PARALLEL_
//Warn other cpus that we are done running the dakota iterator, by setting the counter to -1:
SpawnCore(NULL,0, NULL,NULL,0,femmodel,-1);
- #endif
- #ifdef _PARALLEL_
}
else{
@@ -135,16 +118,11 @@
if(!SpawnCore(NULL,0, NULL,NULL,0,femmodel,0))break; //counter came in at -1 on cpu0, bail out.
}
}
- #endif //#ifdef _PARALLEL_
/*Free ressources:*/
xfree((void**)&dakota_input_file);
xfree((void**)&dakota_error_file);
xfree((void**)&dakota_output_file);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- delete parameters;
- #endif
-
#endif //#ifdef _HAVE_DAKOTA_
}
Modified: issm/trunk/src/c/modules/Dakotax/Dakotax.h
===================================================================
--- issm/trunk/src/c/modules/Dakotax/Dakotax.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Dakotax/Dakotax.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -9,16 +9,11 @@
#include "../../objects/objects.h"
/* local prototypes: */
-int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
+int SpawnCore(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, void* femmodel,int counter);
int DescriptorIndex(char* root, int* pindex,char* descriptor);
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void Dakotax(mxArray* femmodel);
-void SpawnCoreSerial(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, mxArray* femmodel,int counter);
-#else
void Dakotax(FemModel* femmodel);
void SpawnCoreParallel(double* responses, int numresponses, double* variables, char** variables_descriptors,int numvariables, FemModel* femmodel,int counter);
-#endif
void DakotaResponses(double* responses,char** responses_descriptors,int numresponses,FemModel* femmodel);
void DakotaMPI_Bcast(double** pvariables, char*** pvariables_descriptors,int* pnumvariables, int* pnumresponses);
void DakotaFree(double** pvariables,char*** pvariables_descriptors,char*** presponses_descriptors,int numvariables,int numresponses);
Modified: issm/trunk/src/c/modules/Dakotax/SpawnCore.cpp
===================================================================
--- issm/trunk/src/c/modules/Dakotax/SpawnCore.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Dakotax/SpawnCore.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -20,13 +20,10 @@
/*Branch into a serial SpawnCore and a parallel SpawnCore: */
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)femmodel, counter);
- #else
- /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */
- MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD);
- if(counter==-1)return 0;
- SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (FemModel*)femmodel,counter);
- #endif
+ /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */
+ MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD);
+ if(counter==-1)return 0;
+
+ SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (FemModel*)femmodel,counter);
return 1;
}
Modified: issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/DragCoefficientAbsGradientx/DragCoefficientAbsGradientx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp
===================================================================
--- issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ElementResponsex/ElementResponsex.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -36,8 +36,10 @@
}
/*Broadcast whether we found the element: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
if(!sumfound)_error_("%s%i%s","could not find material with id",index," to compute ElementResponse");
+ #endif
/*Ok, we found the element, compute responseocity: */
if(my_rank==cpu_found){
@@ -45,8 +47,10 @@
}
/*Broadcast and plug into response: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
MPI_Bcast(&response,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD);
+ #endif
*presponse=response;
}
Modified: issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -156,6 +156,7 @@
case PetscProfilingCurrentMemEnum : return "PetscProfilingCurrentMem";
case PetscProfilingCurrentFlopsEnum : return "PetscProfilingCurrentFlops";
case PetscProfilingSolutionTimeEnum : return "PetscProfilingSolutionTime";
+ case MaxIterationConvergenceFlagEnum : return "MaxIterationConvergenceFlag";
case SteadystateMaxiterEnum : return "SteadystateMaxiter";
case SteadystateNumRequestedOutputsEnum : return "SteadystateNumRequestedOutputs";
case SteadystateReltolEnum : return "SteadystateReltol";
Modified: issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
===================================================================
--- issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -60,7 +60,7 @@
/* read exp file */
- if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp,true))
+ if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
_error_("Error reading exp file.");
_printf_(true,"Exp2Kmlx -- Reading %d exp profiles from file \"%s\".\n",nprof,filexp);
// for (i=0; i<nprof; i++)
Modified: issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp
===================================================================
--- issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/GroundinglineMigrationx/GroundinglineMigrationx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -155,8 +155,12 @@
}
vec_nodes_on_floatingice->Assemble();
+ #ifdef _HAVE_MPI_
MPI_Allreduce(&local_nflipped,&nflipped,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
_printf_(VerboseConvergence()," Additional number of vertices allowed to unground: %i\n",nflipped);
+ #else
+ nflipped=local_nflipped;
+ #endif
/*Avoid leaks: */
xfree((void**)&elements_neighboring_floatingce);
Modified: issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp
===================================================================
--- issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/IceVolumex/IceVolumex.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -18,8 +18,12 @@
Element* element=(Element*)elements->GetObjectByOffset(i);
local_ice_volume+=element->IceVolume();
}
+ #ifdef _HAVE_MPI_
MPI_Reduce(&local_ice_volume,&total_ice_volume,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&total_ice_volume,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #else
+ total_ice_volume=local_ice_volume;
+ #endif
/*Assign output pointers: */
*pV=total_ice_volume;
Modified: issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp
===================================================================
--- issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/InputConvergencex/InputConvergencex.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,7 +29,7 @@
}
/*In parallel, we need to gather the converged status: */
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&num_notconverged,(void*)&total_notconverged,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
num_notconverged=total_notconverged;
#endif
Modified: issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
===================================================================
--- issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -13,7 +13,7 @@
using namespace std;
int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
- double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, Contour** contours, int numcontours){
+ double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values, DataSet* contours){
/*Output*/
double* data_interp=NULL;
@@ -35,7 +35,6 @@
double* incontour=NULL;
bool skip_bamg=false;
-
/*Checks*/
if (data_cols<=0){
_error_("data provided has a negative number of columns");
@@ -49,7 +48,7 @@
/*If default values supplied, figure out which nodes are inside the contour, including the border of the contour: */
if(num_default_values){
- ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,numcontours,1);
+ ContourToNodesx( &vec_incontour,x_interp,y_interp,nods_interp,contours,1);
incontour=vec_incontour->ToMPISerial();
}
Modified: issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h
===================================================================
--- issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -9,6 +9,6 @@
/* local prototypes: */
int InterpFromMeshToMesh2dx(double** pdata_interp,double* index_data,double* x_data,double* y_data,int nods_data,int nels_data,
- double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,Contour** contours, int numcontours );
+ double* data,int data_rows,int data_cols,double* x_interp,double* y_interp,int nods_interp,double* default_values,int num_default_values,DataSet* contours);
#endif
Modified: issm/trunk/src/c/modules/MassFluxx/MassFluxx.cpp
===================================================================
--- issm/trunk/src/c/modules/MassFluxx/MassFluxx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MassFluxx/MassFluxx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -58,7 +58,7 @@
}
}
- #ifdef _PARALLEL_
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( (void*)&mass_flux,(void*)&all_mass_flux,1,MPI_DOUBLE,MPI_SUM,MPI_COMM_WORLD);
mass_flux=all_mass_flux;
#endif
Modified: issm/trunk/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxAbsVxx/MaxAbsVxx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
maxabsvx=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out maximum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxabsvx,&node_maxabsvx,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxabsvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxabsvx=node_maxabsvx;
Modified: issm/trunk/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxAbsVyx/MaxAbsVyx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,8 +31,8 @@
maxabsvy=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out maximum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxabsvy,&node_maxabsvy,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxabsvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxabsvy=node_maxabsvy;
Modified: issm/trunk/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxAbsVzx/MaxAbsVzx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
maxabsvz=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxabsvz,&node_maxabsvz,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxabsvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxabsvz=node_maxabsvz;
Modified: issm/trunk/src/c/modules/MaxVelx/MaxVelx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxVelx/MaxVelx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxVelx/MaxVelx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,8 +31,8 @@
maxvel=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out maximum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxvel,&node_maxvel,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxvel,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxvel=node_maxvel;
Modified: issm/trunk/src/c/modules/MaxVxx/MaxVxx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxVxx/MaxVxx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxVxx/MaxVxx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
maxvx=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxvx,&node_maxvx,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxvx=node_maxvx;
Modified: issm/trunk/src/c/modules/MaxVyx/MaxVyx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxVyx/MaxVyx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxVyx/MaxVyx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
maxvy=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxvy,&node_maxvy,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxvy=node_maxvy;
Modified: issm/trunk/src/c/modules/MaxVzx/MaxVzx.cpp
===================================================================
--- issm/trunk/src/c/modules/MaxVzx/MaxVzx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MaxVzx/MaxVzx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,8 +31,8 @@
maxvz=-INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&maxvz,&node_maxvz,1,MPI_DOUBLE,MPI_MAX,0,MPI_COMM_WORLD );
MPI_Bcast(&node_maxvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
maxvz=node_maxvz;
Modified: issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp
===================================================================
--- issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MeshPartitionx/MeshPartitionx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -41,7 +41,9 @@
/*Partition using Metis:*/
if (num_procs>1){
+ #ifdef _HAVE_METIS_
METIS_PartMeshNodalPatch(&numberofelements,&numberofnodes, index, &etype, &numflag, &num_procs, &edgecut, epart, npart);
+ #endif
}
else if (num_procs==1){
/*METIS does not know how to deal with one cpu only!*/
@@ -66,7 +68,9 @@
/*Partition using Metis:*/
if (num_procs>1){
+ #ifdef _HAVE_METIS_
METIS_PartMeshNodalPatch(&numberofelements2d,&numberofnodes2d, index2d, &etype2d, &numflag, &num_procs, &edgecut, epart2d, npart2d);
+ #endif
}
else if (num_procs==1){
/*METIS does not know how to deal with one cpu only!*/
Modified: issm/trunk/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp
===================================================================
--- issm/trunk/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MeshProfileIntersectionx/SegmentIntersect.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,7 +5,7 @@
int SegmentIntersect(double* palpha, double* pbeta, double* x1, double* y1, double* x2, double* y2){
- /*See ISSM_TIER/src/m/utils/Geometry/SegIntersect.m for matlab routine from which we take this routine: */
+ /*See ISSM_DIR/src/m/utils/Geometry/SegIntersect.m for matlab routine from which we take this routine: */
/*output: */
double alpha=-1;
Modified: issm/trunk/src/c/modules/MinVelx/MinVelx.cpp
===================================================================
--- issm/trunk/src/c/modules/MinVelx/MinVelx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MinVelx/MinVelx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,8 +31,8 @@
minvel=INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&minvel,&node_minvel,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
MPI_Bcast(&node_minvel,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
minvel=node_minvel;
Modified: issm/trunk/src/c/modules/MinVxx/MinVxx.cpp
===================================================================
--- issm/trunk/src/c/modules/MinVxx/MinVxx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MinVxx/MinVxx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
minvx=INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&minvx,&node_minvx,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
MPI_Bcast(&node_minvx,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
minvx=node_minvx;
Modified: issm/trunk/src/c/modules/MinVyx/MinVyx.cpp
===================================================================
--- issm/trunk/src/c/modules/MinVyx/MinVyx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MinVyx/MinVyx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
minvy=INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&minvy,&node_minvy,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
MPI_Bcast(&node_minvy,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
minvy=node_minvy;
Modified: issm/trunk/src/c/modules/MinVzx/MinVzx.cpp
===================================================================
--- issm/trunk/src/c/modules/MinVzx/MinVzx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/MinVzx/MinVzx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
minvz=INFINITY;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&minvz,&node_minvz,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
MPI_Bcast(&node_minvz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
minvz=node_minvz;
Modified: issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -62,7 +62,6 @@
if(dim==2) elements_width=3; //tria elements
else elements_width=6; //penta elements
- #ifdef _PARALLEL_
/*Determine parallel partitioning of elements: we use Metis for now. First load the data, then partition*/
if(dim==2){
/*load elements: */
@@ -79,11 +78,6 @@
xfree((void**)&elements);
xfree((void**)&elements2d);
- #else
- /*In serial mode, epart is full of 0: all elements belong to cpu 0: */
- epart=(int*)xcalloc(numberofelements,sizeof(int));
- #endif
-
/*Deal with rifts, they have to be included into one partition only, not several: */
if(numrifts){
iomodel->FetchData(&riftinfo,&numrifts,NULL,RiftsRiftstructEnum);
Modified: issm/trunk/src/c/modules/NodalValuex/NodalValuex.cpp
===================================================================
--- issm/trunk/src/c/modules/NodalValuex/NodalValuex.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/NodalValuex/NodalValuex.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -35,12 +35,18 @@
}
/*Broadcast whether we found the element: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( &found,&sumfound,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
if(!sumfound)_error_("%s%i%s%s","could not find element with vertex with id",index," to compute nodal value ",EnumToStringx(natureofdataenum));
+ #endif
/*Broadcast and plug into response: */
+ #ifdef _HAVE_MPI_
MPI_Allreduce ( &cpu_found,&cpu_found,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
MPI_Bcast(&value,1,MPI_DOUBLE,cpu_found,MPI_COMM_WORLD);
+ #else
+ value=cpu_found;
+ #endif
*pnodalvalue=value;
}
Modified: issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp
===================================================================
--- issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,11 +15,7 @@
#include "../../io/io.h"
#include "../../objects/objects.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
-#else
void OutputResultsx( Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
-#endif
extern int my_rank;
FILE *fid = NULL;
@@ -30,21 +26,11 @@
char* solutiontypestring = NULL;
bool dakota_analysis = false;
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- const char **fnames = NULL;
- mwSize onebyone[2] = {0,0};
- mwSize ndim = 2;
- int nfields=0;
- #endif
-
/*retrieve parameters: */
parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
if(dakota_analysis){
//no need to output anything, Dakota analysis has different outputs
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- *pdataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
- #endif
return;
}
@@ -55,7 +41,6 @@
/*Results do not include the type of solution being run . In parallel, we output results to a filename,
*therefore, we need to include the solutiontype into the filename: */
- #ifdef _PARALLEL_
if(my_rank==0){
parameters->FindParam(&solutiontype,SolutionTypeEnum);
EnumToStringx(&solutiontypestring,solutiontype);
@@ -87,27 +72,20 @@
/*Add file pointer in parameters for further calls to OutputResultsx: */
parameters->SetParam(fid,OutputFilePointerEnum);
}
- #endif
- /*Write results to disk (in parallel), or to memory (in serial mode): */
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- results->Write(pdataref);
- #else
- results->Write(parameters);
- #endif
+ /*Write results to disk: */
+ results->Write(parameters);
/*Delete and reinitialize results, in parallel: */
- #ifdef _PARALLEL_
- results->clear();
+ results->clear();
- /*Close output file? :*/
- /*WARNING: issm.cpp is taking care of it for now (quick fix)
- if((step==1) && (time==0)){
- if(io_gather){
- if(my_rank==0) pfclose(fid,outputfilename);
- }
- else pfclose(fid,cpu_outputfilename);
- }
- */
- #endif
+ /*Close output file? :*/
+ /*WARNING: issm.cpp is taking care of it for now (quick fix)
+ if((step==1) && (time==0)){
+ if(io_gather){
+ if(my_rank==0) pfclose(fid,outputfilename);
+ }
+ else pfclose(fid,cpu_outputfilename);
+ }
+ */
}
Modified: issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h
===================================================================
--- issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -13,12 +13,7 @@
#include "../../Container/Container.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, Results* results);
-#else
void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, Results* results);
-#endif
#endif /* _OUTPUTRESULTS_H */
Modified: issm/trunk/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp
===================================================================
--- issm/trunk/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ParsePetscOptionsx/ParsePetscOptionsx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,6 +10,8 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
+#include <cstring>
+
#include "./ParsePetscOptionsx.h"
#include "../../io/io.h"
#include "../../shared/shared.h"
@@ -91,26 +93,28 @@
}
}
- #ifdef _PARALLEL_
/*Ok, broadcast to other cpus: */
+ #ifdef _HAVE_MPI_
MPI_Bcast(&numanalyses,1,MPI_INT,0,MPI_COMM_WORLD);
if(my_rank!=0){
analyses=(double*)xmalloc(numanalyses*sizeof(double));
strings=(char**)xmalloc(numanalyses*sizeof(char*));
}
MPI_Bcast(analyses,numanalyses,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
for(i=0;i<numanalyses;i++){
char* string=strings[i];
if(my_rank==0){
if(string==NULL) _error_("PETSc options for analysis %s have been declared but were not found",EnumToStringx((int)analyses[i]));
}
if(my_rank==0)stringlength=(strlen(string)+1)*sizeof(char);
+ #ifdef _HAVE_MPI_
MPI_Bcast(&stringlength,1,MPI_INT,0,MPI_COMM_WORLD);
if(my_rank!=0)string=(char*)xmalloc(stringlength);
MPI_Bcast(string,stringlength,MPI_CHAR,0,MPI_COMM_WORLD);
if(my_rank!=0)strings[i]=string;
+ #endif
}
- #endif
/*Ok, out of strings and analyses and numanalyses, create parameters, and plug them into parameters container: */
parameters->AddObject(new StringArrayParam(PetscOptionsStringsEnum,strings,numanalyses));
Modified: issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/RheologyBbarAbsGradientx/RheologyBbarAbsGradientx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.h
===================================================================
--- issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -21,9 +21,7 @@
#include "../../objects/objects.h"
/* local prototypes: */
-int Shp2Kmlx(char* filshp,char* filkml,
- int sgn);
-int Shp2Kmlx(char* filshp,char* filkml,
- int sgn,double cm,double sp);
+int Shp2Kmlx(char* filshp,char* filkml, int sgn);
+int Shp2Kmlx(char* filshp,char* filkml, int sgn,double cm,double sp);
#endif /* _SHP2KMLX_H */
Modified: issm/trunk/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- issm/trunk/src/c/modules/Solverx/Solverx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Solverx/Solverx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,10 +33,6 @@
if(df) df_vector = df->vector;
/*In serial mode, the Petsc Options database has not been initialized properly: */
- #ifdef _SERIAL_
- parameters->FindParam(&analysis_type,AnalysisTypeEnum);
- PetscOptionsFromAnalysis(parameters,analysis_type);
- #endif
SolverxPetsc(&uf_vector,Kff->matrix,pf->vector,uf0_vector,df_vector,parameters);
Modified: issm/trunk/src/c/modules/Solverx/SolverxPetsc.cpp
===================================================================
--- issm/trunk/src/c/modules/Solverx/SolverxPetsc.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/Solverx/SolverxPetsc.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -42,7 +42,6 @@
char ksp_type[50];
#endif
-
/*Display message*/
_printf_(VerboseModule()," Solving\n");
#if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)
@@ -51,14 +50,14 @@
if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD);
#endif
- /*First, check that f-set is not NULL, i.e. model is fully constrained: {{{*/
+ /*First, check that f-set is not NULL, i.e. model is fully constrained:*/
_assert_(Kff);
MatGetSize(Kff,&global_m,&global_n); _assert_(global_m==global_m);
if(!global_n){
*puf=NULL; return;
}
- /*}}}*/
- /*Initial guess logic here: {{{1*/
+
+ /*Initial guess */
/*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */
#if _PETSC_MAJOR_ >= 3
PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg);
@@ -73,56 +72,25 @@
else{
MatGetLocalSize(Kff,&local_m,&local_n);uf=NewVec(local_n,fromlocalsize);
}
- /*}}}*/
- /*Process petsc options to see if we are using special types of external solvers: {{{1*/
+
+ /*Process petsc options to see if we are using special types of external solvers*/
PetscOptionsDetermineSolverType(&solver_type);
- /*In serial mode, the matrices have been loaded as MPIAIJ or AIJ matrices.
- We need to convert them if we are going to run the solvers successfully: */
- #ifdef _SERIAL_
- #if _PETSC_MAJOR_ == 2
- if (solver_type==MUMPSPACKAGE_LU){
- /*Convert Kff to MATTAIJMUMPS: */
- MatConvert(Kff,MATAIJMUMPS,MAT_REUSE_MATRIX,&Kff);
- }
- if (solver_type==MUMPSPACKAGE_CHOL){
- /*Convert Kff to MATTSBAIJMUMPS: */
- MatConvert(Kff,MATSBAIJMUMPS,MAT_REUSE_MATRIX,&Kff);
- }
- if (solver_type==SPOOLESPACKAGE_LU){
- /*Convert Kff to MATTSBAIJMUMPS: */
- MatConvert(Kff,MATAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);
- }
- if (solver_type==SPOOLESPACKAGE_CHOL){
- /*Convert Kff to MATTSBAIJMUMPS: */
- MatConvert(Kff,MATSBAIJSPOOLES,MAT_REUSE_MATRIX,&Kff);
- }
- if (solver_type==SUPERLUDISTPACKAGE){
- /*Convert Kff to MATTSBAIJMUMPS: */
- MatConvert(Kff,MATSUPERLU_DIST,MAT_REUSE_MATRIX,&Kff);
- }
- if (solver_type==StokesSolverEnum){
- _error_("Petsc 2 does not support multi-physics solvers");
- }
- #endif
- #endif
- /*}}}*/
- /*Check the solver is available: {{{1*/
+ /*Check the solver is available*/
if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
- #if _PETSC_MAJOR_ >=3
- #ifndef _HAVE_MUMPS_
- _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+ #if _PETSC_MAJOR_ >=3
+ #ifndef _HAVE_MUMPS_
+ _error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+ #endif
#endif
-
- #endif
}
- /*}}}*/
- /*Prepare solver:{{{1*/
+
+ /*Prepare solver*/
KSPCreate(MPI_COMM_WORLD,&ksp);
KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
KSPSetFromOptions(ksp);
- #if defined(_SERIAL_) && _PETSC_MAJOR_==3
+ #if _PETSC_MAJOR_==3
/*Specific solver?: */
KSPGetPC(ksp,&pc);
if (solver_type==MUMPSPACKAGE_LU){
@@ -132,9 +100,7 @@
PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);
#endif
}
- #endif
- #if defined(_PARALLEL_) && _PETSC_MAJOR_==3
/*Stokes: */
if (solver_type==StokesSolverEnum){
/*Make indices out of doftypes: */
@@ -154,18 +120,17 @@
}
#endif
- /*}}}*/
- /*If there is an initial guess for the solution, use it, except if we are using the MUMPS direct solver, where any initial guess will crash Petsc: {{{1*/
+ /*If there is an initial guess for the solution, use it
+ * except if we are using the MUMPS direct solver
+ * where any initial guess will crash Petsc*/
if (uf0){
- if( (solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
+ if((solver_type!=MUMPSPACKAGE_LU) && (solver_type!=MUMPSPACKAGE_CHOL) && (solver_type!=SPOOLESPACKAGE_LU) && (solver_type!=SPOOLESPACKAGE_CHOL) && (solver_type!=SUPERLUDISTPACKAGE)){
KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
}
}
- /*}}}*/
-
- if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
/*Solve: */
+ if(VerboseSolver())KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
KSPSolve(ksp,pf,uf);
/*Check convergence*/
Modified: issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -160,6 +160,7 @@
else if (strcmp(name,"PetscProfilingCurrentMem")==0) return PetscProfilingCurrentMemEnum;
else if (strcmp(name,"PetscProfilingCurrentFlops")==0) return PetscProfilingCurrentFlopsEnum;
else if (strcmp(name,"PetscProfilingSolutionTime")==0) return PetscProfilingSolutionTimeEnum;
+ else if (strcmp(name,"MaxIterationConvergenceFlag")==0) return MaxIterationConvergenceFlagEnum;
else if (strcmp(name,"SteadystateMaxiter")==0) return SteadystateMaxiterEnum;
else if (strcmp(name,"SteadystateNumRequestedOutputs")==0) return SteadystateNumRequestedOutputsEnum;
else if (strcmp(name,"SteadystateReltol")==0) return SteadystateReltolEnum;
@@ -258,11 +259,11 @@
else if (strcmp(name,"Icefront")==0) return IcefrontEnum;
else if (strcmp(name,"Input")==0) return InputEnum;
else if (strcmp(name,"IntInput")==0) return IntInputEnum;
- else if (strcmp(name,"IntParam")==0) return IntParamEnum;
else stage=3;
}
if(stage==3){
- if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+ if (strcmp(name,"IntParam")==0) return IntParamEnum;
+ else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
else if (strcmp(name,"MacAyeal2dIceFront")==0) return MacAyeal2dIceFrontEnum;
else if (strcmp(name,"MacAyeal3dIceFront")==0) return MacAyeal3dIceFrontEnum;
else if (strcmp(name,"Matice")==0) return MaticeEnum;
@@ -381,11 +382,11 @@
else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
- else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
else stage=4;
}
if(stage==4){
- if (strcmp(name,"P0")==0) return P0Enum;
+ if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
+ else if (strcmp(name,"P0")==0) return P0Enum;
else if (strcmp(name,"P1")==0) return P1Enum;
else if (strcmp(name,"P1DG")==0) return P1DGEnum;
else if (strcmp(name,"SaveResults")==0) return SaveResultsEnum;
Modified: issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceAbsVelMisfitx/SurfaceAbsVelMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/SurfaceAreax/SurfaceAreax.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceAreax/SurfaceAreax.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceAreax/SurfaceAreax.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -27,9 +27,11 @@
}
/*Sum all J from all cpus of the cluster:*/
- MPI_Reduce (&S,&S_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
+ #ifdef _HAVE_MPI_
+ MPI_Reduce (&S,&S_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&S_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
S=S_sum;
+ #endif
/*add surface area to element inputs:*/
InputUpdateFromConstantx(elements,nodes,vertices,loads,materials,parameters,S,SurfaceAreaEnum);
Modified: issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceAverageVelMisfitx/SurfaceAverageVelMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,9 +30,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceLogVelMisfitx/SurfaceLogVelMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceLogVxVyMisfitx/SurfaceLogVxVyMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/SurfaceRelVelMisfitx/SurfaceRelVelMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ThicknessAbsGradientx/ThicknessAbsGradientx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp
===================================================================
--- issm/trunk/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/ThicknessAbsMisfitx/ThicknessAbsMisfitx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -26,9 +26,11 @@
}
/*Sum all J from all cpus of the cluster:*/
+ #ifdef _HAVE_MPI_
MPI_Reduce (&J,&J_sum,1,MPI_DOUBLE,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&J_sum,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
J=J_sum;
+ #endif
/*Assign output pointers: */
*pJ=J;
Modified: issm/trunk/src/c/modules/TimeAdaptx/TimeAdaptx.cpp
===================================================================
--- issm/trunk/src/c/modules/TimeAdaptx/TimeAdaptx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/TimeAdaptx/TimeAdaptx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,8 +30,8 @@
if(dt<min_dt)min_dt=dt;
}
- #ifdef _PARALLEL_
/*Figure out minimum across the cluster: */
+ #ifdef _HAVE_MPI_
MPI_Reduce (&min_dt,&node_min_dt,1,MPI_DOUBLE,MPI_MIN,0,MPI_COMM_WORLD );
MPI_Bcast(&node_min_dt,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
min_dt=node_min_dt;
Modified: issm/trunk/src/c/modules/TriMeshx/TriMeshx.cpp
===================================================================
--- issm/trunk/src/c/modules/TriMeshx/TriMeshx.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/TriMeshx/TriMeshx.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -9,11 +9,18 @@
#include "../../io/io.h"
#include "../../toolkits/toolkits.h"
#include "../../EnumDefinitions/EnumDefinitions.h"
+/*ANSI_DECLARATORS needed to call triangle library: */
+#ifndef ANSI_DECLARATORS
+#define ANSI_DECLARATORS
+#include "triangle.h"
+#undef ANSI_DECLARATORS
+#else
+#include "triangle.h"
+#endif
/*}}}*/
+void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area){
-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order){
-
/*indexing: */
int i,j;
@@ -27,7 +34,7 @@
double* segmentmarkerlist=NULL;
/*intermediary: */
- int counter,backcounter;
+ int counter,counter2,backcounter;
Contour* contour=NULL;
/* Triangle structures needed to call Triangle library routines: */
@@ -38,8 +45,13 @@
in.numberofpoints=0;
for (i=0;i<domain->Size();i++){
contour=(Contour*)domain->GetObjectByOffset(i);
+ in.numberofpoints+=contour->nods-1;
+ }
+ for (i=0;i<rifts->Size();i++){
+ contour=(Contour*)rifts->GetObjectByOffset(i);
in.numberofpoints+=contour->nods;
}
+
/*number of point attributes: */
in.numberofpointattributes=1;
@@ -49,6 +61,14 @@
counter=0;
for (i=0;i<domain->Size();i++){
contour=(Contour*)domain->GetObjectByOffset(i);
+ for (j=0;j<contour->nods-1;j++){
+ in.pointlist[2*counter+0]=contour->x[j];
+ in.pointlist[2*counter+1]=contour->y[j];
+ counter++;
+ }
+ }
+ for (i=0;i<rifts->Size();i++){
+ contour=(Contour*)rifts->GetObjectByOffset(i);
for (j=0;j<contour->nods;j++){
in.pointlist[2*counter+0]=contour->x[j];
in.pointlist[2*counter+1]=contour->y[j];
@@ -57,20 +77,24 @@
}
/*fill in the point attribute list: */
- in.pointattributelist = (REAL *) xmalloc(in.numberofpoints * in.numberofpointattributes * sizeof(REAL));
+ in.pointattributelist = (REAL*)xmalloc(in.numberofpoints*in.numberofpointattributes*sizeof(REAL));
for (i=0;i<in.numberofpoints;i++) in.pointattributelist[i] = 0.0;
/*fill in the point marker list: */
in.pointmarkerlist = (int *) xmalloc(in.numberofpoints * sizeof(int));
for(i=0;i<in.numberofpoints;i++) in.pointmarkerlist[i] = 0;
-
/*Build segments. First figure out number of segments: holes and closed outlines have as many segments as vertices: */
in.numberofsegments=0;
for (i=0;i<domain->Size();i++){
contour=(Contour*)domain->GetObjectByOffset(i);
- in.numberofsegments+=contour->nods;
+ in.numberofsegments+=contour->nods-1;
}
+ for(i=0;i<rifts->Size();i++){
+ contour=(Contour*)rifts->GetObjectByOffset(i);
+ /*for rifts, we have one less segment as we have vertices*/
+ in.numberofsegments+=contour->nods-1;
+ }
in.segmentlist = (int *) xmalloc(in.numberofsegments * 2 * sizeof(int));
in.segmentmarkerlist = (int *) xcalloc(in.numberofsegments,sizeof(int));
@@ -78,7 +102,7 @@
backcounter=0;
for (i=0;i<domain->Size();i++){
contour=(Contour*)domain->GetObjectByOffset(i);
- for (j=0;j<contour->nods-1;j++){
+ for (j=0;j<contour->nods-2;j++){
in.segmentlist[2*counter+0]=counter;
in.segmentlist[2*counter+1]=counter+1;
in.segmentmarkerlist[counter]=0;
@@ -91,7 +115,18 @@
counter++;
backcounter=counter;
}
-
+ counter2=counter;
+ for (i=0;i<rifts->Size();i++){
+ contour=(Contour*)rifts->GetObjectByOffset(i);
+ for (j=0;j<(contour->nods-1);j++){
+ in.segmentlist[2*counter2+0]=counter;
+ in.segmentlist[2*counter2+1]=counter+1;
+ in.segmentmarkerlist[counter2]=2+i;
+ counter2++;
+ counter++;
+ }
+ counter++;
+ }
/*Build regions: */
in.numberofregions = 0;
@@ -102,37 +137,31 @@
in.holelist = (REAL *) xmalloc(in.numberofholes * 2 * sizeof(REAL));
for (i=0;i<domain->Size()-1;i++){
contour=(Contour*)domain->GetObjectByOffset(i+1);
- GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods,contour->x,contour->y);
+ GridInsideHole(&in.holelist[2*i+0],&in.holelist[2*i+1],contour->nods-1,contour->x,contour->y);
}
}
/* Make necessary initializations so that Triangle can return a triangulation in `out': */
+ out.pointlist = (REAL*)NULL;
+ out.pointattributelist = (REAL*)NULL;
+ out.pointmarkerlist = (int *)NULL;
+ out.trianglelist = (int *)NULL;
+ out.triangleattributelist = (REAL*)NULL;
+ out.neighborlist = (int *)NULL;
+ out.segmentlist = (int *)NULL;
+ out.segmentmarkerlist = (int *)NULL;
+ out.edgelist = (int *)NULL;
+ out.edgemarkerlist = (int *)NULL;
- out.pointlist = (REAL *) NULL;
- out.pointattributelist = (REAL *) NULL;
- out.pointmarkerlist = (int *) NULL;
- out.trianglelist = (int *) NULL;
- out.triangleattributelist = (REAL *) NULL;
- out.neighborlist = (int *) NULL;
- out.segmentlist = (int *) NULL;
- out.segmentmarkerlist = (int *) NULL;
- out.edgelist = (int *) NULL;
- out.edgemarkerlist = (int *) NULL;
-
/* Triangulate the points:. Switches are chosen to read and write a */
/* PSLG (p), preserve the convex hull (c), number everything from */
/* zero (z), assign a regional attribute to each element (A), and */
/* produce an edge list (e), a Voronoi diagram (v), and a triangle */
/* neighbor list (n). */
-
sprintf(options,"%s%lf","pQzDq30ia",area); /*replace V by Q to quiet down the logging*/
-
-
triangulate(options, &in, &out, NULL);
-
/*report(&out, 0, 1, 1, 1, 1, 0);*/
-
/*Allocate index, x and y: */
index=(double*)xmalloc(3*out.numberoftriangles*sizeof(double));
x=(double*)xmalloc(out.numberofpoints*sizeof(double));
@@ -140,33 +169,27 @@
segments=(double*)xmalloc(3*out.numberofsegments*sizeof(double));
segmentmarkerlist=(double*)xmalloc(out.numberofsegments*sizeof(double));
- for (i = 0; i < out.numberoftriangles; i++) {
+ for (i = 0; i< out.numberoftriangles; i++) {
for (j = 0; j < out.numberofcorners; j++) {
- *(index+3*i+j)=(double)out.trianglelist[i * out.numberofcorners + j]+1;
+ index[3*i+j]=(double)out.trianglelist[i*out.numberofcorners+j]+1;
}
}
- for (i = 0; i < out.numberofpoints; i++) {
- x[i]=out.pointlist[i * 2 + 0];
- y[i]=out.pointlist[i * 2 + 1];
+ for (i = 0; i< out.numberofpoints; i++){
+ x[i]=out.pointlist[i*2+0];
+ y[i]=out.pointlist[i*2+1];
}
-
- for (i = 0; i < out.numberofsegments; i++) {
+ for (i = 0; i<out.numberofsegments;i++){
segments[3*i+0]=(double)out.segmentlist[i*2+0]+1;
segments[3*i+1]=(double)out.segmentlist[i*2+1]+1;
segmentmarkerlist[i]=(double)out.segmentmarkerlist[i];
}
-
-
/*Associate elements with segments: */
AssociateSegmentToElement(&segments,out.numberofsegments,index,out.numberoftriangles);
/*Order segments so that their normals point outside the domain: */
- if(order){
- OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
- }
+ OrderSegments(&segments,out.numberofsegments, index,out.numberoftriangles);
-
/*Output : */
index_matrix=new Matrix(index,out.numberoftriangles,3,1);
index_matrix->Convert(DENSE_SEQUENTIAL);
@@ -178,5 +201,4 @@
*px=new Vector(x,out.numberofpoints);
*py=new Vector(y,out.numberofpoints);
*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments);
-
}
Modified: issm/trunk/src/c/modules/TriMeshx/TriMeshx.h
===================================================================
--- issm/trunk/src/c/modules/TriMeshx/TriMeshx.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/TriMeshx/TriMeshx.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,23 +5,11 @@
#ifndef _TRIMESHX_H_
#define _TRIMESHX_H_
-
-
-/*ANSI_DECLARATORS needed to call triangle library: */
-#ifndef ANSI_DECLARATORS
-#define ANSI_DECLARATORS
-#include "triangle.h"
-#undef ANSI_DECLARATORS
-#else
-#include "triangle.h"
-#endif
-
#include "string.h"
-
#include "../../Container/Container.h"
#include "../../objects/objects.h"
/* local prototypes: */
-void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,double area,bool order);
+void TriMeshx(Matrix** pindex,Vector** px,Vector** py,Matrix** psegments,Vector** psegmentmarkerlist,DataSet* domain,DataSet* rifts,double area);
#endif /* _TRIMESHX_H */
Modified: issm/trunk/src/c/modules/modules.h
===================================================================
--- issm/trunk/src/c/modules/modules.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/modules/modules.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -61,6 +61,7 @@
#include "./Ll2xyx/Ll2xyx.h"
#include "./Exp2Kmlx/Exp2Kmlx.h"
#include "./Kml2Expx/Kml2Expx.h"
+#include "./Krigingx/Krigingx.h"
#include "./Shp2Kmlx/Shp2Kmlx.h"
#include "./MassFluxx/MassFluxx.h"
#include "./MaxAbsVxx/MaxAbsVxx.h"
@@ -111,9 +112,7 @@
#include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
#include "./TimeAdaptx/TimeAdaptx.h"
#include "./TriaSearchx/TriaSearchx.h"
-#ifdef _SERIAL_
#include "./TriMeshx/TriMeshx.h"
-#endif
#include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"
#include "./ThicknessAbsGradientx/ThicknessAbsGradientx.h"
#include "./UpdateVertexPositionsx/UpdateVertexPositionsx.h"
Modified: issm/trunk/src/c/objects/Bamg/BamgGeom.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgGeom.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgGeom.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -18,22 +18,6 @@
}
/*}}}*/
-/*FUNCTION BamgGeom::BamgGeom(mxArray* matlab_struct){{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-BamgGeom::BamgGeom(mxArray* matlab_struct){
-
- FetchData(&this->Vertices, &this->VerticesSize[0], &this->VerticesSize[1], mxGetAssignedField(matlab_struct,0,"Vertices"));
- FetchData(&this->Edges, &this->EdgesSize[0], &this->EdgesSize[1], mxGetAssignedField(matlab_struct,0,"Edges"));
- this->TangentAtEdgesSize[0]=0, this->TangentAtEdgesSize[1]=0; this->TangentAtEdges=NULL;
- FetchData(&this->Corners, &this->CornersSize[0], &this->CornersSize[1], mxGetAssignedField(matlab_struct,0,"Corners"));
- FetchData(&this->RequiredVertices,&this->RequiredVerticesSize[0],&this->RequiredVerticesSize[1],mxGetAssignedField(matlab_struct,0,"RequiredVertices"));
- FetchData(&this->RequiredEdges, &this->RequiredEdgesSize[0], &this->RequiredEdgesSize[1], mxGetAssignedField(matlab_struct,0,"RequiredEdges"));
- FetchData(&this->CrackedEdges, &this->CrackedEdgesSize[0], &this->CrackedEdgesSize[1], mxGetAssignedField(matlab_struct,0,"CrackedEdges"));
- FetchData(&this->SubDomains, &this->SubDomainsSize[0], &this->SubDomainsSize[1], mxGetAssignedField(matlab_struct,0,"SubDomains"));
-
-}
-#endif
-/*}}}*/
/*FUNCTION BamgGeom::~BamgGeom(){{{1*/
BamgGeom::~BamgGeom(){
@@ -48,78 +32,3 @@
}
/*}}}*/
-
-/*Methods*/
-/*FUNCTION BamgGeom::SetMatlabStructureFields{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BamgGeom::SetMatlabStructureFields(mxArray** matlab_struct){
-
- /*Intermediary*/
- int i;
- mxArray* output=NULL;
- const int numfields=7;
- const char* fnames[numfields];
- mwSize ndim=2;
- mwSize dimensions[2]={1,1};
-
- /*Initialize field names*/
- i=0;
- fnames[i++] = "Vertices";
- fnames[i++] = "Edges";
- fnames[i++] = "TangentAtEdges";
- fnames[i++] = "RequiredVertices";
- fnames[i++] = "RequiredEdges";
- fnames[i++] = "CrackedEdges";
- fnames[i++] = "SubDomains";
- _assert_(i==numfields);
-
- /*Initialize Matlab structure*/
- output=mxCreateStructArray(ndim,dimensions,numfields,fnames);
-
- /*set each matlab each field*/
- i=0;
- i++; SetMatlabStructureField(output,"Vertices", this->VerticesSize[0], this->VerticesSize[1], this->Vertices);
- i++; SetMatlabStructureField(output,"Edges", this->EdgesSize[0], this->EdgesSize[1], this->Edges);
- i++; SetMatlabStructureField(output,"TangentAtEdges", this->TangentAtEdgesSize[0], this->TangentAtEdgesSize[1], this->TangentAtEdges);
- i++; SetMatlabStructureField(output,"RequiredVertices",this->RequiredVerticesSize[0],this->RequiredVerticesSize[1],this->RequiredVertices);
- i++; SetMatlabStructureField(output,"RequiredEdges", this->RequiredEdgesSize[0], this->RequiredEdgesSize[1], this->RequiredEdges);
- i++; SetMatlabStructureField(output,"CrackedEdges", this->CrackedEdgesSize[0], this->CrackedEdgesSize[1], this->CrackedEdges);
- i++; SetMatlabStructureField(output,"SubDomains", this->SubDomainsSize[0], this->SubDomainsSize[1], this->SubDomains);
- _assert_(i==numfields);
-
- /*Assign output*/
- *matlab_struct=output;
-
-}
-#endif
-/*}}}*/
-/*FUNCTION BamgGeom::SetMatlabStructureField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BamgGeom::SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer){
-
- /*Intermediary*/
- int i1,i2;
- mxArray* pfield=NULL;
- mxArray* pfield2=NULL;
-
- /*Copy field*/
- double* fieldcopy=NULL;
- if (fieldrows*fieldcols){
- fieldcopy=(double*)xmalloc(fieldrows*fieldcols*sizeof(double));
- for(i1=0;i1<fieldrows;i1++){
- for(i2=0;i2<fieldcols;i2++){
- fieldcopy[fieldcols*i1+i2]=fieldpointer[fieldcols*i1+i2];
- }
- }
- }
-
- /*Set matlab field*/
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,fieldcols);
- mxSetN(pfield,fieldrows);
- mxSetPr(pfield,fieldcopy);
- mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
- mxSetField(matlab_struct,0,fieldname,pfield2);
-}
-#endif
-/*}}}*/
Modified: issm/trunk/src/c/objects/Bamg/BamgGeom.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgGeom.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgGeom.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -4,10 +4,6 @@
#ifndef _BAMGGEOM_H_
#define _BAMGGEOM_H_
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
class BamgGeom{
public:
@@ -29,15 +25,7 @@
double* SubDomains;
BamgGeom();
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- BamgGeom(mxArray* matlab_struct);
- #endif
~BamgGeom();
-
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabStructureFields(mxArray** matlab_struct);
- void SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer);
- #endif
};
#endif
Modified: issm/trunk/src/c/objects/Bamg/BamgMesh.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgMesh.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgMesh.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -17,9 +17,9 @@
this->CrackedVerticesSize[0]=0, this->CrackedVerticesSize[1]=0; this->CrackedVertices=NULL;
this->CrackedEdgesSize[0]=0, this->CrackedEdgesSize[1]=0; this->CrackedEdges=NULL;
- this->VerticesOnGeomVertexSize[0]=0, this->VerticesOnGeomVertexSize[1]=0;this->VerticesOnGeomVertex=NULL;
- this->VerticesOnGeomEdgeSize[0]=0, this->VerticesOnGeomEdgeSize[1]=0; this->VerticesOnGeomEdge=NULL;
- this->EdgesOnGeomEdgeSize[0]=0, this->EdgesOnGeomEdgeSize[1]=0; this->EdgesOnGeomEdge=NULL;
+ this->VerticesOnGeomVertexSize[0]=0, this->VerticesOnGeomVertexSize[1]=0; this->VerticesOnGeomVertex=NULL;
+ this->VerticesOnGeomEdgeSize[0]=0, this->VerticesOnGeomEdgeSize[1]=0; this->VerticesOnGeomEdge=NULL;
+ this->EdgesOnGeomEdgeSize[0]=0, this->EdgesOnGeomEdgeSize[1]=0; this->EdgesOnGeomEdge=NULL;
this->IssmEdgesSize[0]=0, this->IssmEdgesSize[1]=0; this->IssmEdges=NULL;
this->IssmSegmentsSize[0]=0, this->IssmSegmentsSize[1]=0; this->IssmSegments=NULL;
@@ -27,40 +27,8 @@
this->ElementConnectivitySize[0]=0, this->ElementConnectivitySize[1]=0; this->ElementConnectivity=NULL;
this->NodalConnectivitySize[0]=0, this->NodalConnectivitySize[1]=0; this->NodalConnectivity=NULL;
this->NodalElementConnectivitySize[0]=0, this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
-
-
}
/*}}}*/
-/*FUNCTION BamgMesh::BamgMesh(mxArray* matlab_struct){{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-BamgMesh::BamgMesh(mxArray* matlab_struct){
-
- int lines,cols;
-
- FetchData(&this->Vertices, &this->VerticesSize[0], &this->VerticesSize[1], mxGetAssignedField(matlab_struct,0,"Vertices"));
- FetchData(&this->Edges, &this->EdgesSize[0], &this->EdgesSize[1], mxGetAssignedField(matlab_struct,0,"Edges"));
- FetchData(&this->Triangles, &this->TrianglesSize[0], &this->TrianglesSize[1], mxGetAssignedField(matlab_struct,0,"Triangles"));
- this->QuadrilateralsSize[0]=0, this->QuadrilateralsSize[1]=0; this->Quadrilaterals=NULL;
-
- this->SubDomainsSize[0]=0, this->SubDomainsSize[1]=0; this->SubDomains=NULL;
- this->SubDomainsFromGeomSize[0]=0, this->SubDomainsFromGeomSize[1]=0; this->SubDomainsFromGeom=NULL;
- this->CrackedVerticesSize[0]=0, this->CrackedVerticesSize[1]=0; this->CrackedVertices=NULL;
- FetchData(&this->CrackedEdges, &this->CrackedEdgesSize[0], &this->CrackedEdgesSize[1], mxGetAssignedField(matlab_struct,0,"CrackedEdges"));
-
- FetchData(&this->VerticesOnGeomEdge, &this->VerticesOnGeomEdgeSize[0], &this->VerticesOnGeomEdgeSize[1], mxGetAssignedField(matlab_struct,0,"VerticesOnGeomEdge"));
- FetchData(&this->VerticesOnGeomVertex,&this->VerticesOnGeomVertexSize[0],&this->VerticesOnGeomVertexSize[1],mxGetAssignedField(matlab_struct,0,"VerticesOnGeomVertex"));
- FetchData(&this->EdgesOnGeomEdge, &this->EdgesOnGeomEdgeSize[0], &this->EdgesOnGeomEdgeSize[1], mxGetAssignedField(matlab_struct,0,"EdgesOnGeomEdge"));
-
- this->IssmEdgesSize[0]=0, this->IssmEdgesSize[1]=0; this->IssmEdges=NULL;
- FetchData(&this->IssmSegments, &this->IssmSegmentsSize[0], &this->IssmSegmentsSize[1], mxGetAssignedField(matlab_struct,0,"IssmSegments"));
-
- this->ElementConnectivitySize[0]=0, this->ElementConnectivitySize[1]=0; this->ElementConnectivity=NULL;
- this->NodalConnectivitySize[0]=0, this->NodalConnectivitySize[1]=0; this->NodalConnectivity=NULL;
- this->NodalElementConnectivitySize[0]=0, this->NodalElementConnectivitySize[1]=0; this->NodalElementConnectivity=NULL;
-
-}
-#endif
-/*}}}*/
/*FUNCTION BamgMesh::~BamgMesh(){{{1*/
BamgMesh::~BamgMesh(){
@@ -88,96 +56,3 @@
}
/*}}}*/
-
-/*Methods*/
-/*FUNCTION BamgMesh::SetMatlabStructureFields{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BamgMesh::SetMatlabStructureFields(mxArray** matlab_struct){
-
- /*Intermediary*/
- int i;
- mxArray* output=NULL;
- const int numfields=16;
- const char* fnames[numfields];
- mwSize ndim=2;
- mwSize dimensions[2]={1,1};
-
- /*Initialize field names*/
- i=0;
- fnames[i++] = "Triangles";
- fnames[i++] = "Vertices";
- fnames[i++] = "Edges";
- fnames[i++] = "IssmSegments";
- fnames[i++] = "IssmEdges";
- fnames[i++] = "Quadrilaterals";
- fnames[i++] = "VerticesOnGeomVertex";
- fnames[i++] = "VerticesOnGeomEdge";
- fnames[i++] = "EdgesOnGeomEdge";
- fnames[i++] = "SubDomains";
- fnames[i++] = "SubDomainsFromGeom";
- fnames[i++] = "ElementConnectivity";
- fnames[i++] = "NodalConnectivity";
- fnames[i++] = "NodalElementConnectivity";
- fnames[i++] = "CrackedVertices";
- fnames[i++] = "CrackedEdges";
- _assert_(i==numfields);
-
- /*Initialize Matlab structure*/
- output=mxCreateStructArray(ndim,dimensions,numfields,fnames);
-
- /*set each matlab each field*/
- i=0;
- i++; SetMatlabStructureField(output,"Triangles", this->TrianglesSize[0], this->TrianglesSize[1], this->Triangles);
- i++; SetMatlabStructureField(output,"Vertices", this->VerticesSize[0], this->VerticesSize[1], this->Vertices);
- i++; SetMatlabStructureField(output,"Edges", this->EdgesSize[0], this->EdgesSize[1], this->Edges);
- i++; SetMatlabStructureField(output,"IssmSegments", this->IssmSegmentsSize[0], this->IssmSegmentsSize[1], this->IssmSegments);
- i++; SetMatlabStructureField(output,"IssmEdges", this->IssmEdgesSize[0], this->IssmEdgesSize[1], this->IssmEdges);
- i++; SetMatlabStructureField(output,"Quadrilaterals", this->QuadrilateralsSize[0], this->QuadrilateralsSize[1], this->Quadrilaterals);
- i++; SetMatlabStructureField(output,"VerticesOnGeomVertex",this->VerticesOnGeomVertexSize[0],this->VerticesOnGeomVertexSize[1], this->VerticesOnGeomVertex);
- i++; SetMatlabStructureField(output,"VerticesOnGeomEdge", this->VerticesOnGeomEdgeSize[0], this->VerticesOnGeomEdgeSize[1], this->VerticesOnGeomEdge);
- i++; SetMatlabStructureField(output,"EdgesOnGeomEdge", this->EdgesOnGeomEdgeSize[0], this->EdgesOnGeomEdgeSize[1], this->EdgesOnGeomEdge);
- i++; SetMatlabStructureField(output,"SubDomains", this->SubDomainsSize[0], this->SubDomainsSize[1], this->SubDomains);
- i++; SetMatlabStructureField(output,"SubDomainsFromGeom", this->SubDomainsFromGeomSize[0], this->SubDomainsFromGeomSize[1], this->SubDomainsFromGeom);
- i++; SetMatlabStructureField(output,"ElementConnectivity", this->ElementConnectivitySize[0], this->ElementConnectivitySize[1], this->ElementConnectivity);
- i++; SetMatlabStructureField(output,"NodalConnectivity", this->NodalConnectivitySize[0], this->NodalConnectivitySize[1], this->NodalConnectivity);
- i++; SetMatlabStructureField(output,"NodalElementConnectivity", this->NodalElementConnectivitySize[0], this->NodalElementConnectivitySize[1], this->NodalElementConnectivity);
- i++; SetMatlabStructureField(output,"CrackedVertices", this->CrackedVerticesSize[0], this->CrackedVerticesSize[1], this->CrackedVertices);
- i++; SetMatlabStructureField(output,"CrackedEdges", this->CrackedEdgesSize[0], this->CrackedEdgesSize[1], this->CrackedEdges);
- _assert_(i==numfields);
-
- /*Assign output*/
- *matlab_struct=output;
-
-}
-#endif
-/*}}}*/
-/*FUNCTION BamgMesh::SetMatlabStructureField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BamgMesh::SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer){
-
- /*Intermediary*/
- int i1,i2;
- mxArray* pfield=NULL;
- mxArray* pfield2=NULL;
-
- /*Copy field*/
- double* fieldcopy=NULL;
- if (fieldrows*fieldcols){
- fieldcopy=(double*)xmalloc(fieldrows*fieldcols*sizeof(double));
- for(i1=0;i1<fieldrows;i1++){
- for(i2=0;i2<fieldcols;i2++){
- fieldcopy[fieldcols*i1+i2]=fieldpointer[fieldcols*i1+i2];
- }
- }
- }
-
- /*Set matlab field*/
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,fieldcols);
- mxSetN(pfield,fieldrows);
- mxSetPr(pfield,fieldcopy);
- mexCallMATLAB(1,&pfield2,1,&pfield,"transpose");//transpose
- mxSetField(matlab_struct,0,fieldname,pfield2);
-}
-#endif
-/*}}}*/
Modified: issm/trunk/src/c/objects/Bamg/BamgMesh.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgMesh.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgMesh.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -4,10 +4,6 @@
#ifndef _BAMGMESH_H_
#define _BAMGMESH_H_
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
class BamgMesh{
public:
@@ -50,16 +46,7 @@
double* NodalElementConnectivity;
BamgMesh();
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- BamgMesh(mxArray* matlab_struct);
- #endif
~BamgMesh();
-
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabStructureFields(mxArray** matlab_struct);
- void SetMatlabStructureField(mxArray* matlab_struct,const char* fieldname,int fieldrows,int fieldcols,double* fieldpointer);
- #endif
-
};
#endif
Modified: issm/trunk/src/c/objects/Bamg/BamgOpts.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgOpts.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgOpts.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -40,46 +40,6 @@
}
/*}}}*/
-/*FUNCTION BamgOpts::BamgOpts(mxArray* matlab_struct){{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-BamgOpts::BamgOpts(mxArray* matlab_struct){
-
- FetchData(&this->anisomax,mxGetField(matlab_struct,0,"anisomax"));
- FetchData(&this->cutoff,mxGetField(matlab_struct,0,"cutoff"));
- FetchData(&this->coeff,mxGetField(matlab_struct,0,"coeff"));
- FetchData(&this->errg,mxGetField(matlab_struct,0,"errg"));
- FetchData(&this->gradation,mxGetField(matlab_struct,0,"gradation"));
- FetchData(&this->Hessiantype,mxGetField(matlab_struct,0,"Hessiantype"));
- FetchData(&this->MaxCornerAngle,mxGetField(matlab_struct,0,"MaxCornerAngle"));
- FetchData(&this->maxnbv,mxGetField(matlab_struct,0,"maxnbv"));
- FetchData(&this->maxsubdiv,mxGetField(matlab_struct,0,"maxsubdiv"));
- FetchData(&this->Metrictype,mxGetField(matlab_struct,0,"Metrictype"));
- FetchData(&this->nbjacobi,mxGetField(matlab_struct,0,"nbjacobi"));
- FetchData(&this->nbsmooth,mxGetField(matlab_struct,0,"nbsmooth"));
- FetchData(&this->omega,mxGetField(matlab_struct,0,"omega"));
- FetchData(&this->power,mxGetField(matlab_struct,0,"power"));
- FetchData(&this->verbose,mxGetField(matlab_struct,0,"verbose"));
-
- FetchData(&this->Crack,mxGetField(matlab_struct,0,"Crack"));
- FetchData(&this->geometricalmetric,mxGetField(matlab_struct,0,"geometricalmetric"));
- FetchData(&this->KeepVertices,mxGetField(matlab_struct,0,"KeepVertices"));
- FetchData(&this->splitcorners,mxGetField(matlab_struct,0,"splitcorners"));
-
- FetchData(&this->hmin,mxGetField(matlab_struct,0,"hmin"));
- FetchData(&this->hmax,mxGetField(matlab_struct,0,"hmax"));
- FetchData(&this->hminVertices,&this->hminVerticesSize[0],&this->hminVerticesSize[1],mxGetField(matlab_struct,0,"hminVertices"));
- FetchData(&this->hmaxVertices,&this->hmaxVerticesSize[0],&this->hmaxVerticesSize[1],mxGetField(matlab_struct,0,"hmaxVertices"));
- FetchData(&this->hVertices,&this->hVerticesSize[0],&this->hVerticesSize[1],mxGetField(matlab_struct,0,"hVertices"));
- FetchData(&this->metric,&this->metricSize[0],&this->metricSize[1],mxGetField(matlab_struct,0,"metric"));
- FetchData(&this->field,&this->fieldSize[0],&this->fieldSize[1],mxGetField(matlab_struct,0,"field"));
- FetchData(&this->err,&this->errSize[0],&this->errSize[1],mxGetField(matlab_struct,0,"err"));
-
- /*Additional checks*/
- this->Check();
-
-}
-#endif
-/*}}}*/
/*FUNCTION BamgOpts::~BamgOpts() {{{1*/
BamgOpts::~BamgOpts(){
Modified: issm/trunk/src/c/objects/Bamg/BamgOpts.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/BamgOpts.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/BamgOpts.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,10 +5,6 @@
#ifndef _BAMGOPTS_H_
#define _BAMGOPTS_H_
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
class BamgOpts{
public:
@@ -53,9 +49,6 @@
double* err;
BamgOpts();
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- BamgOpts(mxArray* matlab_struct);
- #endif
~BamgOpts();
void Check(void);
Modified: issm/trunk/src/c/objects/Bamg/Geometry.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/Geometry.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/Geometry.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -504,7 +504,7 @@
long *next_p = new long[2*nbe];
float *eangle = new float[nbe];
double eps = 1e-20;
- QuadTree quadtree; // build quadtree to find duplicates
+ BamgQuadtree quadtree; // build quadtree to find duplicates
BamgVertex *v0 = vertices;
GeomVertex *v0g = (GeomVertex*) (void*)v0;
Modified: issm/trunk/src/c/objects/Bamg/Geometry.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Geometry.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/Geometry.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -11,7 +11,7 @@
namespace bamg {
class Triangle;
- class QuadTree;
+ class BamgQuadtree;
class GeomSubDomain;
class Edge;
@@ -19,19 +19,19 @@
public:
- long NbRef; // counter of ref on the this class if 0 we can delete
- long nbv; // number of vertices
- long nbe; // number of edges
- long nbsubdomains;
- long nbcurves;
+ long NbRef; // counter of ref on the this class if 0 we can delete
+ long nbv; // number of vertices
+ long nbe; // number of edges
+ long nbsubdomains;
+ long nbcurves;
GeomVertex *vertices;
GeomEdge *edges;
- QuadTree *quadtree;
+ BamgQuadtree *quadtree;
GeomSubDomain *subdomains;
- Curve *curves;
- R2 pmin,pmax; // domain extrema coordinates
- double coefIcoor; // coef to integer Icoor1;
- double MaxCornerAngle;
+ Curve *curves;
+ R2 pmin,pmax; // domain extrema coordinates
+ double coefIcoor; // coef to integer Icoor1;
+ double MaxCornerAngle;
//Constructor/Destructors
~Geometry();
@@ -43,7 +43,7 @@
const GeomVertex &operator[](long i) const { return vertices[i]; };
GeomVertex &operator[](long i) { return vertices[i]; };
const GeomEdge &operator()(long i) const { return edges[i]; };
- GeomEdge &operator()(long i) { return edges[i]; };
+ GeomEdge &operator()(long i) { return edges[i]; };
//Methods
void Echo();
Modified: issm/trunk/src/c/objects/Bamg/Mesh.cpp
===================================================================
--- issm/trunk/src/c/objects/Bamg/Mesh.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/Mesh.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -2884,7 +2884,7 @@
triangles[1].link=&triangles[0];
//build quadtree
- if (!quadtree) quadtree = new QuadTree(this,0);
+ if (!quadtree) quadtree = new BamgQuadtree(this,0);
quadtree->Add(*v0);
quadtree->Add(*v1);
@@ -3106,12 +3106,12 @@
delete [] qq;
}
/*}}}1*/
- /*FUNCTION Mesh::MakeQuadTree{{{1*/
- void Mesh::MakeQuadTree() {
- /*Original code from Frederic Hecht <hecht at ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeQuadTree)*/
+ /*FUNCTION Mesh::MakeBamgQuadtree{{{1*/
+ void Mesh::MakeBamgQuadtree() {
+ /*Original code from Frederic Hecht <hecht at ann.jussieu.fr> (BAMG v1.01, Mesh2.cpp/MakeBamgQuadtree)*/
long int verbose=0;
- if ( !quadtree ) quadtree = new QuadTree(this);
+ if ( !quadtree ) quadtree = new BamgQuadtree(this);
}
/*}}}1*/
@@ -3621,7 +3621,7 @@
triangles[1].link=&triangles[0];
if (!quadtree) delete quadtree; //ReInitialise;
- quadtree = new QuadTree(this,0);
+ quadtree = new BamgQuadtree(this,0);
quadtree->Add(*v0);
quadtree->Add(*v1);
@@ -3899,7 +3899,7 @@
}
if (quadtree){
delete quadtree;
- quadtree = new QuadTree(this);
+ quadtree = new BamgQuadtree(this);
}
for ( it=0;it<nbv;it++) renu[i]= -renu[i]-1;
@@ -4115,7 +4115,7 @@
}
delete [] tstart;
- if (quadtree) quadtree= new QuadTree(this);
+ if (quadtree) quadtree= new BamgQuadtree(this);
}
/*}}}1*/
/*FUNCTION Mesh::SmoothMetric{{{1*/
Modified: issm/trunk/src/c/objects/Bamg/Mesh.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Mesh.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/Mesh.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -16,7 +16,7 @@
//classes
class Geometry;
class CrackedEdge;
- class QuadTree;
+ class BamgQuadtree;
class SubDomain;
class Mesh {
@@ -28,7 +28,7 @@
BamgVertex *vertices;
Triangle *triangles;
Edge *edges;
- QuadTree *quadtree;
+ BamgQuadtree *quadtree;
BamgVertex **orderedvertices;
SubDomain *subdomains;
long NbRef; // counter of ref on the this class if 0 we can delete
@@ -93,7 +93,7 @@
long SplitInternalEdgeWithBorderVertices();
void MakeQuadrangles(double costheta);
int SplitElement(int choice);
- void MakeQuadTree();
+ void MakeBamgQuadtree();
void NewPoints(Mesh &,BamgOpts* bamgopts,int KeepVertices=1);
long InsertNewPoints(long nbvold,long & NbTSwap) ;
void TrianglesRenumberBySubDomain(bool justcompress=false);
Modified: issm/trunk/src/c/objects/Bamg/Metric.h
===================================================================
--- issm/trunk/src/c/objects/Bamg/Metric.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Bamg/Metric.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -4,6 +4,7 @@
#include "./include.h"
#include "../../shared/Bamg/shared.h"
#include "R2.h"
+#include <math.h>
namespace bamg {
Modified: issm/trunk/src/c/objects/Constraints/Constraint.h
===================================================================
--- issm/trunk/src/c/objects/Constraints/Constraint.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/Constraint.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,10 +10,8 @@
/*Headers:*/
/*{{{1*/
-#include "../Object.h"
-
class Nodes;
-
+#include "../Object.h"
#include "../../toolkits/toolkits.h"
/*}}}*/
Modified: issm/trunk/src/c/objects/Constraints/SpcDynamic.cpp
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcDynamic.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcDynamic.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -71,70 +71,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION SpcDynamic::Marshall {{{1*/
-void SpcDynamic::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of SpcDynamic: */
- enum_type=SpcDynamicEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall SpcDynamic data: */
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&isset,sizeof(isset));marshalled_dataset+=sizeof(isset);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-/*FUNCTION SpcDynamic::MarshallSize {{{1*/
-int SpcDynamic::MarshallSize(){
-
- return sizeof(sid)
- +sizeof(nodeid)
- +sizeof(dof)
- +sizeof(value)
- +sizeof(isset)
- +sizeof(analysis_type)
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION SpcDynamic::Demarshall {{{1*/
-void SpcDynamic::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&isset,marshalled_dataset,sizeof(isset));marshalled_dataset+=sizeof(isset);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-#endif
/*FUNCTION SpcDynamic::ObjectEnum{{{1*/
int SpcDynamic::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Constraints/SpcDynamic.h
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcDynamic.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcDynamic.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,11 +33,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Constraints/SpcStatic.cpp
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcStatic.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcStatic.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -74,67 +74,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION SpcStatic::Marshall {{{1*/
-void SpcStatic::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of SpcStatic: */
- enum_type=SpcStaticEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall SpcStatic data: */
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-/*FUNCTION SpcStatic::MarshallSize {{{1*/
-int SpcStatic::MarshallSize(){
-
- return sizeof(sid)
- +sizeof(nodeid)
- +sizeof(dof)
- +sizeof(value)
- +sizeof(analysis_type)
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION SpcStatic::Demarshall {{{1*/
-void SpcStatic::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-#endif
/*FUNCTION SpcStatic::ObjectEnum{{{1*/
int SpcStatic::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Constraints/SpcStatic.h
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcStatic.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcStatic.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -32,11 +32,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Constraints/SpcTransient.cpp
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcTransient.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcTransient.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -86,78 +86,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION SpcTransient::Marshall {{{1*/
-void SpcTransient::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of SpcTransient: */
- enum_type=SpcTransientEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall SpcTransient data: */
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(marshalled_dataset,&nsteps,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- if(nsteps){
- memcpy(marshalled_dataset,values,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
- memcpy(marshalled_dataset,times,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
- }
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-/*FUNCTION SpcTransient::MarshallSize {{{1*/
-int SpcTransient::MarshallSize(){
-
- return sizeof(sid)
- +sizeof(nodeid)
- +sizeof(dof)
- +sizeof(nsteps)
- +nsteps*2*sizeof(double)
- +sizeof(analysis_type)
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION SpcTransient::Demarshall {{{1*/
-void SpcTransient::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
- memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(&nsteps,marshalled_dataset,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- if(nsteps){
- values=(double*)xmalloc(nsteps*sizeof(double));
- times=(double*)xmalloc(nsteps*sizeof(double));
- memcpy(values,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
- memcpy(times,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-#endif
/*FUNCTION SpcTransient::ObjectEnum{{{1*/
int SpcTransient::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Constraints/SpcTransient.h
===================================================================
--- issm/trunk/src/c/objects/Constraints/SpcTransient.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Constraints/SpcTransient.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,11 +34,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Contour.cpp
===================================================================
--- issm/trunk/src/c/objects/Contour.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Contour.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -8,6 +8,7 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
+#include <string.h>
#include "./objects.h"
#include "../include/include.h"
#include "../io/io.h"
@@ -78,73 +79,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Contour::Marshall{{{1*/
-void Contour::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputssize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Contour: */
- enum_type=ContourEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Contour data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&nods,sizeof(nods));marshalled_dataset+=sizeof(nods);
- memcpy(marshalled_dataset,&closed,sizeof(closed));marshalled_dataset+=sizeof(closed);
- memcpy(marshalled_dataset,x,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
- memcpy(marshalled_dataset,y,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Contour::MarshallSize{{{1*/
-int Contour::MarshallSize(){
-
- return sizeof(id)+
- sizeof(nods)+
- sizeof(closed)+
- 2*nods*sizeof(double)+
- sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Contour::Demarshall{{{1*/
-void Contour::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&nods,marshalled_dataset,sizeof(nods));marshalled_dataset+=sizeof(nods);
- memcpy(&closed,marshalled_dataset,sizeof(closed));marshalled_dataset+=sizeof(closed);
-
- if(nods){
- this->x=(double*)xmalloc(nods*sizeof(double));
- this->y=(double*)xmalloc(nods*sizeof(double));
- memcpy(x,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
- memcpy(y,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Contour::ObjectEnum{{{1*/
int Contour::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Contour.h
===================================================================
--- issm/trunk/src/c/objects/Contour.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Contour.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -19,13 +19,13 @@
int id;
int nods; //number of vertices in the contour
- double* x;
- double* y;
+ IssmDouble* x;
+ IssmDouble* y;
bool closed; //is this contour closed?
/*Contour constructors, destructors {{{1*/
Contour();
- Contour(int id, int nods, double* x, double* y,bool closed);
+ Contour(int id, int nods, IssmDouble* x, IssmDouble* y,bool closed);
~Contour();
/*}}}*/
/*Object virtual functions{{{1*/
@@ -33,11 +33,6 @@
void DeepEcho(void);
int Id(void);
int MyRank(void);
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize(void);
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum(void);
Object* copy(void);
/*}}}*/
Modified: issm/trunk/src/c/objects/DofIndexing.cpp
===================================================================
--- issm/trunk/src/c/objects/DofIndexing.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/DofIndexing.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -207,129 +207,4 @@
printf("\n");
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DofIndexing::Marshall{{{1*/
-void DofIndexing::Marshall(char** pmarshalled_dataset){
- char* marshalled_dataset=NULL;
- int enum_type=0;
- bool flagdoftype; //to indicate if there are some doftype or if NULL
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*preliminary: */
- if(this->doftype)flagdoftype=true;
- else flagdoftype=false;
-
- /*get enum type of DofIndexing: */
- enum_type=DofIndexingEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall DofIndexing data: */
- memcpy(marshalled_dataset,&gsize,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
- memcpy(marshalled_dataset,&fsize,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
- memcpy(marshalled_dataset,&ssize,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
- memcpy(marshalled_dataset,&flagdoftype,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
- memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
-
- if(this->gsize>0){
- memcpy(marshalled_dataset,f_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
- memcpy(marshalled_dataset,s_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
- memcpy(marshalled_dataset,svalues,gsize*sizeof(double)); marshalled_dataset+=gsize*sizeof(double);
- if(flagdoftype){ memcpy(marshalled_dataset,doftype,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int); }
- memcpy(marshalled_dataset,gdoflist,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int);
- }
- if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(marshalled_dataset,fdoflist,fsize*sizeof(int)); marshalled_dataset+=fsize*sizeof(int);}
- if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(marshalled_dataset,sdoflist,ssize*sizeof(int)); marshalled_dataset+=ssize*sizeof(int);}
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION DofIndexing::MarshallSize{{{1*/
-int DofIndexing::MarshallSize(){
-
- int size=0;
-
- size+=4*sizeof(int)+sizeof(bool);
- if(this->gsize>0){
- size+= 2*this->gsize*sizeof(bool)+
- this->gsize*sizeof(double)+
- this->gsize*sizeof(int);
- if(this->doftype)size+=this->gsize*sizeof(int);
- }
- if(this->fsize>0 && this->fsize!=UNDEF)size+=this->fsize*sizeof(int);
- if(this->ssize>0 && this->ssize!=UNDEF)size+=this->ssize*sizeof(int);
-
- size+=sizeof(int); //sizeof(int) for enum type
-
- return size;
-}
-/*}}}*/
-/*FUNCTION DofIndexing::Demarshall{{{1*/
-void DofIndexing::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type;
- bool flagdoftype;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of object since DofIndexing is not directly called by DataSet: */
- memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-
- /*easy part: */
- memcpy(&gsize,marshalled_dataset,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
- memcpy(&fsize,marshalled_dataset,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
- memcpy(&ssize,marshalled_dataset,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
- memcpy(&flagdoftype,marshalled_dataset,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
- memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
-
- /*Allocate: */
- if(this->gsize>0){
- this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
- this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
- this->svalues=(double*)xmalloc(this->gsize*sizeof(double));
- if(flagdoftype)this->doftype=(int*)xmalloc(this->gsize*sizeof(int));
- else this->doftype=NULL;
- this->gdoflist=(int*)xmalloc(this->gsize*sizeof(int));
- }
- else{
- this->f_set=NULL;
- this->s_set=NULL;
- this->svalues=NULL;
- this->doftype=NULL;
- this->gdoflist=NULL;
- }
- if(this->fsize>0)
- this->fdoflist=(int*)xmalloc(this->fsize*sizeof(int));
- else
- this->fdoflist=NULL;
- if(this->ssize>0)
- this->sdoflist=(int*)xmalloc(this->ssize*sizeof(int));
- else
- this->sdoflist=NULL;
-
- /*Copy arrays: */
- if(this->gsize>0){
- memcpy(f_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
- memcpy(s_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
- memcpy(svalues,marshalled_dataset,gsize*sizeof(double));marshalled_dataset+=gsize*sizeof(double);
- if(flagdoftype){memcpy(doftype,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int); }
- memcpy(gdoflist,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int);
- }
-
- if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(this->fdoflist,marshalled_dataset,this->fsize*sizeof(int));marshalled_dataset+=this->fsize*sizeof(int); }
- if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(this->sdoflist,marshalled_dataset,this->ssize*sizeof(int));marshalled_dataset+=this->ssize*sizeof(int); }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
-
Modified: issm/trunk/src/c/objects/DofIndexing.h
===================================================================
--- issm/trunk/src/c/objects/DofIndexing.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/DofIndexing.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,6 +5,8 @@
#ifndef _DOFINDEXING_H_
#define _DOFINDEXING_H_
+#include "../include/include.h"
+
class DofIndexing{
public:
@@ -20,7 +22,7 @@
/*boundary conditions sets: */
bool* f_set; //is dof on f-set (on which we solve)
bool* s_set; //is dof on s-set (on which boundary conditions -dirichlet- are applied)
- double* svalues; //list of constraint values. size g_size, for ease of use.
+ IssmDouble* svalues; //list of constraint values. size g_size, for ease of use.
/*types of dofs: */
int* doftype; //approximation type of the dofs (used only for coupling), size g_size
@@ -42,11 +44,6 @@
/*Object like functionality: {{{1*/
void Echo(void);
void DeepEcho(void);
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
void copy(DofIndexing* properties);
/*}}}*/
/*DofIndexing management: {{{1*/
Modified: issm/trunk/src/c/objects/ElementResults/BoolElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/BoolElementResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/BoolElementResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -63,63 +63,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION BoolElementResult::Marshall{{{1*/
-void BoolElementResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of BoolElementResult: */
- enum_value=BoolElementResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall BoolElementResult data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolElementResult::Demarshall{{{1*/
-void BoolElementResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION BoolElementResult::MarshallSize{{{1*/
-int BoolElementResult::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)
- +sizeof(time)
- +sizeof(step)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-#endif
/*FUNCTION BoolElementResult::ObjectEnum{{{1*/
int BoolElementResult::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/ElementResults/BoolElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/BoolElementResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/BoolElementResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,11 +34,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -63,63 +63,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleElementResult::Marshall{{{1*/
-void DoubleElementResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleElementResult: */
- enum_value=DoubleElementResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleElementResult data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleElementResult::Demarshall{{{1*/
-void DoubleElementResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION DoubleElementResult::MarshallSize{{{1*/
-int DoubleElementResult::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)
- +sizeof(time)
- +sizeof(step)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleElementResult::ObjectEnum{{{1*/
int DoubleElementResult::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,11 +34,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -66,63 +66,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION PentaP1ElementResult::Marshall{{{1*/
-void PentaP1ElementResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of PentaP1ElementResult: */
- enum_value=PentaP1ElementResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall PentaP1ElementResult data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PentaP1ElementResult::MarshallSize{{{1*/
-int PentaP1ElementResult::MarshallSize(){
-
- return sizeof(values)+
- +sizeof(enum_type)
- +sizeof(time)
- +sizeof(step)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PentaP1ElementResult::Demarshall{{{1*/
-void PentaP1ElementResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION PentaP1ElementResult::ObjectEnum{{{1*/
int PentaP1ElementResult::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,11 +33,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -65,64 +65,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION TriaP1ElementResult::Marshall{{{1*/
-void TriaP1ElementResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of TriaP1ElementResult: */
- enum_value=TriaP1ElementResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall TriaP1ElementResult data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaP1ElementResult::MarshallSize{{{1*/
-int TriaP1ElementResult::MarshallSize(){
-
- return sizeof(values)
- +sizeof(enum_type)
- +sizeof(time)
- +sizeof(step)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaP1ElementResult::Demarshall{{{1*/
-void TriaP1ElementResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION TriaP1ElementResult::ObjectEnum{{{1*/
int TriaP1ElementResult::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -32,11 +32,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Elements/Penta.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -142,163 +142,6 @@
}
/*}}}*/
-/*Marshall*/
-#ifdef _SERIAL_
-/*FUNCTION Penta::Marshall {{{1*/
-void Penta::Marshall(char** pmarshalled_dataset){
-
- int i;
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
- char* marshalled_results=NULL;
- int marshalled_results_size;
- int flaghook; //to indicate if hook is NULL or exists
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Penta: */
- enum_type=PentaEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Penta data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
- /*Mershall Ref: */
- for(i=0;i<numanalyses;i++){
- memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
- }
-
- /*Marshall hooks: */
- for(i=0;i<numanalyses;i++){
- if(hnodes[i]){
- /*Set flag to 1 as there is a hook */
- flaghook=1;
- memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- hnodes[i]->Marshall(&marshalled_dataset);
- }
- else{
- /*Set flag to 0 and do not marshall flag as there is no Hook */
- flaghook=0;
- memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- }
- }
- hmatice->Marshall(&marshalled_dataset);
- hmatpar->Marshall(&marshalled_dataset);
- hneighbors->Marshall(&marshalled_dataset);
-
- /*Marshall inputs and results: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- marshalled_results_size=results->MarshallSize();
- marshalled_results=results->Marshall();
- memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
- marshalled_dataset+=marshalled_results_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
- xfree((void**)&marshalled_results);
-
- /*marshall horizontal neighbors: */
- memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Penta::MarshallSize {{{1*/
-int Penta::MarshallSize(){
-
- int i;
- int hnodes_size=0;;
-
- for(i=0;i<numanalyses;i++){
- hnodes_size+=sizeof(int); //Flag 0 or 1
- if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
- }
-
- return sizeof(id)
- +sizeof(sid)
- +hnodes_size
- +sizeof(numanalyses)
- +numanalyses*sizeof(int) //element_type_lists
- +hmatice->MarshallSize()
- +hmatpar->MarshallSize()
- +hneighbors->MarshallSize()
- +inputs->MarshallSize()
- +results->MarshallSize()
- +3*sizeof(int)
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Penta::Demarshall {{{1*/
-void Penta::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int flaghook;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
- /*demarshall Ref: */
- this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
- for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
-
- /*allocate dynamic memory: */
- this->hnodes=new Hook*[this->numanalyses];
- /*demarshall hooks: */
- for(i=0;i<numanalyses;i++){
- memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- if(flaghook){ // there is a hook so demarshall it
- hnodes[i]=new Hook();
- hnodes[i]->Demarshall(&marshalled_dataset);
- }
- else hnodes[i]=NULL; //There is no hook so it is NULL
- }
- hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
- hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
- hneighbors=new Hook(); hneighbors->Demarshall(&marshalled_dataset);
-
- /*pointers are garbage, until configuration is carried out: */
- nodes=NULL;
- matice=NULL;
- matpar=NULL;
- verticalneighbors=NULL;
-
- /*demarshall inputs and results: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
- results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
-
- /*neighbors: */
- memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
-
/*Other*/
/*FUNCTION Penta::AverageOntoPartition {{{1*/
void Penta::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){
Modified: issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Elements/Penta.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -54,11 +54,6 @@
void Echo();
int ObjectEnum();
int Id();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int MyRank();
/*}}}*/
/*Update virtual functions definitions: {{{1*/
Modified: issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Elements/Tria.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -122,160 +122,6 @@
}
/*}}}*/
-/*Marshall*/
-#ifdef _SERIAL_
-/*FUNCTION Tria::Marshall {{{1*/
-void Tria::Marshall(char** pmarshalled_dataset){
-
- int i;
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
- char* marshalled_results=NULL;
- int marshalled_results_size;
- int flaghook; //to indicate if hook is NULL or exists
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Tria: */
- enum_type=TriaEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Tria data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
- /*Mershall Ref: */
- for(i=0;i<numanalyses;i++){
- memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
- }
-
- /*Marshall hooks: */
- for(i=0;i<numanalyses;i++){
- if(hnodes[i]){
- /*Set flag to 1 as there is a hook */
- flaghook=1;
- memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- hnodes[i]->Marshall(&marshalled_dataset);
- }
- else{
- /*Set flag to 0 and do not marshall flag as there is no Hook */
- flaghook=0;
- memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- }
- }
- hmatice->Marshall(&marshalled_dataset);
- hmatpar->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*Marshall results: */
- marshalled_results_size=results->MarshallSize();
- marshalled_results=results->Marshall();
- memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
- marshalled_dataset+=marshalled_results_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
- xfree((void**)&marshalled_results);
-
- /*marshall horizontal neighbors: */
- memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Tria::MarshallSize {{{1*/
-int Tria::MarshallSize(){
-
- int i;
- int hnodes_size=0;;
-
- for(i=0;i<numanalyses;i++){
- hnodes_size+=sizeof(int); //Flag 0 or 1
- if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
- }
-
- return sizeof(id)
- +sizeof(sid)
- +hnodes_size
- +sizeof(numanalyses)
- +numanalyses*sizeof(int) //element_type_lists
- +hmatice->MarshallSize()
- +hmatpar->MarshallSize()
- +inputs->MarshallSize()
- +results->MarshallSize()
- +3*sizeof(int)
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Tria::Demarshall {{{1*/
-void Tria::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int flaghook;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
-
- /*demarshall Ref: */
- this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
- for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
-
- /*allocate dynamic memory: */
- this->hnodes=new Hook*[this->numanalyses];
- /*demarshall hooks: */
- for(i=0;i<numanalyses;i++){
- memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
- if(flaghook){ // there is a hook so demarshall it
- hnodes[i]=new Hook();
- hnodes[i]->Demarshall(&marshalled_dataset);
- }
- else hnodes[i]=NULL; //There is no hook so it is NULL
- }
- hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
- hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
-
- /*pointers are garbabe, until configuration is carried out: */
- nodes=NULL;
- matice=NULL;
- matpar=NULL;
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
- results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
-
- /*neighbors: */
- memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
-
/*Other*/
/*FUNCTION Tria::AverageOntoPartition {{{1*/
void Tria::AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,double* vertex_response,double* qmu_part){
@@ -782,7 +628,10 @@
surface_mass_balance_input->GetInputValue(&surface_mass_balance_g,gauss);
basal_melting_input->GetInputValue(&basal_melting_g,gauss);
thickness_input->GetInputValue(&thickness_g,gauss);
- if(basal_melting_correction_input) basal_melting_correction_input->GetInputValue(&basal_melting_correction_g,gauss);
+ if(basal_melting_correction_input)
+ basal_melting_correction_input->GetInputValue(&basal_melting_correction_g,gauss);
+ else
+ basal_melting_correction_g=0.;
for(i=0;i<numdof;i++) pe->values[i]+=Jdettria*gauss->weight*(thickness_g+dt*(surface_mass_balance_g-basal_melting_g-basal_melting_correction_g))*L[i];
}
Modified: issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Elements/Tria.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -50,11 +50,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -67,66 +67,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION BoolExternalResult::Marshall{{{1*/
-void BoolExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of BoolExternalResult: */
- enum_value=BoolExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall BoolExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolExternalResult::MarshallSize{{{1*/
-int BoolExternalResult::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION BoolExternalResult::Demarshall{{{1*/
-void BoolExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION BoolExternalResult::ObjectEnum{{{1*/
int BoolExternalResult::ObjectEnum(void){
@@ -184,19 +124,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION BoolExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BoolExternalResult::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- this->GetResultName(&name);
-
- mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar((double)value));
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-}
-#endif
-/*}}}*/
/*FUNCTION BoolExternalResult::GetStep{{{1*/
int BoolExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/BoolExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,11 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -46,11 +41,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -58,10 +48,7 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
-#endif /* _BOOLEXTERNALRESULT_H */
+#endif
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -67,66 +67,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleExternalResult::Marshall{{{1*/
-void DoubleExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleExternalResult: */
- enum_value=DoubleExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleExternalResult::MarshallSize{{{1*/
-int DoubleExternalResult::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleExternalResult::Demarshall{{{1*/
-void DoubleExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleExternalResult::ObjectEnum{{{1*/
int DoubleExternalResult::ObjectEnum(void){
@@ -180,19 +120,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION DoubleExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleExternalResult::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- this->GetResultName(&name);
- mxSetField( dataref,this->step-1, name,mxCreateDoubleScalar(value));
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleExternalResult::GetStep{{{1*/
int DoubleExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,11 +15,7 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -47,11 +43,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -59,9 +50,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -95,75 +95,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleMatExternalResult::Marshall{{{1*/
-void DoubleMatExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleMatExternalResult: */
- enum_value=DoubleMatExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleMatExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
- memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleMatExternalResult::MarshallSize{{{1*/
-int DoubleMatExternalResult::MarshallSize(){
-
- return sizeof(M)
- +sizeof(N)
- +M*N*sizeof(double)
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleMatExternalResult::Demarshall{{{1*/
-void DoubleMatExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
- values=(double*)xmalloc(M*N*sizeof(double));
- memcpy(values,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{1*/
int DoubleMatExternalResult::ObjectEnum(void){
@@ -221,39 +152,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION DoubleMatExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleMatExternalResult::SetMatlabField(mxArray* dataref){
-
- mxArray* pfield=NULL;
- mxArray* pfield2=NULL;
- char* name=NULL;
- double* doublemat=NULL;
-
- /*Make a copy of the value, to be used by matlab: */
- doublemat=(double*)xmalloc(M*N*sizeof(double));
- memcpy(doublemat,values,M*N*sizeof(double));
-
- /*recover name: */
- this->GetResultName(&name);
-
- /*create matlab matrix: */
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,N);
- mxSetN(pfield,M);
- mxSetPr(pfield,doublemat);
-
- /*transpose the matrix, from c to matlab format */
- mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
-
- /*set tranpose matrix inside the dataref structure: */
- mxSetField( dataref, this->step-1, name,pfield2);
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleMatExternalResult::GetStep{{{1*/
int DoubleMatExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleMatExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,11 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -48,11 +43,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -60,9 +50,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -86,72 +86,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleVecExternalResult::Marshall{{{1*/
-void DoubleVecExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleVecExternalResult: */
- enum_value=DoubleVecExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleVecExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleVecExternalResult::MarshallSize{{{1*/
-int DoubleVecExternalResult::MarshallSize(){
-
- return sizeof(M)
- +M*sizeof(double)
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleVecExternalResult::Demarshall{{{1*/
-void DoubleVecExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- values=(double*)xmalloc(M*sizeof(double));
- memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{1*/
int DoubleVecExternalResult::ObjectEnum(void){
@@ -205,34 +139,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION DoubleVecExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleVecExternalResult::SetMatlabField(mxArray* dataref){
-
- mxArray *pfield = NULL;
- double *doublemat = NULL;
- char *name = NULL;
- double *doublevec = NULL;
-
- /*Make a copy of the value, to be used by matlab: */
- doublevec=(double*)xmalloc(M*sizeof(double));
- memcpy(doublevec,values,M*sizeof(double));
-
- /*recover name: */
- this->GetResultName(&name);
-
- /*create matlab matrix: */
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,1);
- mxSetPr(pfield,doublevec);
-
- mxSetField( dataref, this->step-1, name,pfield);
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleVecExternalResult::GetStep{{{1*/
int DoubleVecExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/DoubleVecExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,11 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -47,11 +42,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -59,9 +49,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/ExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/ExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/ExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,10 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "../Object.h"
#include "../Node.h"
/*}}}*/
@@ -32,9 +28,6 @@
virtual int InstanceEnum()=0;
virtual void WriteData(FILE* fid,bool io_gather)=0;
virtual void GetResultName(char**)=0;
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- virtual void SetMatlabField(mxArray* dataref)=0;
- #endif
virtual int GetStep(void)=0;
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/IntExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -67,66 +67,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION IntExternalResult::Marshall{{{1*/
-void IntExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of IntExternalResult: */
- enum_value=IntExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall IntExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntExternalResult::MarshallSize{{{1*/
-int IntExternalResult::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntExternalResult::Demarshall{{{1*/
-void IntExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION IntExternalResult::ObjectEnum{{{1*/
int IntExternalResult::ObjectEnum(void){
@@ -184,20 +124,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION IntExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void IntExternalResult::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- this->GetResultName(&name);
-
- mxSetField( dataref, this->step-1, name,mxCreateDoubleScalar(value));
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-
-}
-#endif
-/*}}}*/
/*FUNCTION IntExternalResult::GetStep{{{1*/
int IntExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/IntExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,10 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -45,11 +41,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -57,9 +48,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -79,110 +79,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION PetscVecExternalResult::Marshall{{{1*/
-void PetscVecExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int M;
- double* serial_value=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of PetscVecExternalResult: */
- enum_value=PetscVecExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall PetscVecExternalResult data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- if(value){
- VecGetSize(value,&M);
- VecToMPISerial(&serial_value,value);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
- }
- else{
- M=0;
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- }
- /*Free ressources:*/
- xfree((void**)&serial_value);
-
- /*return:*/
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PetscVecExternalResult::MarshallSize{{{1*/
-int PetscVecExternalResult::MarshallSize(){
-
- int M=0;
- if(value)VecGetSize(value,&M);
-
- return sizeof(M)+M*sizeof(double)
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PetscVecExternalResult::Demarshall{{{1*/
-void PetscVecExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int M;
- double* serial_vec=NULL;
- int* idxm=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M){
- serial_vec=(double*)xmalloc(M*sizeof(double));
- memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
-
- value=NewVec(M);
- idxm=(int*)xmalloc(M*sizeof(int));
- for(i=0;i<M;i++)idxm[i]=i;
- VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
-
- VecAssemblyBegin(value);
- VecAssemblyEnd(value);
-
-
- }
- else{
- value=NULL;
- }
-
- /*Free ressources:*/
- xfree((void**)&serial_vec);
- xfree((void**)&idxm);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-#endif
/*FUNCTION PetscVecExternalResult::ObjectEnum{{{1*/
int PetscVecExternalResult::ObjectEnum(void){
@@ -243,31 +139,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION PetscVecExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void PetscVecExternalResult::SetMatlabField(mxArray* dataref){
-
- mxArray* pfield=NULL;
- char* name=NULL;
- double* doublevec=NULL;
- int M;
-
- VecToMPISerial(&doublevec,value);
- VecGetSize(value,&M);
- this->GetResultName(&name);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,1);
- mxSetPr(pfield,doublevec);
-
- mxSetField( dataref, this->step-1, name, pfield);
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-
-}
-#endif
-/*}}}*/
/*FUNCTION PetscVecExternalResult::GetStep{{{1*/
int PetscVecExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/PetscVecExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,11 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -47,11 +42,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -59,9 +49,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/StringExternalResult.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -70,79 +70,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION StringExternalResult::Marshall{{{1*/
-void StringExternalResult::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int stringsize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of StringExternalResult: */
- enum_value=StringExternalResultEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- stringsize=strlen(this->value)+1;
-
- memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
- memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
- memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION StringExternalResult::MarshallSize{{{1*/
-int StringExternalResult::MarshallSize(){
-
- int stringsize;
- stringsize=strlen(this->value)+1;
-
- return sizeof(int)+
- +stringsize*sizeof(char)
- +sizeof(id)
- +sizeof(enum_type)
- +sizeof(step)
- +sizeof(time)
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION StringExternalResult::Demarshall{{{1*/
-void StringExternalResult::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int stringsize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-
- this->value=(char*)xmalloc(stringsize*sizeof(char));
- memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
- memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
- memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION StringExternalResult::ObjectEnum{{{1*/
int StringExternalResult::ObjectEnum(void){
@@ -196,21 +123,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION StringExternalResult::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void StringExternalResult::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
-
- this->GetResultName(&name);
-
- mxSetField( dataref, this->step-1, name, mxCreateString(value));
- mxSetField( dataref, this->step-1, "time",mxCreateDoubleScalar((double)this->time));
- mxSetField( dataref, this->step-1, "step",mxCreateDoubleScalar((double)this->step));
-
-}
-#endif
-/*}}}*/
/*FUNCTION StringExternalResult::GetStep{{{1*/
int StringExternalResult::GetStep(void){
Modified: issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h
===================================================================
--- issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/ExternalResults/StringExternalResult.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,11 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
-
#include "./ExternalResult.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -47,11 +42,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -59,9 +49,6 @@
int InstanceEnum(){return enum_type;}
void WriteData(FILE* fid,bool io_gather);
void GetResultName(char**);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
int GetStep(void);
/*}}}*/
};
Modified: issm/trunk/src/c/objects/FemModel.cpp
===================================================================
--- issm/trunk/src/c/objects/FemModel.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/FemModel.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -21,7 +21,6 @@
/*Object constructors and destructor*/
/*FUNCTION FemModel::constructor {{{1*/
FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
-#ifdef _PARALLEL_
/*intermediary*/
int i;
@@ -75,8 +74,6 @@
/*Add output file name to parameters: */
this->parameters->AddObject(new StringParam(OutputfilenameEnum,outputfilename));
-#endif
-
}
/*}}}1*/
Modified: issm/trunk/src/c/objects/Hook.cpp
===================================================================
--- issm/trunk/src/c/objects/Hook.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Hook.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -117,93 +117,6 @@
}
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Hook::Marshall{{{1*/
-void Hook::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Hook: */
- enum_type=HookEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Hook data: */
- memcpy(marshalled_dataset,&num,sizeof(num));marshalled_dataset+=sizeof(num);
- for(i=0;i<num;i++){
- memcpy(marshalled_dataset,&this->ids[i],sizeof(int));marshalled_dataset+=sizeof(int);
- memcpy(marshalled_dataset,&this->offsets[i],sizeof(int));marshalled_dataset+=sizeof(int);
- }
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Hook::MarshallSize{{{1*/
-int Hook::MarshallSize(){
-
- return
- sizeof(num)+
- num*sizeof(int)+
- num*sizeof(int)+
- sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Hook::Demarshall{{{1*/
-void Hook::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int enum_type;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of object since Hook is not directly called by DataSet: */
- memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-
- memcpy(&num,marshalled_dataset,sizeof(num));marshalled_dataset+=sizeof(num);
-
- /*allocate: */
- if (num<0){
- _error_("cannot demarshall Hook as num<=0");
- }
- else if (num==0){
- this->ids=NULL;
- this->offsets=NULL;
- this->objects=NULL;
- }
- else{
-
- this->ids=(int*)xmalloc(num*sizeof(int));
- this->offsets=(int*)xmalloc(num*sizeof(int));
-
- /*demarshall allocated ids and offsets: */
- _assert_(num<1000);
- for (i=0;i<num;i++){
- memcpy(&this->ids[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- memcpy(&this->offsets[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- }
-
- /*nullify object pointers */
- this->objects=(Object**)xmalloc(num*sizeof(Object*));
- for (i=0;i<num;i++){
- this->objects[i]=NULL;
- }
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Hook::copy {{{1*/
Object* Hook::copy(void){
Modified: issm/trunk/src/c/objects/Hook.h
===================================================================
--- issm/trunk/src/c/objects/Hook.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Hook.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,11 +33,6 @@
/*Object like functionality:{{{1*/
void Echo(void);
void DeepEcho(void);
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
Object* copy(void);
/*}}}*/
/*Hook management: {{{1*/
Modified: issm/trunk/src/c/objects/Inputs/BoolInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/BoolInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/BoolInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -58,57 +58,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION BoolInput::Marshall{{{1*/
-void BoolInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of BoolInput: */
- enum_value=BoolInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall BoolInput data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolInput::MarshallSize{{{1*/
-int BoolInput::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION BoolInput::Demarshall{{{1*/
-void BoolInput::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION BoolInput::ObjectEnum{{{1*/
int BoolInput::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/BoolInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/BoolInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/BoolInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,11 +30,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/ControlInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/ControlInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/ControlInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -89,214 +89,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION ControlInput::Marshall{{{1*/
-void ControlInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int flag;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of ControlInput: */
- enum_value=ControlInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall enum_type: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&control_id,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
-
- /*marshal values*/
- if(!values){
- flag=0;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- }
- else{
- flag=1;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- this->values->Marshall(&marshalled_dataset);
- }
-
- /*marshal savedvalues*/
- if(!savedvalues){
- flag=0;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- }
- else{
- flag=1;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- this->savedvalues->Marshall(&marshalled_dataset);
- }
-
- /*marshal minvalues*/
- if(!minvalues){
- flag=0;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- }
- else{
- flag=1;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- this->minvalues->Marshall(&marshalled_dataset);
- }
-
- /*marshal maxvalues*/
- if(!maxvalues){
- flag=0;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- }
- else{
- flag=1;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- this->maxvalues->Marshall(&marshalled_dataset);
- }
-
- /*marshal gradient*/
- if(!gradient){
- flag=0;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- }
- else{
- flag=1;
- memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
- this->gradient->Marshall(&marshalled_dataset);
- }
-
- /*clean up and assign output pointer*/
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION ControlInput::MarshallSize{{{1*/
-int ControlInput::MarshallSize(){
-
- int size=0;
-
- size=sizeof(enum_type)+
- +sizeof(control_id)
- +5*sizeof(int) //5 flags
- +sizeof(int); //sizeof(int) for enum value
-
- if(values) size+=values->MarshallSize();
- if(savedvalues)size+=savedvalues->MarshallSize();
- if(minvalues)size+=minvalues->MarshallSize();
- if(maxvalues)size+=maxvalues->MarshallSize();
- if(gradient) size+=gradient->MarshallSize();
- return size;
-}
-/*}}}*/
-/*FUNCTION ControlInput::Demarshall{{{1*/
-void ControlInput::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int flag,input_enum_type;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&control_id,marshalled_dataset,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
-
- /*Demarshal values*/
- memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(flag){
- memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(input_enum_type==PentaP1InputEnum){
- values=new PentaP1Input();
- values->Demarshall(&marshalled_dataset);
- }
- else if(input_enum_type==TriaP1InputEnum){
- values=new TriaP1Input();
- values->Demarshall(&marshalled_dataset);
- }
- else _error_("Not supported yet");
- }
- else{
- values=NULL;
- }
-
- /*Demarshal savedvalues*/
- memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(flag){
- memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(input_enum_type==PentaP1InputEnum){
- savedvalues=new PentaP1Input();
- savedvalues->Demarshall(&marshalled_dataset);
- }
- else if(input_enum_type==TriaP1InputEnum){
- savedvalues=new TriaP1Input();
- savedvalues->Demarshall(&marshalled_dataset);
- }
- else _error_("Not supported yet");
- }
- else{
- savedvalues=NULL;
- }
-
- /*Demarshal minvalues*/
- memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(flag){
- memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(input_enum_type==PentaP1InputEnum){
- minvalues=new PentaP1Input();
- minvalues->Demarshall(&marshalled_dataset);
- }
- else if(input_enum_type==TriaP1InputEnum){
- minvalues=new TriaP1Input();
- minvalues->Demarshall(&marshalled_dataset);
- }
- else _error_("Not supported yet");
- }
- else{
- minvalues=NULL;
- }
-
- /*Demarshal maxvalues*/
- memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(flag){
- memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(input_enum_type==PentaP1InputEnum){
- maxvalues=new PentaP1Input();
- maxvalues->Demarshall(&marshalled_dataset);
- }
- else if(input_enum_type==TriaP1InputEnum){
- maxvalues=new TriaP1Input();
- maxvalues->Demarshall(&marshalled_dataset);
- }
- else _error_("Not supported yet");
- }
- else{
- maxvalues=NULL;
- }
-
- /*Demarshal gradient*/
- memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(flag){
- memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
- if(input_enum_type==PentaP1InputEnum){
- gradient=new PentaP1Input();
- gradient->Demarshall(&marshalled_dataset);
- }
- else if(input_enum_type==TriaP1InputEnum){
- gradient=new TriaP1Input();
- gradient->Demarshall(&marshalled_dataset);
- }
- else _error_("Not supported yet");
- }
- else{
- gradient=NULL;
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION ControlInput::ObjectEnum{{{1*/
int ControlInput::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/ControlInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/ControlInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/ControlInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,11 +34,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/DatasetInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/DatasetInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/DatasetInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -60,70 +60,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DatasetInput::Marshall{{{1*/
-void DatasetInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DatasetInput: */
- enum_value=DatasetInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall enum_type: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshal inputs*/
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*clean up and assign output pointer*/
- xfree((void**)&marshalled_inputs);
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DatasetInput::MarshallSize{{{1*/
-int DatasetInput::MarshallSize(){
-
- int size=0;
-
- size=sizeof(enum_type)+
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum value
-
- return size;
-}
-/*}}}*/
-/*FUNCTION DatasetInput::Demarshall{{{1*/
-void DatasetInput::Demarshall(char** pmarshalled_dataset){
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*Demarshal values*/
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DatasetInput::ObjectEnum{{{1*/
int DatasetInput::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/DatasetInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/DatasetInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/DatasetInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,11 +30,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/DoubleInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/DoubleInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -58,57 +58,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleInput::Marshall{{{1*/
-void DoubleInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleInput: */
- enum_value=DoubleInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleInput data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleInput::MarshallSize{{{1*/
-int DoubleInput::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleInput::Demarshall{{{1*/
-void DoubleInput::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleInput::ObjectEnum{{{1*/
int DoubleInput::ObjectEnum(void){
@@ -158,21 +107,13 @@
/*Object functions*/
/*FUNCTION DoubleInput::GetInputValue(bool* pvalue) {{{1*/
void DoubleInput::GetInputValue(bool* pvalue){
-#ifdef _SERIAL_
- *pvalue=(bool)value;
-#else
_error_("Double input of enum %s cannot return a boolean",EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleInput::GetInputValue(int* pvalue){{{1*/
void DoubleInput::GetInputValue(int* pvalue){
-#ifdef _SERIAL_
- *pvalue=(int)value;
-#else
_error_("Double input of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/DoubleInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/DoubleInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/DoubleInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/IntInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/IntInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/IntInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -53,57 +53,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION IntInput::Marshall{{{1*/
-void IntInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of IntInput: */
- enum_value=IntInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall IntInput data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntInput::MarshallSize{{{1*/
-int IntInput::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntInput::Demarshall{{{1*/
-void IntInput::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION IntInput::ObjectEnum{{{1*/
int IntInput::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/IntInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/IntInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/IntInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,11 +30,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -69,57 +69,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION PentaP1Input::Marshall{{{1*/
-void PentaP1Input::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of PentaP1Input: */
- enum_value=PentaP1InputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall PentaP1Input data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PentaP1Input::MarshallSize{{{1*/
-int PentaP1Input::MarshallSize(){
-
- return sizeof(values)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PentaP1Input::Demarshall{{{1*/
-void PentaP1Input::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION PentaP1Input::ObjectEnum{{{1*/
int PentaP1Input::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/PentaP1Input.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaP1Input.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/PentaP1Input.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,11 +30,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/TransientInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/TransientInput.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/TransientInput.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -84,79 +84,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION TransientInput::Marshall{{{*/
-void TransientInput::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of TransientInput: */
- enum_value=TransientInputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall TransientInput data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&numtimesteps,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
- memcpy(marshalled_dataset,timesteps,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
-
- /*marshal inputs*/
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*clean up and assign output pointer*/
- xfree((void**)&marshalled_inputs);
- *pmarshalled_dataset=marshalled_dataset;
-
-}
-/*}}}*
-/*FUNCTION TransientInput::MarshallSize{{{*/
-int TransientInput::MarshallSize(){
-
- return
- +sizeof(enum_type)+
- +sizeof(numtimesteps)+
- +inputs->MarshallSize()
- +numtimesteps*sizeof(double)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TransientInput::Demarshall{{{*/
-void TransientInput::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&numtimesteps,marshalled_dataset,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
-
- /*allocate: */
- timesteps=(double*)xmalloc(numtimesteps*sizeof(double));
- memcpy(timesteps,marshalled_dataset,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
-
- /*Demarshal values*/
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-
-}
-/*}}}*/
-#endif
/*FUNCTION TransientInput::ObjectEnum{{{*/
int TransientInput::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/TransientInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/TransientInput.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/TransientInput.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,11 +33,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -69,57 +69,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION TriaP1Input::Marshall{{{1*/
-void TriaP1Input::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of TriaP1Input: */
- enum_value=TriaP1InputEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall TriaP1Input data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaP1Input::MarshallSize{{{1*/
-int TriaP1Input::MarshallSize(){
-
- return sizeof(values)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaP1Input::Demarshall{{{1*/
-void TriaP1Input::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION TriaP1Input::ObjectEnum{{{1*/
int TriaP1Input::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Inputs/TriaP1Input.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaP1Input.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Inputs/TriaP1Input.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -30,11 +30,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/IoModel.cpp
===================================================================
--- issm/trunk/src/c/objects/IoModel.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/IoModel.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -44,6 +44,9 @@
/*First, keep track of the file handle: */
this->fid=iomodel_handle;
+ /*Check that Enums are Synchronized*/
+ this->CheckEnumSync();
+
/*Initialize and read constants:*/
this->constants=new Parameters();
this->FetchConstants(); /*this routine goes through the input file, and fetches bools, ints, doubles and strings only, nothing memory intensive*/
@@ -88,6 +91,49 @@
}
/*}}}*/
+/*FUNCTION IoModel::CheckEnumSync{{{1*/
+void IoModel::CheckEnumSync(void){
+
+ extern int my_rank;
+ int record_enum = 0;
+
+
+ /*Check that some fields have been allocated*/
+ _assert_(this->fid || my_rank);
+
+
+ /*Go find in the binary file, the position of the data we want to fetch: */
+ if(my_rank==0){ //cpu 0
+
+ /*First set FILE* position to the beginning of the file: */
+ fseek(this->fid,0,SEEK_SET);
+
+ /*Get first Enum*/
+ if(fread(&record_enum,sizeof(int),1,this->fid)==0){
+ _error_("Marshalled file is empty");
+ }
+ else{
+ if(record_enum!=MaximumNumberOfEnums){
+ printf("\n");
+ printf("=========================================================================\n");
+ printf(" Enums in marshalled file are not compatible with compiled code \n");
+ printf(" \n");
+ printf(" * If you are running ISSM on a remote cluster: \n");
+ printf(" make sure that you are using the same version of ISSM on your local \n");
+ printf(" machine and remote cluster (you might need to run svn update) \n");
+ printf(" * If you are running ISSM on your local machine: \n");
+ printf(" make sure that all the code is compiled (modules and executables) \n");
+ printf(" * If you are a developer and just added a new Enum: \n");
+ printf(" you might need to run ./Synchronize.sh in src/c/EnumDefinitions \n");
+ printf(" and recompile \n");
+ printf("=========================================================================\n");
+ printf("\n");
+ _error_("Enums not consistent (See error message above)");
+ }
+ }
+ }
+}
+/*}}}*/
/*FUNCTION IoModel::Constant(bool* poutput,int constant_enum){{{1*/
void IoModel::Constant(bool* poutput,int constant_enum){
@@ -197,7 +243,9 @@
/*Ok, we have reached the end of the file. break: */
record_code=0; //0 means bailout
+ #ifdef _HAVE_MPI_
MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); /*tell others cpus we are bailing: */
+ #endif
break;
}
else{
@@ -206,19 +254,22 @@
fread(&record_length,sizeof(int),1,this->fid);
fread(&record_code,sizeof(int),1,this->fid);
+ #ifdef _HAVE_MPI_
/*Tell other cpus what we are doing: */
MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); /*tell other cpus what we are going to do: */
/*Tell other cpus the name of the data, then branch according to the data type: */
MPI_Bcast(&record_enum,1,MPI_INT,0,MPI_COMM_WORLD);
MPI_Bcast(&record_length,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
-
switch(record_code){
case 1:
/*Read the boolean and broadcast it to other cpus:*/
if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_(" could not read boolean ");
+ #ifdef _HAVE_MPI_
MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*create BoolParam: */
this->constants->AddObject(new BoolParam(record_enum,(bool)booleanint)); //cast to boolean
@@ -227,7 +278,9 @@
case 2:
/*Read the integer and broadcast it to other cpus:*/
if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_(" could not read integer ");
+ #ifdef _HAVE_MPI_
MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*create IntParam: */
this->constants->AddObject(new IntParam(record_enum,integer));
@@ -236,7 +289,9 @@
case 3:
/*Read the scalar and broadcast it to other cpus:*/
if(fread(&scalar,sizeof(double),1,this->fid)!=1) _error_(" could not read scalar ");
+ #ifdef _HAVE_MPI_
MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
/*create DoubleParam: */
this->constants->AddObject(new DoubleParam(record_enum,scalar));
@@ -245,7 +300,9 @@
case 4:
/*We have to read a string from disk. First read the dimensions of the string, then the string: */
if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_(" could not read length of string ");
+ #ifdef _HAVE_MPI_
MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(string_size){
string=(char*)xmalloc((string_size+1)*sizeof(char));
@@ -253,7 +310,9 @@
/*Read string, then broadcast: */
if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string ");
+ #ifdef _HAVE_MPI_
MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
+ #endif
}
else{
string=(char*)xmalloc(sizeof(char));
@@ -307,6 +366,7 @@
}
}
} //}}}
+ #ifdef _HAVE_MPI_
else{ //cpu ~0 {{{2
for(;;){ //wait on cpu 0
MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD); /*get from cpu 0 what we are going to do: */
@@ -376,6 +436,7 @@
}
}
} //}}}
+ #endif
}
/*}}}*/
/*FUNCTION IoModel::FetchData(bool* pbool,int data_enum){{{1*/
@@ -398,7 +459,9 @@
if(my_rank==0){
if(fread(&booleanint,sizeof(int),1,fid)!=1) _error_(" could not read boolean ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&booleanint,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*cast to bool: */
/*Assign output pointers: */
@@ -427,7 +490,9 @@
if(fread(&integer,sizeof(int),1,fid)!=1) _error_(" could not read integer ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&integer,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Assign output pointers: */
*pinteger=integer;
@@ -455,7 +520,9 @@
if(my_rank==0){
if(fread(&scalar,sizeof(double),1,fid)!=1)_error_(" could not read scalar ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&scalar,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
/*Assign output pointers: */
*pscalar=scalar;
@@ -486,7 +553,9 @@
if(fread(&string_size,sizeof(int),1,fid)!=1) _error_(" could not read length of string ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Now allocate string: */
if(string_size){
@@ -497,7 +566,9 @@
if(my_rank==0){
if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
+ #endif
}
else{
string=(char*)xmalloc(sizeof(char));
@@ -537,12 +608,16 @@
if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(my_rank==0){
if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
}
- MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+ #ifdef _HAVE_MPI_
+ MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Now allocate matrix: */
if(M*N){
@@ -553,7 +628,9 @@
if(fread(matrix,M*N*sizeof(double),1,fid)!=1) _error_("could not read matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
}
/*Now cast to integer: */
@@ -601,12 +678,16 @@
if(my_rank==0){
if(fread(&M,sizeof(int),1,fid)!=1) _error_("could not read number of rows for matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(my_rank==0){
if(fread(&N,sizeof(int),1,fid)!=1) _error_("could not read number of columns for matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Now allocate matrix: */
if(M*N){
@@ -616,7 +697,9 @@
if(my_rank==0){
if(fread(matrix,M*N*sizeof(double),1,fid)!=1) _error_("could not read matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
}
/*Assign output pointers: */
@@ -651,7 +734,9 @@
if(my_rank==0){
if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_(" could not read length of string array");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&numstrings,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Now allocate string array: */
if(numstrings){
@@ -664,7 +749,9 @@
if(my_rank==0){
if(fread(&string_size,sizeof(int),1,fid)!=1) _error_(" could not read length of string ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&string_size,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(string_size){
string=(char*)xmalloc((string_size+1)*sizeof(char));
string[string_size]='\0';
@@ -673,7 +760,9 @@
if(my_rank==0){
if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(string,string_size,MPI_CHAR,0,MPI_COMM_WORLD);
+ #endif
}
else{
string=(char*)xmalloc(sizeof(char));
@@ -716,7 +805,9 @@
if(my_rank==0){
if(fread(&numrecords,sizeof(int),1,fid)!=1) _error_("could not read number of records in matrix array ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&numrecords,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(numrecords){
@@ -737,12 +828,16 @@
if(my_rank==0){
if(fread(&M,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of rows in ",i,"th matrix of matrix array");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&M,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
if(my_rank==0){
if(fread(&N,sizeof(int),1,fid)!=1) _error_("%s%i%s","could not read number of columns in ",i,"th matrix of matrix array");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&N,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Now allocate matrix: */
if(M*N){
@@ -753,7 +848,9 @@
if(fread(matrix,M*N*sizeof(double),1,fid)!=1) _error_("could not read matrix ");
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(matrix,M*N,MPI_DOUBLE,0,MPI_COMM_WORLD);
+ #endif
}
/*Assign: */
@@ -1046,13 +1143,17 @@
}
}
}
+ #ifdef _HAVE_MPI_
MPI_Bcast(&found,1,MPI_INT,0,MPI_COMM_WORLD);
if(!found)_error_("%s %s ","could not find data with name",EnumToStringx(data_enum));
+ #endif
/*Broadcast code and vector type: */
+ #ifdef _HAVE_MPI_
MPI_Bcast(&record_code,1,MPI_INT,0,MPI_COMM_WORLD);
MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD);
if(record_code==5) MPI_Bcast(&vector_type,1,MPI_INT,0,MPI_COMM_WORLD);
+ #endif
/*Assign output pointers:*/
*pcode=record_code;
Modified: issm/trunk/src/c/objects/IoModel.h
===================================================================
--- issm/trunk/src/c/objects/IoModel.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/IoModel.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -18,8 +18,8 @@
private:
FILE *fid; //pointer to input file
- double **data; //this dataset holds temporary data, memory intensive.
- Parameters *constants; //this dataset holds all double, int, bool and char *parameters read in from the input file.*
+ IssmDouble **data; //this dataset holds temporary data, memory intensive.
+ Parameters *constants; //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
public:
/*This data needs to stay memory resident at all time, even if it's memory intensive: */
@@ -40,25 +40,26 @@
IoModel(FILE* iomodel_handle);
/*Input/Output*/
- void Constant(bool *poutput,int constant_enum);
- void Constant(int *poutput,int constant_enum);
- void Constant(double *poutput,int constant_enum);
- void Constant(char **poutput,int constant_enum);
- Param *CopyConstantObject(int constant_enum);
- double *Data(int dataenum);
- void DeleteData(int num,...);
- void FetchConstants(void);
- void FetchData(bool* pboolean,int data_enum);
- void FetchData(int* pinteger,int data_enum);
- void FetchData(double* pscalar,int data_enum);
- void FetchData(char** pstring,int data_enum);
- void FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
- void FetchData(double** pscalarmatrix,int* pM,int* pN,int data_enum);
- void FetchData(char*** pstringarray,int* pnumstrings,int data_enum);
- void FetchData(double*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
- void FetchData(int num,...);
- void FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,double default_value=0);
- FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
+ void CheckEnumSync(void);
+ void Constant(bool *poutput,int constant_enum);
+ void Constant(int *poutput,int constant_enum);
+ void Constant(IssmDouble *poutput,int constant_enum);
+ void Constant(char **poutput,int constant_enum);
+ Param *CopyConstantObject(int constant_enum);
+ IssmDouble *Data(int dataenum);
+ void DeleteData(int num,...);
+ void FetchConstants(void);
+ void FetchData(bool* pboolean,int data_enum);
+ void FetchData(int* pinteger,int data_enum);
+ void FetchData(IssmDouble* pscalar,int data_enum);
+ void FetchData(char** pstring,int data_enum);
+ void FetchData(int** pmatrix,int* pM,int* pN,int data_enum);
+ void FetchData(IssmDouble** pscalarmatrix,int* pM,int* pN,int data_enum);
+ void FetchData(char*** pstringarray,int* pnumstrings,int data_enum);
+ void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum);
+ void FetchData(int num,...);
+ void FetchDataToInput(Elements* elements,int vector_enum,int default_vector_enum=NoneEnum,IssmDouble default_value=0);
+ FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);
};
#endif /* _IOMODEL_H */
Modified: issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Icefront.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Icefront.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -162,94 +162,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Icefront::Marshall {{{1*/
-void Icefront::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Icefront: */
- enum_type=IcefrontEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Icefront data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*Marshall hooks: */
- hnodes->Marshall(&marshalled_dataset);
- helement->Marshall(&marshalled_dataset);
- hmatpar->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION Icefront::MarshallSize {{{1*/
-int Icefront::MarshallSize(){
-
- return sizeof(id)
- +sizeof(analysis_type)
- +hnodes->MarshallSize()
- +helement->MarshallSize()
- +hmatpar->MarshallSize()
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Icefront::Demarshall {{{1*/
-void Icefront::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*demarshall hooks: */
- hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
- helement=new Hook(); helement->Demarshall(&marshalled_dataset);
- hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
-
- /*pointers are garbabe, until configuration is carried out: */
- nodes=NULL;
- element=NULL;
- matpar=NULL;
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Icefront::ObjectEnum{{{1*/
int Icefront::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Loads/Icefront.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Icefront.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Icefront.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -48,11 +48,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Loads/Numericalflux.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Numericalflux.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Numericalflux.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -188,89 +188,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Numericalflux::Marshall {{{1*/
-void Numericalflux::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Numericalflux: */
- enum_type=NumericalfluxEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Numericalflux data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*Marshall hooks: */
- hnodes->Marshall(&marshalled_dataset);
- helement->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Numericalflux::MarshallSize{{{1*/
-int Numericalflux::MarshallSize(){
-
- return sizeof(id)
- +sizeof(analysis_type)
- +hnodes->MarshallSize()
- +helement->MarshallSize()
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Numericalflux::Demarshall {{{1*/
-void Numericalflux::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*demarshall hooks: */
- hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
- helement=new Hook(); helement->Demarshall(&marshalled_dataset);
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
- this->element=NULL;
- this->nodes=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Numericalflux::ObjectEnum{{{1*/
int Numericalflux::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Loads/Numericalflux.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Numericalflux.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Numericalflux.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -44,11 +44,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Loads/Pengrid.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Pengrid.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Pengrid.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -131,100 +131,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION Pengrid::Marshall {{{1*/
-void Pengrid::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Tria: */
- enum_type=PengridEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Tria data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
- memcpy(marshalled_dataset,&zigzag_counter,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
-
- /*Marshall hooks: */
- hnode->Marshall(&marshalled_dataset);
- helement->Marshall(&marshalled_dataset);
- hmatpar->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Pengrid::MarshallSize {{{1*/
-int Pengrid::MarshallSize(){
-
- return sizeof(id)
- +sizeof(analysis_type)
- +sizeof(active)
- +sizeof(zigzag_counter)
- +hnode->MarshallSize()
- +helement->MarshallSize()
- +hmatpar->MarshallSize()
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Pengrid::Demarshall {{{1*/
-void Pengrid::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
- memcpy(&zigzag_counter,marshalled_dataset,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
-
- /*demarshall hooks: */
- hnode=new Hook(); hnode->Demarshall(&marshalled_dataset);
- helement=new Hook(); helement->Demarshall(&marshalled_dataset);
- hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
- this->node=NULL;
- this->element=NULL;
- this->matpar=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Pengrid::ObjectEnum{{{1*/
int Pengrid::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Loads/Pengrid.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Pengrid.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Pengrid.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -49,11 +49,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Loads/Penpair.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Penpair.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Penpair.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -84,69 +84,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION Penpair::Marshall {{{1*/
-void Penpair::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Penpair: */
- enum_type=PenpairEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Penpair data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*Marshall hooks*/
- hnodes->Marshall(&marshalled_dataset);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-/*FUNCTION Penpair::MarshallSize {{{1*/
-int Penpair::MarshallSize(){
-
- return sizeof(id)+
- +sizeof(analysis_type)
- +hnodes->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION Penpair::Demarshall {{{1*/
-void Penpair::Demarshall(char** pmarshalled_dataset){
-
- int i;
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
-
- /*demarshall hooks: */
- hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
-
- /*pointers are garbabe, until configuration is carried out: */
- nodes=NULL;
- parameters=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-#endif
/*FUNCTION Penpair::ObjectEnum{{{1*/
int Penpair::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Loads/Penpair.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Penpair.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Penpair.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -36,11 +36,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Riftfront.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Riftfront.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -191,125 +191,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION Riftfront::Marshall {{{1*/
-void Riftfront::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Riftfront: */
- enum_type=RiftfrontEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Riftfront data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
- memcpy(marshalled_dataset,&normal,sizeof(normal));marshalled_dataset+=sizeof(normal);
- memcpy(marshalled_dataset,&length,sizeof(length));marshalled_dataset+=sizeof(length);
- memcpy(marshalled_dataset,&fraction,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
- memcpy(marshalled_dataset,&frozen,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
- memcpy(marshalled_dataset,&state,sizeof(state));marshalled_dataset+=sizeof(state);
- memcpy(marshalled_dataset,&counter,sizeof(counter));marshalled_dataset+=sizeof(counter);
- memcpy(marshalled_dataset,&prestable,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
- memcpy(marshalled_dataset,&penalty_lock,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
- memcpy(marshalled_dataset,&material_converged,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
-
- /*Marshall hooks: */
- hnodes->Marshall(&marshalled_dataset);
- helements->Marshall(&marshalled_dataset);
- hmatpar->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
-
- xfree((void**)&marshalled_inputs);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Riftfront::MarshallSize {{{1*/
-int Riftfront::MarshallSize(){
-
- return sizeof(id)
- +sizeof(analysis_type)
- +sizeof(active)
- +sizeof(normal)
- +sizeof(length)
- +sizeof(fraction)
- +sizeof(frozen)
- +sizeof(state)
- +sizeof(counter)
- +sizeof(prestable)
- +sizeof(penalty_lock)
- +sizeof(material_converged)
- +hnodes->MarshallSize()
- +helements->MarshallSize()
- +hmatpar->MarshallSize()
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Riftfront::Demarshall {{{1*/
-void Riftfront::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
- memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
- memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
- memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
- memcpy(&frozen,marshalled_dataset,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
- memcpy(&state,marshalled_dataset,sizeof(state));marshalled_dataset+=sizeof(state);
- memcpy(&counter,marshalled_dataset,sizeof(counter));marshalled_dataset+=sizeof(counter);
- memcpy(&prestable,marshalled_dataset,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
- memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
- memcpy(&material_converged,marshalled_dataset,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
-
- /*demarshall hooks: */
- hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
- helements=new Hook(); helements->Demarshall(&marshalled_dataset);
- hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
-
- /*pointers are garbabe, until configuration is carried out: */
- nodes=NULL;
- elements=NULL;
- matpar=NULL;
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*parameters: may not exist even yet, so let Configure handle it: */
- this->parameters=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-#endif
/*FUNCTION Riftfront::ObjectEnum{{{1*/
int Riftfront::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Loads/Riftfront.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Riftfront.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Loads/Riftfront.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -56,11 +56,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- issm/trunk/src/c/objects/Materials/Matice.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Materials/Matice.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -87,76 +87,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Matice::Marshall {{{1*/
-void Matice::Marshall(char** pmarshalled_dataset){
-
- /*Intermediaries*/
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputs_size;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Matice: */
- enum_type=MaticeEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Matice data: */
- memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
-
- /*Marshall hooks: */
- helement->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputs_size=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
- marshalled_dataset+=marshalled_inputs_size;
-
- *pmarshalled_dataset=marshalled_dataset;
-
- /*clean up and return*/
- xfree((void**)&marshalled_inputs);
-}
-/*}}}*/
-/*FUNCTION Matice::MarshallSize{{{1*/
-int Matice::MarshallSize(){
-
- return sizeof(mid)
- +helement->MarshallSize()
- +inputs->MarshallSize()
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Matice::Demarshall {{{1*/
-void Matice::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
-
- /*demarshall hooks: */
- helement=new Hook(); helement->Demarshall(&marshalled_dataset);
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Matice::ObjectEnum{{{1*/
int Matice::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Materials/Matice.h
===================================================================
--- issm/trunk/src/c/objects/Materials/Matice.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Materials/Matice.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,11 +34,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Materials/Matpar.cpp
===================================================================
--- issm/trunk/src/c/objects/Materials/Matpar.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Materials/Matpar.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -89,94 +89,6 @@
return my_rank;
}
/*}}}1*/
-#ifdef _SERIAL_
-/*FUNCTION Matpar::Marshall {{{1*/
-void Matpar::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Matpar: */
- enum_type=MatparEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Matpar data: */
- memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
- memcpy(marshalled_dataset,&rho_ice,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
- memcpy(marshalled_dataset,&rho_water,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
- memcpy(marshalled_dataset,&rho_freshwater,sizeof(rho_freshwater));marshalled_dataset+=sizeof(rho_freshwater);
- memcpy(marshalled_dataset,&mu_water,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
- memcpy(marshalled_dataset,&heatcapacity,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
- memcpy(marshalled_dataset,&thermalconductivity,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
- memcpy(marshalled_dataset,&latentheat,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
- memcpy(marshalled_dataset,&beta,sizeof(beta));marshalled_dataset+=sizeof(beta);
- memcpy(marshalled_dataset,&meltingpoint,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
- memcpy(marshalled_dataset,&referencetemperature,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
- memcpy(marshalled_dataset,&mixed_layer_capacity,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
- memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
- memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-/*FUNCTION Matpar::MarshallSize {{{1*/
-int Matpar::MarshallSize(){
-
- return sizeof(mid)+
- sizeof(rho_ice)+
- sizeof(rho_water)+
- sizeof(rho_freshwater)+
- sizeof(mu_water)+
- sizeof(heatcapacity)+
- sizeof(thermalconductivity)+
- sizeof(latentheat)+
- sizeof(beta)+
- sizeof(meltingpoint)+
- sizeof(referencetemperature)+
- sizeof(mixed_layer_capacity)+
- sizeof(thermal_exchange_velocity)+
- sizeof(g)+
- sizeof(int); //sizeof(int) for enum type
-}
-/*}}}1*/
-/*FUNCTION Matpar::Demarshall {{{1*/
-void Matpar::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
- memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
- memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
- memcpy(&rho_freshwater,marshalled_dataset,sizeof(rho_freshwater));marshalled_dataset+=sizeof(rho_freshwater);
- memcpy(&mu_water,marshalled_dataset,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
- memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
- memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
- memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
- memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
- memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
- memcpy(&referencetemperature,marshalled_dataset,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
- memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
- memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
- memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}1*/
-#endif
/*FUNCTION Matpar::ObjectEnum{{{1*/
int Matpar::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Materials/Matpar.h
===================================================================
--- issm/trunk/src/c/objects/Materials/Matpar.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Materials/Matpar.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -46,11 +46,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Node.cpp
===================================================================
--- issm/trunk/src/c/objects/Node.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Node.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -192,89 +192,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Node::Marshall{{{1*/
-void Node::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
- char* marshalled_inputs=NULL;
- int marshalled_inputssize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Node: */
- enum_type=NodeEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Node data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(marshalled_dataset,&coord_system,9*sizeof(double));marshalled_dataset+=9*sizeof(double);
-
- /*marshall objects: */
- indexing.Marshall(&marshalled_dataset);
- hvertex->Marshall(&marshalled_dataset);
-
- /*Marshall inputs: */
- marshalled_inputssize=inputs->MarshallSize();
- marshalled_inputs=inputs->Marshall();
- memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputssize*sizeof(char));
- marshalled_dataset+=marshalled_inputssize;
-
- /*Free ressources:*/
- xfree((void**)&marshalled_inputs);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Node::MarshallSize{{{1*/
-int Node::MarshallSize(){
-
- return sizeof(id)+
- sizeof(sid)+
- indexing.MarshallSize()+
- hvertex->MarshallSize()+
- inputs->MarshallSize()+
- sizeof(analysis_type)+
- 9*sizeof(double)+
- sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Node::Demarshall{{{1*/
-void Node::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
- memcpy(&coord_system,marshalled_dataset,9*sizeof(double));marshalled_dataset+=9*sizeof(double);
-
- /*demarshall objects: */
- indexing.Demarshall(&marshalled_dataset);
- hvertex=new Hook(); hvertex->Demarshall(&marshalled_dataset);
-
- /*demarshall inputs: */
- inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Node::ObjectEnum{{{1*/
int Node::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Node.h
===================================================================
--- issm/trunk/src/c/objects/Node.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Node.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -31,7 +31,7 @@
Hook* hvertex;
Inputs* inputs; //properties of this node
int analysis_type;
- double coord_system[3][3];
+ IssmDouble coord_system[3][3];
/*Node constructors, destructors {{{1*/
Node();
@@ -43,27 +43,22 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy(){_error_("Not implemented yet (similar to Elements)");};
/*}}}*/
/*Update virtual functions definitions: {{{1*/
- void InputUpdateFromVector(double* vector, int name, int type);
+ void InputUpdateFromVector(IssmDouble* vector, int name, int type);
void InputUpdateFromVector(int* vector, int name, int type);
void InputUpdateFromVector(bool* vector, int name, int type);
- void InputUpdateFromMatrixDakota(double* matrix,int nrows, int ncols, int name, int type);
- void InputUpdateFromVectorDakota(double* vector, int name, int type);
+ void InputUpdateFromMatrixDakota(IssmDouble* matrix,int nrows, int ncols, int name, int type);
+ void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type);
void InputUpdateFromVectorDakota(int* vector, int name, int type);
void InputUpdateFromVectorDakota(bool* vector, int name, int type);
- void InputUpdateFromConstant(double constant, int name);
+ void InputUpdateFromConstant(IssmDouble constant, int name);
void InputUpdateFromConstant(int constant, int name);
void InputUpdateFromConstant(bool constant, int name);
- void InputUpdateFromSolution(double* solution){_error_("Not implemented yet!");}
+ void InputUpdateFromSolution(IssmDouble* solution){_error_("Not implemented yet!");}
void InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("Not implemented yet!");}
/*}}}*/
/*Node numerical routines {{{1*/
@@ -74,14 +69,14 @@
int GetVertexDof(void);
int GetVertexId(void);
#ifdef _HAVE_DIAGNOSTIC_
- void GetCoordinateSystem(double* coord_system_out);
+ void GetCoordinateSystem(IssmDouble* coord_system_out);
#endif
void SetVertexDof(int in_dof);
bool InAnalysis(int analysis_type);
int GetApproximation();
int GetNumberOfDofs(int approximation_enum,int setenum);
int IsClone();
- void ApplyConstraint(int dof,double value);
+ void ApplyConstraint(int dof,IssmDouble value);
void RelaxConstraint(int dof);
void DofInSSet(int dof);
void DofInFSet(int dof);
@@ -92,18 +87,18 @@
void GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
int GetDofList1(void);
int GetSidList(void);
- double GetX();
- double GetY();
- double GetZ();
- double GetSigma();
+ IssmDouble GetX();
+ IssmDouble GetY();
+ IssmDouble GetZ();
+ IssmDouble GetSigma();
int IsOnBed();
int IsOnSurface();
void FreezeDof(int dof);
int IsFloating();
int IsGrounded();
- void UpdateSpcs(double* ys);
- void VecMerge(Vector* ug, double* vector_serial,int setenum);
- void VecReduce(Vector* vector, double* ug_serial,int setnum);
+ void UpdateSpcs(IssmDouble* ys);
+ void VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum);
+ void VecReduce(Vector* vector, IssmDouble* ug_serial,int setnum);
/*}}}*/
/*Dof Object routines {{{1*/
Modified: issm/trunk/src/c/objects/Numerics/ElementVector.cpp
===================================================================
--- issm/trunk/src/c/objects/Numerics/ElementVector.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/ElementVector.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -165,6 +165,9 @@
int i;
double* localvalues=NULL;
+ /*In debugging mode, check consistency (no NaN, and values not too big)*/
+ this->CheckConsistency();
+
if(this->fsize){
/*first, retrieve values that are in the f-set from the g-set values vector: */
localvalues=(double*)xmalloc(this->fsize*sizeof(double));
@@ -201,6 +204,17 @@
}
/*}}}*/
+/*FUNCTION ElementVector::CheckConsistency{{{1*/
+void ElementVector::CheckConsistency(void){
+ /*Check element matrix values, only in debugging mode*/
+#ifdef _ISSM_DEBUG_
+ for (int i=0;i<this->nrows;i++){
+ if (isnan(this->values[i])) _error_("NaN found in Element Vector");
+ if (fabs( this->values[i])>1.e+50) _error_("Element Vector values exceeds 1.e+50");
+ }
+#endif
+}
+/*}}}*/
/*FUNCTION ElementVector::Echo{{{1*/
void ElementVector::Echo(void){
Modified: issm/trunk/src/c/objects/Numerics/ElementVector.h
===================================================================
--- issm/trunk/src/c/objects/Numerics/ElementVector.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/ElementVector.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -42,6 +42,7 @@
void AddToGlobal(Vector* pf);
void InsertIntoGlobal(Vector* pf);
void Echo(void);
+ void CheckConsistency(void);
void Init(ElementVector* pe);
void SetValue(double scalar);
/*}}}*/
Modified: issm/trunk/src/c/objects/Numerics/Matrix.cpp
===================================================================
--- issm/trunk/src/c/objects/Numerics/Matrix.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/Matrix.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -139,40 +139,6 @@
#endif
}
/*}}}*/
-
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-/*FUNCTION Matrix::ToMatlabMatrix{{{1*/
-mxArray* Matrix::ToMatlabMatrix(void){
-
- mxArray* dataref=NULL;
- #ifdef _HAVE_PETSC_
- PetscMatrixToMatlabMatrix(&dataref,this->matrix);
- #else
- dataref=this->matrix->ToMatlabMatrix();
- #endif
- return dataref;
-
-}
-/*}}}*/
-/*FUNCTION MatlabMatrixToMatrix{{{1*/
-Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix){
-
- int dummy;
- Matrix* matrix=NULL;
-
- /*allocate matrix object: */
- matrix=new Matrix();
-
- #ifdef _HAVE_PETSC_
- MatlabMatrixToPetscMatrix(&matrix->matrix,NULL,NULL,mxmatrix);
- #else
- matrix->matrix=MatlabMatrixToSeqMat(mxmatrix);
- #endif
-
- return matrix;
-}
-/*}}}*/
-#endif
/*FUNCTION Matrix::Assemble{{{1*/
void Matrix::Assemble(void){
#ifdef _HAVE_PETSC_
Modified: issm/trunk/src/c/objects/Numerics/Matrix.h
===================================================================
--- issm/trunk/src/c/objects/Numerics/Matrix.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/Matrix.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -20,9 +20,6 @@
#include "adolc.h"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
class Vector;
/*}}}*/
@@ -50,9 +47,6 @@
/*}}}*/
/*Matrix specific routines {{{1*/
void Echo(void);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxArray* ToMatlabMatrix(void);
- #endif
void Assemble(void);
double Norm(NormMode norm_type);
void GetSize(int* pM,int* pN);
@@ -65,9 +59,5 @@
/*}}}*/
};
-/*API: */
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-Matrix* MatlabMatrixToMatrix(const mxArray* mxmatrix);
-#endif
#endif //#ifndef _MATRIX_H_
Modified: issm/trunk/src/c/objects/Numerics/Vector.cpp
===================================================================
--- issm/trunk/src/c/objects/Numerics/Vector.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/Vector.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -84,7 +84,7 @@
}
/*}}}*/
#endif
-#ifdef _HAVE_GSL_
+#if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
/*FUNCTION Vector::Vector(SeqVec* seq_vec){{{1*/
Vector::Vector(SeqVec* seq_vec){
@@ -131,40 +131,6 @@
#endif
}
/*}}}*/
-
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-/*FUNCTION Vector::ToMatlabVector{{{1*/
-mxArray* Vector::ToMatlabVector(void){
-
- mxArray* dataref=NULL;
- #ifdef _HAVE_PETSC_
- PetscVectorToMatlabVector(&dataref,this->vector);
- #else
- dataref=this->vector->ToMatlabVector();
- #endif
- return dataref;
-
-}
-/*}}}*/
-/*FUNCTION MatlabVectorToVector{{{1*/
-Vector* MatlabVectorToVector(const mxArray* mxvector){
-
- int dummy;
- Vector* vector=NULL;
-
- /*allocate vector object: */
- vector=new Vector();
-
- #ifdef _HAVE_PETSC_
- MatlabVectorToPetscVector(&vector->vector,&dummy,mxvector);
- #else
- vector->vector=MatlabVectorToSeqVec(mxvector);
- #endif
-
- return vector;
-}
-/*}}}*/
-#endif
/*FUNCTION Vector::Assemble{{{1*/
void Vector::Assemble(void){
Modified: issm/trunk/src/c/objects/Numerics/Vector.h
===================================================================
--- issm/trunk/src/c/objects/Numerics/Vector.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Numerics/Vector.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -20,10 +20,6 @@
#include "adolc.h"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
-
/*}}}*/
class Vector{
@@ -46,16 +42,13 @@
#ifdef _HAVE_PETSC_
Vector(Vec petsc_vec);
#endif
- #ifdef _HAVE_GSL_
+ #if defined(_HAVE_GSL_) && !defined(_HAVE_PETSC_)
Vector(SeqVec* seq_vec);
#endif
~Vector();
/*}}}*/
/*Vector specific routines {{{1*/
void Echo(void);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxArray* ToMatlabVector(void);
- #endif
void AXPY(Vector *X, double a);
void AYPX(Vector *X, double a);
void Assemble(void);
@@ -76,9 +69,5 @@
/*}}}*/
};
-/*API: */
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-Vector* MatlabVectorToVector(const mxArray* mxvector);
-#endif
#endif //#ifndef _VECTOR_H_
Modified: issm/trunk/src/c/objects/Object.h
===================================================================
--- issm/trunk/src/c/objects/Object.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Object.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -20,11 +20,6 @@
virtual void DeepEcho()=0;
virtual int Id()=0;
virtual int MyRank()=0;
- #ifdef _SERIAL_
- virtual void Marshall(char** pmarshalled_dataset)=0;
- virtual int MarshallSize()=0;
- virtual void Demarshall(char** pmarshalled_dataset)=0;
- #endif
virtual int ObjectEnum()=0;
virtual Object* copy()=0;
Modified: issm/trunk/src/c/objects/OptArgs.h
===================================================================
--- issm/trunk/src/c/objects/OptArgs.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/OptArgs.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,20 +5,9 @@
#ifndef _OPTARGS_H_
#define _OPTARGS_H_
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-
-#include "mex.h"
-struct OptArgs{
- char* function_name;
- mxArray* femmodel;
-};
-
-#else
-
class Model;
struct OptArgs{
FemModel* femmodel;
};
-#endif
#endif
Modified: issm/trunk/src/c/objects/OptPars.h
===================================================================
--- issm/trunk/src/c/objects/OptPars.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/OptPars.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -7,9 +7,9 @@
struct OptPars{
- double xmin;
- double xmax;
- double cm_jump;
+ IssmDouble xmin;
+ IssmDouble xmax;
+ IssmDouble cm_jump;
int maxiter;
};
Modified: issm/trunk/src/c/objects/Options/Option.h
===================================================================
--- issm/trunk/src/c/objects/Options/Option.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/Option.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -32,11 +32,6 @@
virtual void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -46,6 +41,7 @@
virtual int NumEl()=0;
virtual int NDims()=0;
virtual int* Size()=0;
+ virtual void Get(int* pvalue)=0;
virtual void Get(double* pvalue)=0;
virtual void Get(bool* pvalue)=0;
virtual void Get(char** pvalue)=0;
Modified: issm/trunk/src/c/objects/Options/OptionCell.h
===================================================================
--- issm/trunk/src/c/objects/Options/OptionCell.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionCell.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionCellEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -43,6 +38,7 @@
int NumEl();
int NDims();
int* Size();
+ void Get(int* pvalue){_error_("An OptionCell object cannot return a int");};
void Get(double* pvalue){_error_("An OptionCell object cannot return a double");};
void Get(bool* pvalue){ _error_("An OptionCell object cannot return a bool");};
void Get(char** pvalue){ _error_("An OptionCell object cannot return a string");};
Modified: issm/trunk/src/c/objects/Options/OptionChar.h
===================================================================
--- issm/trunk/src/c/objects/Options/OptionChar.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionChar.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionCharEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -43,6 +38,7 @@
int NumEl();
int NDims();
int* Size();
+ void Get(int* pvalue){_error_("An OptionChar object cannot return a int");};
void Get(double* pvalue){_error_("An OptionChar object cannot return a double");};
void Get(bool* pvalue){ _error_("An OptionChar object cannot return a bool");};
void Get(char** pvalue);
Modified: issm/trunk/src/c/objects/Options/OptionDouble.cpp
===================================================================
--- issm/trunk/src/c/objects/Options/OptionDouble.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionDouble.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -119,6 +119,18 @@
return(Option::Size());
}
/*}}}*/
+/*FUNCTION OptionDouble::Get(int* pvalue) {{{1*/
+void OptionDouble::Get(int* pvalue){
+
+ /*We should first check that the size is one*/
+ if(this->NumEl()!=1){
+ _error_("option \"%s\" has %i elements and cannot return a single int",this->name,this->NumEl());
+ }
+
+ /*Assign output pointer*/
+ *pvalue=(int)this->values[0];
+}
+/*}}}*/
/*FUNCTION OptionDouble::Get(double* pvalue) {{{1*/
void OptionDouble::Get(double* pvalue){
Modified: issm/trunk/src/c/objects/Options/OptionDouble.h
===================================================================
--- issm/trunk/src/c/objects/Options/OptionDouble.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionDouble.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionDoubleEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -43,6 +38,7 @@
int NumEl();
int NDims();
int* Size();
+ void Get(int* pvalue);
void Get(double* pvalue);
void Get(bool* pvalue){ _error_("An OptionDouble object cannot return a bool");};
void Get(char** pvalue){ _error_("An OptionDouble object cannot return a string");};
Modified: issm/trunk/src/c/objects/Options/OptionLogical.h
===================================================================
--- issm/trunk/src/c/objects/Options/OptionLogical.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionLogical.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionLogicalEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -43,6 +38,7 @@
int NumEl();
int NDims();
int* Size();
+ void Get(int* pvalue){_error_("An OptionLogical object cannot return a int");};
void Get(double* pvalue){_error_("An OptionLogical object cannot return a double");};
void Get(bool* pvalue);
void Get(char** pvalue){ _error_("An OptionLogical object cannot return a string");};
Modified: issm/trunk/src/c/objects/Options/OptionStruct.h
===================================================================
--- issm/trunk/src/c/objects/Options/OptionStruct.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Options/OptionStruct.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -29,11 +29,6 @@
void DeepEcho(char* indent);
int Id(){_error_("Not implemented yet");};
int MyRank(){_error_("Not implemented yet");};
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- int MarshallSize(){_error_("Not implemented yet");};
- void Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
- #endif
int ObjectEnum(){return OptionStructEnum;};
Object* copy(){_error_("Not implemented yet");};
/*}}}*/
@@ -43,6 +38,7 @@
int NumEl();
int NDims();
int* Size();
+ void Get(int* pvalue){_error_("An OptionStruct object cannot return a int");};
void Get(double* pvalue){_error_("An OptionStruct object cannot return a double");};
void Get(bool* pvalue){ _error_("An OptionStruct object cannot return a bool");};
void Get(char** pvalue){ _error_("An OptionStruct object cannot return a string");};
Modified: issm/trunk/src/c/objects/Params/BoolParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/BoolParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/BoolParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -61,57 +61,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION BoolParam::Marshall{{{1*/
-void BoolParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of BoolParam: */
- enum_value=BoolParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall BoolParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION BoolParam::MarshallSize{{{1*/
-int BoolParam::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION BoolParam::Demarshall{{{1*/
-void BoolParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION BoolParam::ObjectEnum{{{1*/
int BoolParam::ObjectEnum(void){
@@ -133,15 +82,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION BoolParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void BoolParam::SetMatlabField(mxArray* dataref){
- char* name=NULL;
- this->GetParameterName(&name);
- mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
-}
-#endif
-/*}}}*/
/*FUNCTION BoolParam::UnitConversion{{{1*/
void BoolParam::UnitConversion(int direction_enum){
/*do nothing, no unit conversion*/
Modified: issm/trunk/src/c/objects/Params/BoolParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/BoolParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/BoolParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -40,11 +36,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -80,9 +71,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
#endif /* _BOOLPARAM_H */
Modified: issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleMatArrayParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -126,113 +126,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleMatArrayParam::Marshall{{{1*/
-void DoubleMatArrayParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleMatArrayParam: */
- enum_value=DoubleMatArrayParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleMatArrayParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M){
- memcpy(marshalled_dataset,mdim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
- memcpy(marshalled_dataset,ndim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
- for(i=0;i<M;i++){
- double* matrix=this->array[i];
- int m=this->mdim_array[i];
- int n=this->ndim_array[i];
- memcpy(marshalled_dataset,&m,sizeof(m));marshalled_dataset+=sizeof(m);
- memcpy(marshalled_dataset,&n,sizeof(n));marshalled_dataset+=sizeof(n);
- if(m*n)memcpy(marshalled_dataset,matrix,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
- }
- }
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleMatArrayParam::MarshallSize{{{1*/
-int DoubleMatArrayParam::MarshallSize(){
-
- int size=0;
- int i;
-
- size+=sizeof(enum_type)+
- sizeof(M)+
- M*sizeof(int)+
- M*sizeof(int);
-
- for(i=0;i<M;i++){
- int m=this->mdim_array[i];
- int n=this->ndim_array[i];
- size+=sizeof(m)+sizeof(n)+m*n*sizeof(double);
- }
- size+=sizeof(int); //sizeof(int) for enum value
-
- return size;
-}
-/*}}}*/
-/*FUNCTION DoubleMatArrayParam::Demarshall{{{1*/
-void DoubleMatArrayParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- double* matrix=NULL;
- int m,n;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum value, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- /*data: */
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M){
- this->mdim_array=(int*)xmalloc(M*sizeof(int));
- this->ndim_array=(int*)xmalloc(M*sizeof(int));
- memcpy(this->mdim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
- memcpy(this->ndim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
-
- this->array=(double**)xmalloc(M*sizeof(double*));
- for(i=0;i<M;i++){
- memcpy(&m,marshalled_dataset,sizeof(m));marshalled_dataset+=sizeof(m);
- memcpy(&n,marshalled_dataset,sizeof(n));marshalled_dataset+=sizeof(n);
- if(m*n){
- matrix=(double*)xmalloc(m*n*sizeof(double));
- memcpy(matrix,marshalled_dataset,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
- }
- else{
- matrix=NULL;
- }
- this->array[i]=matrix;
- }
- }
- else{
- this->array=NULL;
- this->mdim_array=NULL;
- this->ndim_array=NULL;
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{1*/
int DoubleMatArrayParam::ObjectEnum(void){
@@ -307,46 +200,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION StringArrayParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleMatArrayParam::SetMatlabField(mxArray* dataref){
-
- int i,m,n;
- double* matrix=NULL;
- double* outmatrix=NULL;
- char* name=NULL;
- mwSize dims[2]={0};
- mxArray* pfield=NULL;
- mxArray* pfield2=NULL;
- mxArray* pfield3=NULL;
-
- this->GetParameterName(&name);
- dims[0]=this->M;
- dims[1]=1;
- pfield=mxCreateCellArray(2,dims);
-
- for(i=0;i<this->M;i++){
- matrix=this->array[i];
- m=this->mdim_array[i];
- n=this->ndim_array[i];
- outmatrix=(double*)xmalloc(m*n*sizeof(double));
- memcpy(outmatrix,matrix,m*n*sizeof(double));
-
- pfield2=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield2,n);
- mxSetN(pfield2,m);
- mxSetPr(pfield2,outmatrix);
-
- //transpose the outmatrix, written directly to matlab! from C to matlab.
- mexCallMATLAB(1,&pfield3, 1, &pfield2, "transpose");
-
- mxSetCell(pfield,i,pfield3);
- }
-
- mxSetField( dataref, 0, name,pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleMatArrayParam::SetValue(double** array, int M, int* mdim_array, int* ndim_array){{{1*/
void DoubleMatArrayParam::SetValue(double** in_array, int in_M, int* in_mdim_array, int* in_ndim_array){
Modified: issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -43,11 +39,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -83,9 +74,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleMatParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -77,66 +77,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleMatParam::Marshall{{{1*/
-void DoubleMatParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleMatParam: */
- enum_value=DoubleMatParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleMatParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
- memcpy(marshalled_dataset,value,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleMatParam::MarshallSize{{{1*/
-int DoubleMatParam::MarshallSize(){
-
- return sizeof(M)
- +sizeof(N)
- +M*N*sizeof(double)
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleMatParam::Demarshall{{{1*/
-void DoubleMatParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
- value=(double*)xmalloc(M*N*sizeof(double));
- memcpy(value,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleMatParam::ObjectEnum{{{1*/
int DoubleMatParam::ObjectEnum(void){
@@ -168,20 +108,7 @@
/*}}}*/
/*FUNCTION DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{1*/
void DoubleMatParam::GetParameterValue(int** pintarray,int* pM,int* pN){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- int* output=NULL;
- int i;
-
- output=(int*)xmalloc((int)(M*N*sizeof(int)));
- for(i=0;i<M*N;i++) output[i]=(int)value[i];
-
- /*Assign output pointers:*/
- if(pM) *pM=M;
- if(pN) *pN=N;
- *pintarray=output;
-#else
_error_("DoubleMat of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleMatParam::GetParameterName{{{1*/
@@ -189,29 +116,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION DoubleMatParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleMatParam::SetMatlabField(mxArray* dataref){
-
- mxArray* pfield=NULL;
- mxArray* pfield2=NULL;
- double* doublemat=NULL;
- char* name=NULL;
-
- this->GetParameterName(&name);
- this->GetParameterValue(&doublemat,NULL,NULL);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,N);
- mxSetN(pfield,M);
- mxSetPr(pfield,doublemat);
-
- //transpose the matrix, written directly to matlab! from C to matlab.
- mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
- mxSetField( dataref, 0, name,pfield2);
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleMatParam::SetValue{{{1*/
void DoubleMatParam::SetValue(double* doublearray,int in_M,int in_N){
Modified: issm/trunk/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleMatParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -42,11 +38,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -83,9 +74,6 @@
double* GetPointer(void);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/DoubleParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -58,57 +58,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleParam::Marshall{{{1*/
-void DoubleParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleParam: */
- enum_value=DoubleParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleParam::MarshallSize{{{1*/
-int DoubleParam::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleParam::Demarshall{{{1*/
-void DoubleParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleParam::ObjectEnum{{{1*/
int DoubleParam::ObjectEnum(void){
@@ -132,102 +81,34 @@
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(int* pinteger){{{1*/
void DoubleParam::GetParameterValue(int* pinteger){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- *pinteger=(int)value;
-#else
_error_("Double param of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(bool* pbool){{{1*/
void DoubleParam::GetParameterValue(bool* pbool){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-
- /*If debugging mode, cheeck that the double is 0 or 1*/
- _assert_(value==0 || value==1);
- *pbool=(bool)value;
-
-#else
_error_("Double param of enum %i (%s) cannot return an bool",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM){{{1*/
void DoubleParam::GetParameterValue(int** pintarray,int* pM){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- int* output=NULL;
-
- output=(int*)xmalloc(1*sizeof(int));
- *output=(int)value;
-
- /*Assign output pointers:*/
- if(pM) *pM=1;
- *pintarray=output;
-#else
_error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){{{1*/
void DoubleParam::GetParameterValue(int** pintarray,int* pM,int* pN){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- int* output=NULL;
-
- output=(int*)xmalloc(1*sizeof(int));
- *output=(int)value;
-
- /*Assign output pointers:*/
- if(pM) *pM=1;
- if(pN) *pN=1;
- *pintarray=output;
-#else
_error_("Double param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(double** pdoublearray,int* pM){{{1*/
void DoubleParam::GetParameterValue(double** pdoublearray,int* pM){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- double* output=NULL;
-
- output=(double*)xmalloc(1*sizeof(double));
- *output=(double)value;
-
- /*Assign output podoubleers:*/
- if(pM) *pM=1;
- *pdoublearray=output;
-#else
_error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){{{1*/
void DoubleParam::GetParameterValue(double** pdoublearray,int* pM,int* pN){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- double* output=NULL;
-
- output=(double*)xmalloc(1*sizeof(double));
- *output=(double)value;
-
- /*Assign output podoubleers:*/
- if(pM) *pM=1;
- if(pN) *pN=1;
- *pdoublearray=output;
-#else
_error_("Double param of enum %i (%s) cannot return an array of double",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
-/*FUNCTION DoubleParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleParam::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- this->GetParameterName(&name);
- mxSetField( dataref, 0, name,mxCreateDoubleScalar(value));
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleParam::UnitConversion{{{1*/
void DoubleParam::UnitConversion(int direction_enum){
::UnitConversion(&this->value,1,direction_enum,this->enum_type);
Modified: issm/trunk/src/c/objects/Params/DoubleParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/DoubleTransientMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleTransientMatParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleTransientMatParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
Modified: issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleVecParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleVecParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -74,63 +74,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION DoubleVecParam::Marshall{{{1*/
-void DoubleVecParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of DoubleVecParam: */
- enum_value=DoubleVecParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall DoubleVecParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION DoubleVecParam::MarshallSize{{{1*/
-int DoubleVecParam::MarshallSize(){
-
- return sizeof(M)
- +M*sizeof(double)
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION DoubleVecParam::Demarshall{{{1*/
-void DoubleVecParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- values=(double*)xmalloc(M*sizeof(double));
- memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION DoubleVecParam::ObjectEnum{{{1*/
int DoubleVecParam::ObjectEnum(void){
@@ -180,20 +123,7 @@
/*}}}*/
/*FUNCTION DoubleVecParam::GetParameterValue(int** pintarray,int* pM){{{1*/
void DoubleVecParam::GetParameterValue(int** pintarray,int* pM){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- int* output=NULL;
- int i;
-
- /*Cast values into integers*/
- output=(int*)xmalloc(M*sizeof(int));
- for(i=0;i<M;i++) output[i]=(int)values[i];
-
- /*Assign output pointers:*/
- if(pM) *pM=M;
- *pintarray=output;
-#else
_error_("DoubleVec param of enum %i (%s) cannot return an array of int",enum_type,EnumToStringx(enum_type));
-#endif
}
/*}}}*/
/*FUNCTION DoubleVecParam::GetParameterName{{{1*/
@@ -201,26 +131,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION DoubleVecParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void DoubleVecParam::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- double* doublevec=NULL;
- mxArray* pfield=NULL;
-
- this->GetParameterValue(&doublevec,NULL);
- this->GetParameterName(&name);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,1);
- mxSetPr(pfield,doublevec);
-
- mxSetField( dataref, 0, name, pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION DoubleVecParam::SetValue{{{1*/
void DoubleVecParam::SetValue(double* doublearray,int in_M){
Modified: issm/trunk/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleVecParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/DoubleVecParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
#endif /* _DOUBLEVECPARAM_H */
Modified: issm/trunk/src/c/objects/Params/FileParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/FileParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/FileParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -61,24 +61,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION FileParam::Marshall{{{1*/
-void FileParam::Marshall(char** pmarshalled_dataset){
-
- _error_("FileParam is a pointer and cannot be marshalled");
-}
-/*}}}*/
-/*FUNCTION FileParam::MarshallSize{{{1*/
-int FileParam::MarshallSize(){
- _error_("FileParam is a pointer and cannot be marshalled");
-}
-/*}}}*/
-/*FUNCTION FileParam::Demarshall{{{1*/
-void FileParam::Demarshall(char** pmarshalled_dataset){
- _error_("FileParam is a pointer and cannot be marshalled");
-}
-/*}}}*/
-#endif
/*FUNCTION FileParam::ObjectEnum{{{1*/
int FileParam::ObjectEnum(void){
@@ -100,14 +82,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION FileParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void FileParam::SetMatlabField(mxArray* dataref){
-
- _error_("FileParam is a pointer and cannot be converted into a matlab object");
-}
-#endif
-/*}}}*/
/*FUNCTION FileParam::UnitConversion{{{1*/
void FileParam::UnitConversion(int direction_enum){
/*do nothing, no unit conversion*/
Modified: issm/trunk/src/c/objects/Params/FileParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/FileParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/FileParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -40,11 +36,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -80,9 +71,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/IntMatParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/IntMatParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntMatParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -77,66 +77,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION IntMatParam::Marshall{{{1*/
-void IntMatParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of IntMatParam: */
- enum_value=IntMatParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall IntMatParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
- memcpy(marshalled_dataset,value,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntMatParam::MarshallSize{{{1*/
-int IntMatParam::MarshallSize(){
-
- return sizeof(M)
- +sizeof(N)
- +M*N*sizeof(int)
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntMatParam::Demarshall{{{1*/
-void IntMatParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
- value=(int*)xmalloc(M*N*sizeof(int));
- memcpy(value,marshalled_dataset,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION IntMatParam::ObjectEnum{{{1*/
int IntMatParam::ObjectEnum(void){
@@ -171,35 +111,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION IntMatParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void IntMatParam::SetMatlabField(mxArray* dataref){
-
- char *name = NULL;
- double *doublearray = NULL;
- int *intarray = NULL;
- mxArray *pfield = NULL;
- mxArray *pfield2 = NULL;
-
- this->GetParameterValue(&intarray,NULL,NULL);
- this->GetParameterName(&name);
-
- /*cast intarray into doublearray for Matlab*/
- doublearray=(double*)xmalloc(M*N*sizeof(double));
- for(int i=0;i<M*N;i++)doublearray[i]=(double)intarray[i];
- xfree((void**)&intarray);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,N);
- mxSetPr(pfield,doublearray);
-
- //transpose the matrix, written directly to matlab! from C to matlab.
- mexCallMATLAB(1,&pfield2, 1, &pfield, "transpose");
- mxSetField( dataref, 0, name,pfield2);
-}
-#endif
-/*}}}*/
/*FUNCTION IntMatParam::SetValue{{{1*/
void IntMatParam::SetValue(int* intarray,int in_M,int in_N){
Modified: issm/trunk/src/c/objects/Params/IntMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/IntMatParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntMatParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -42,11 +38,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -82,9 +73,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/IntParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/IntParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -61,57 +61,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION IntParam::Marshall{{{1*/
-void IntParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of IntParam: */
- enum_value=IntParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall IntParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntParam::MarshallSize{{{1*/
-int IntParam::MarshallSize(){
-
- return sizeof(value)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntParam::Demarshall{{{1*/
-void IntParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION IntParam::ObjectEnum{{{1*/
int IntParam::ObjectEnum(void){
@@ -133,16 +82,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION IntParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void IntParam::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- this->GetParameterName(&name);
- mxSetField( dataref, 0, name,mxCreateDoubleScalar((double)value));
-}
-#endif
-/*}}}*/
/*FUNCTION IntParam::UnitConversion{{{1*/
void IntParam::UnitConversion(int direction_enum){
/*do nothing, no unit conversion*/
Modified: issm/trunk/src/c/objects/Params/IntParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/IntParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/IntVecParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/IntVecParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntVecParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -90,65 +90,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION IntVecParam::Marshall{{{1*/
-void IntVecParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of IntVecParam: */
- enum_value=IntVecParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall IntVecParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M)memcpy(marshalled_dataset,values,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION IntVecParam::MarshallSize{{{1*/
-int IntVecParam::MarshallSize(){
-
- return sizeof(M)+
- +M*sizeof(int)
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION IntVecParam::Demarshall{{{1*/
-void IntVecParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M) {
- values=(int*)xmalloc(M*sizeof(int));
- memcpy(values,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
- }
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION IntVecParam::ObjectEnum{{{1*/
int IntVecParam::ObjectEnum(void){
@@ -184,35 +125,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION IntVecParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void IntVecParam::SetMatlabField(mxArray* dataref){
-
- char *name = NULL;
- double *doublevec = NULL;
- int *intvec = NULL;
- mxArray *pfield = NULL;
-
- this->GetParameterValue(&intvec,NULL);
- this->GetParameterName(&name);
-
- /*cast intvec into doublevec for Matlab*/
- if(M){
- doublevec=(double*)xmalloc(M*sizeof(double));
- for(int i=0;i<M;i++)doublevec[i]=(double)intvec[i];
- }
- else doublevec=NULL;
- xfree((void**)&intvec);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,1);
- mxSetPr(pfield,doublevec);
-
- mxSetField(dataref, 0, name, pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION IntVecParam::SetValue{{{1*/
void IntVecParam::SetValue(int* intarray,int in_M){
Modified: issm/trunk/src/c/objects/Params/IntVecParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/IntVecParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/IntVecParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -42,11 +38,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -82,9 +73,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
#endif
Modified: issm/trunk/src/c/objects/Params/MatrixParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/MatrixParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/MatrixParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -69,95 +69,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION MatrixParam::Marshall{{{1*/
-void MatrixParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int M,N;
- double* serial_mat=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of MatrixParam: */
- enum_value=MatrixParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall MatrixParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- if(value){
- value->GetSize(&M,&N);
- serial_mat=value->ToSerial();
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
- memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
- }
- else{
- M=0;
- N=0;
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
- }
-
- /*Free ressources:*/
- xfree((void**)&serial_mat);
-
- /*return:*/
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION MatrixParam::MarshallSize{{{1*/
-int MatrixParam::MarshallSize(){
-
- int M=0;
- int N=0;
- if(value)value->GetSize(&M,&N);
-
- return sizeof(M)+
- sizeof(N)+
- M*N*sizeof(double)+
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION MatrixParam::Demarshall{{{1*/
-void MatrixParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int M,N;
- double* serial_mat=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
- if(M!=0 && N!=0){
- serial_mat=(double*)xmalloc(M*N*sizeof(double));
- memcpy(serial_mat,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
- value=new Matrix(serial_mat,M,N,.001);
- }
- else{
- value=NULL;
- }
-
- /*Free ressources:*/
- xfree((void**)&serial_mat);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-#endif
/*FUNCTION MatrixParam::ObjectEnum{{{1*/
int MatrixParam::ObjectEnum(void){
@@ -189,27 +100,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION MatrixParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void MatrixParam::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
- int M,N;
- double* doublemat=NULL;
- mxArray* pfield=NULL;
-
- doublemat=value->ToSerial();
- value->GetSize(&M,&N);
- this->GetParameterName(&name);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,N);
- mxSetPr(pfield,doublemat);
- mxSetField( dataref, 0, name, pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION MatrixParam::SetValue{{{1*/
void MatrixParam::SetValue(Matrix* matrix){
Modified: issm/trunk/src/c/objects/Params/MatrixParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/MatrixParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/MatrixParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/Param.h
===================================================================
--- issm/trunk/src/c/objects/Params/Param.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/Param.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,10 +15,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "../Object.h"
#include "../Node.h"
/*}}}*/
@@ -59,8 +55,5 @@
virtual void SetValue(double** array, int M, int* mdim_array, int* ndim_array)=0;
virtual void UnitConversion(int direction_enum)=0;
virtual void GetParameterName(char**pname)=0;
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- virtual void SetMatlabField(mxArray* dataref)=0;
- #endif
};
#endif
Modified: issm/trunk/src/c/objects/Params/StringArrayParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/StringArrayParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/StringArrayParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -91,98 +91,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION StringArrayParam::Marshall{{{1*/
-void StringArrayParam::Marshall(char** pmarshalled_dataset){
-
- int i;
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int stringsize;
- char* string=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of StringArrayParam: */
- enum_value=StringArrayParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- memcpy(marshalled_dataset,&numstrings,sizeof(numstrings));marshalled_dataset+=sizeof(numstrings);
- for(i=0;i<numstrings;i++){
- string=this->value[i];
- stringsize=strlen(string)+1;
-
- memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
- memcpy(marshalled_dataset,string,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
- }
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION StringArrayParam::MarshallSize{{{1*/
-int StringArrayParam::MarshallSize(){
-
- int i;
- int marshallsize=0;
- int stringsize;
- char* string=NULL;
-
- marshallsize+=sizeof(numstrings);
-
- for(i=0;i<numstrings;i++){
- string=this->value[i];
- stringsize=strlen(string)+1;
- marshallsize+=sizeof(stringsize);
- marshallsize+=stringsize*sizeof(char);
- }
-
- marshallsize+=sizeof(enum_type);
- marshallsize+=sizeof(int); //sizeof(int) for enum value
-
- return marshallsize;
-}
-/*}}}*/
-/*FUNCTION StringArrayParam::Demarshall{{{1*/
-void StringArrayParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int stringsize;
- char* string=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- memcpy(&numstrings,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
- if(numstrings){
- this->value=(char**)xmalloc(numstrings*sizeof(char*));
-
- for(i=0;i<numstrings;i++){
- memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-
- string=(char*)xmalloc(stringsize*sizeof(char));
- memcpy(string,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-
- this->value[i]=string;
- }
- }
- else this->value=NULL;
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION StringArrayParam::ObjectEnum{{{1*/
int StringArrayParam::ObjectEnum(void){
@@ -235,28 +143,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION StringArrayParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void StringArrayParam::SetMatlabField(mxArray* dataref){
-
- int i;
- char* name=NULL;
- mwSize dims[2]={0};
- mxArray* pfield=NULL;
-
- this->GetParameterName(&name);
-
- dims[0]=this->numstrings;
- dims[1]=1;
- pfield=mxCreateCellArray(2,dims);
- for(i=0;i<this->numstrings;i++){
- char* string=value[i];
- mxSetCell(pfield,i,mxCreateString(string));
- }
- mxSetField( dataref, 0, name,pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION StringArrayParam::SetValue{{{1*/
void StringArrayParam::SetValue(char** stringarray,int M){
Modified: issm/trunk/src/c/objects/Params/StringArrayParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/StringArrayParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/StringArrayParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -43,11 +39,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -83,9 +74,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
#endif /* _STRINGARRAYPARAM_H */
Modified: issm/trunk/src/c/objects/Params/StringParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/StringParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/StringParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -63,70 +63,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION StringParam::Marshall{{{1*/
-void StringParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int stringsize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of StringParam: */
- enum_value=StringParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- stringsize=strlen(this->value)+1;
-
- memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
- memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION StringParam::MarshallSize{{{1*/
-int StringParam::MarshallSize(){
-
- int stringsize;
- stringsize=strlen(this->value)+1;
-
- return sizeof(int)+
- stringsize*sizeof(char)+
- sizeof(enum_type)+
- sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION StringParam::Demarshall{{{1*/
-void StringParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- int stringsize;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
-
- this->value=(char*)xmalloc(stringsize*sizeof(char));
- memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION StringParam::ObjectEnum{{{1*/
int StringParam::ObjectEnum(void){
@@ -163,17 +99,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION StringParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void StringParam::SetMatlabField(mxArray* dataref){
-
- char* name=NULL;
-
- this->GetParameterName(&name);
- mxSetField( dataref, 0, name, mxCreateString(value));
-}
-#endif
-/*}}}*/
/*FUNCTION StringParam::SetValue{{{1*/
void StringParam::SetValue(char* string){
Modified: issm/trunk/src/c/objects/Params/StringParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/StringParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/StringParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Params/VectorParam.cpp
===================================================================
--- issm/trunk/src/c/objects/Params/VectorParam.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/VectorParam.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -71,90 +71,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION VectorParam::Marshall{{{1*/
-void VectorParam::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_value=0;
- int M;
- double* serial_value=NULL;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum value of VectorParam: */
- enum_value=VectorParamEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-
- /*marshall VectorParam data: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
- if(value){
- value->GetSize(&M);
- serial_value=value->ToMPISerial();
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
- }
- else{
- M=0;
- memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
- }
- /*Free ressources:*/
- xfree((void**)&serial_value);
-
- /*return:*/
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION VectorParam::MarshallSize{{{1*/
-int VectorParam::MarshallSize(){
-
- int M=0;
- if(value)value->GetSize(&M);
-
- return sizeof(M)+M*sizeof(double)
- +sizeof(enum_type)+
- +sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION VectorParam::Demarshall{{{1*/
-void VectorParam::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
- double* serial_vec=NULL;
- int M;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
- memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*data: */
-
- memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
- if(M){
- serial_vec=(double*)xmalloc(M*sizeof(double));
- memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
-
- value=new Vector(serial_vec,M);
- }
- else{
- value=NULL;
- }
-
- /*Free ressources:*/
- xfree((void**)&serial_vec);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-#endif
/*FUNCTION VectorParam::ObjectEnum{{{1*/
int VectorParam::ObjectEnum(void){
@@ -187,28 +103,6 @@
EnumToStringx(pname,this->enum_type);
}
/*}}}*/
-/*FUNCTION VectorParam::SetMatlabField{{{1*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-void VectorParam::SetMatlabField(mxArray* dataref){
-
- mxArray* pfield=NULL;
- char* name=NULL;
- double* doublevec=NULL;
- int M;
-
- doublevec=value->ToMPISerial();
- value->GetSize(&M);
- this->GetParameterName(&name);
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,M);
- mxSetN(pfield,1);
- mxSetPr(pfield,doublevec);
-
- mxSetField( dataref, 0, name, pfield);
-}
-#endif
-/*}}}*/
/*FUNCTION VectorParam::SetValue{{{1*/
void VectorParam::SetValue(Vector* vector){
Modified: issm/trunk/src/c/objects/Params/VectorParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/VectorParam.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Params/VectorParam.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,10 +14,6 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
-
#include "./Param.h"
#include "../../include/include.h"
#include "../../shared/shared.h"
@@ -41,11 +37,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -81,9 +72,6 @@
void UnitConversion(int direction_enum);
void GetParameterName(char**pname);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- void SetMatlabField(mxArray* dataref);
- #endif
/*}}}*/
};
Modified: issm/trunk/src/c/objects/Patch.cpp
===================================================================
--- issm/trunk/src/c/objects/Patch.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Patch.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -119,15 +119,17 @@
int total_numrows;
int node_numrows;
double *total_values = NULL;
+ #ifdef _HAVE_MPI_
MPI_Status status;
+ #endif
- #ifdef _SERIAL_
- return; //nothing to be done
- #endif
-
/*First, figure out total number of rows combining all the cpus: */
+ #ifdef _HAVE_MPI_
MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
MPI_Bcast(&total_numrows,1,MPI_INT,0,MPI_COMM_WORLD);
+ #else
+ total_numrows=this->numrows;
+ #endif
/*return if patch empty*/
if(total_numrows==0) return;
@@ -143,6 +145,7 @@
}
/*Now, ask other nodes to send their values: */
+ #ifdef _HAVE_MPI_
for (i=1;i<num_procs;i++){
if (my_rank==i){
MPI_Send(&this->numrows,1,MPI_INT,0,1,MPI_COMM_WORLD);
@@ -154,6 +157,7 @@
count+=node_numrows*this->numcols;
}
}
+ #endif
/*Now, node 0 has total_values, of size total_numrows*this->numcols. Update the fields in the patch, to reflect this new
* reality. For other cpus, no point in keeping their data anymore: */
@@ -162,8 +166,10 @@
xfree((void**)&this->values);
this->values=total_values;
}
+ #ifdef _HAVE_MPI_
else{
this->numrows=0;
xfree((void**)&this->values);
}
+ #endif
}/*}}}*/
Modified: issm/trunk/src/c/objects/Patch.h
===================================================================
--- issm/trunk/src/c/objects/Patch.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Patch.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -33,13 +33,13 @@
int maxvertices; //maxvertices corresponds to largest amount of vertices on a given element, determined by the geometry.
int maxnodes; // maxnodes corresponds to the largest amout of nodes on a given element, determined by the interpolation type.
- double* values; //result values
+ IssmDouble* values; //result values
Patch();
Patch(int numrows, int maxvertices, int maxnodes);
~Patch();
void fillelementinfo(int row, int element_id, int* vertices_ids, int num_vertices);
- void fillresultinfo(int row,int enum_type,int step, double time, int interpolation, double* nodal_values, int num_nodes);
+ void fillresultinfo(int row,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes);
void Gather(void);
};
Modified: issm/trunk/src/c/objects/Segment.cpp
===================================================================
--- issm/trunk/src/c/objects/Segment.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Segment.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -70,24 +70,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Segment::Marshall{{{1*/
-void Segment::Marshall(char** pmarshalled_dataset){
-
- _error_(" not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Segment::MarshallSize{{{1*/
-int Segment::MarshallSize(){
- _error_(" not supported yet!");
-}
-/*}}}*/
-/*FUNCTION Segment::Demarshall{{{1*/
-void Segment::Demarshall(char** pmarshalled_dataset){
- _error_(" not supported yet!");
-}
-/*}}}*/
-#endif
/*FUNCTION Segment::ObjectEnum{{{1*/
int Segment::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Segment.h
===================================================================
--- issm/trunk/src/c/objects/Segment.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Segment.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,14 +14,14 @@
public:
int eid;
- double x1;
- double y1;
- double x2;
- double y2;
+ IssmDouble x1;
+ IssmDouble y1;
+ IssmDouble x2;
+ IssmDouble y2;
/*Segment constructors, destructors {{{1*/
Segment();
- Segment(int eid,double x1,double y1, double x2, double y2);
+ Segment(int eid,IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2);
~Segment();
/*}}}*/
/*Object virtual functions definitions:{{{1 */
@@ -29,11 +29,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
Modified: issm/trunk/src/c/objects/Update.h
===================================================================
--- issm/trunk/src/c/objects/Update.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Update.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -14,19 +14,19 @@
public:
- virtual void InputUpdateFromVector(double* vector, int name, int type)=0;
+ virtual void InputUpdateFromVector(IssmDouble* vector, int name, int type)=0;
virtual void InputUpdateFromVector(int* vector, int name, int type)=0;
virtual void InputUpdateFromVector(bool* vector, int name, int type)=0;
#ifdef _HAVE_DAKOTA_
- virtual void InputUpdateFromMatrixDakota(double* matrix, int rows, int ncols, int name, int type)=0;
- virtual void InputUpdateFromVectorDakota(double* vector, int name, int type)=0;
+ virtual void InputUpdateFromMatrixDakota(IssmDouble* matrix, int rows, int ncols, int name, int type)=0;
+ virtual void InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type)=0;
virtual void InputUpdateFromVectorDakota(int* vector, int name, int type)=0;
virtual void InputUpdateFromVectorDakota(bool* vector, int name, int type)=0;
#endif
- virtual void InputUpdateFromConstant(double constant, int name)=0;
+ virtual void InputUpdateFromConstant(IssmDouble constant, int name)=0;
virtual void InputUpdateFromConstant(int constant, int name)=0;
virtual void InputUpdateFromConstant(bool constant, int name)=0;
- virtual void InputUpdateFromSolution(double* solution)=0;
+ virtual void InputUpdateFromSolution(IssmDouble* solution)=0;
virtual void InputUpdateFromIoModel(int index, IoModel* iomodel)=0;
};
Modified: issm/trunk/src/c/objects/Vertex.cpp
===================================================================
--- issm/trunk/src/c/objects/Vertex.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Vertex.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -91,80 +91,6 @@
return my_rank;
}
/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION Vertex::Marshall {{{1*/
-void Vertex::Marshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int enum_type=0;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*get enum type of Vertex: */
- enum_type=VertexEnum;
-
- /*marshall enum: */
- memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-
- /*marshall Vertex data: */
- memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);
- memcpy(marshalled_dataset,&y,sizeof(y));marshalled_dataset+=sizeof(y);
- memcpy(marshalled_dataset,&z,sizeof(z));marshalled_dataset+=sizeof(z);
- memcpy(marshalled_dataset,&sigma,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
- memcpy(marshalled_dataset,&connectivity,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
- memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
-
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-/*FUNCTION Vertex::MarshallSize {{{1*/
-int Vertex::MarshallSize(){
-
- return sizeof(id)+
- sizeof(sid)+
- sizeof(x)+
- sizeof(y)+
- sizeof(z)+
- sizeof(sigma)+
- sizeof(connectivity)+
- sizeof(dof)+
- sizeof(clone)+
- +sizeof(int); //sizeof(int) for enum type
-}
-/*}}}*/
-/*FUNCTION Vertex::Demarshall {{{1*/
-void Vertex::Demarshall(char** pmarshalled_dataset){
-
- char* marshalled_dataset=NULL;
- int i;
-
- /*recover marshalled_dataset: */
- marshalled_dataset=*pmarshalled_dataset;
-
- /*this time, no need to get enum type, the pointer directly points to the beginning of the
- *object data (thanks to DataSet::Demarshall):*/
-
- memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
- memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
- memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
- memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
- memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z);
- memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
- memcpy(&connectivity,marshalled_dataset,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
- memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
- memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
-
- /*return: */
- *pmarshalled_dataset=marshalled_dataset;
- return;
-}
-/*}}}*/
-#endif
/*FUNCTION Vertex::ObjectEnum{{{1*/
int Vertex::ObjectEnum(void){
Modified: issm/trunk/src/c/objects/Vertex.h
===================================================================
--- issm/trunk/src/c/objects/Vertex.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/Vertex.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -24,10 +24,10 @@
int id;
int sid; //sid for "serial" id, ie the rank of this vertex in the vertices dataset, if the dataset was serial on 1 cpu.
- double x;
- double y;
- double z;
- double sigma; //sigma coordinate: (z-bed)/thickness
+ IssmDouble x;
+ IssmDouble y;
+ IssmDouble z;
+ IssmDouble sigma; //sigma coordinate: (z-bed)/thickness
int connectivity; //number of vertices connected to this vertex
/*dof management: */
@@ -36,8 +36,8 @@
/*Vertex constructors, destructors {{{1*/
Vertex();
- Vertex(int id, int sid,double x, double y, double z, double sigma, int connectivity);
- void Init(int id, int sid, double x, double y, double z, double sigma,int connectivity);
+ Vertex(int id, int sid,IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma, int connectivity);
+ void Init(int id, int sid, IssmDouble x, IssmDouble y, IssmDouble z, IssmDouble sigma,int connectivity);
Vertex(int id, int sid, int i, IoModel* iomodel);
~Vertex();
/*}}}*/
@@ -46,11 +46,6 @@
void DeepEcho();
int Id();
int MyRank();
- #ifdef _SERIAL_
- void Marshall(char** pmarshalled_dataset);
- int MarshallSize();
- void Demarshall(char** pmarshalled_dataset);
- #endif
int ObjectEnum();
Object* copy();
/*}}}*/
@@ -64,7 +59,7 @@
/*Vertex management: {{{1*/
int Sid(void);
int Connectivity(void);
- void UpdatePosition(Vector* vz,Parameters* parameters,double* thickness,double* bed);
+ void UpdatePosition(Vector* vz,Parameters* parameters,IssmDouble* thickness,IssmDouble* bed);
/*}}}*/
};
#endif /* _VERTEX_H */
Modified: issm/trunk/src/c/objects/objects.h
===================================================================
--- issm/trunk/src/c/objects/objects.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/objects/objects.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -169,7 +169,16 @@
#include "./Bamg/CrackedEdge.h"
#include "./Bamg/Mesh.h"
#include "./Bamg/Geometry.h"
-#include "./Bamg/QuadTree.h"
+#include "./Bamg/BamgQuadtree.h"
#include "./Bamg/SetOfE4.h"
+/*Kriging*/
+#include "./Kriging/Variogram.h"
+#include "./Kriging/GaussianVariogram.h"
+#include "./Kriging/ExponentialVariogram.h"
+#include "./Kriging/SphericalVariogram.h"
+#include "./Kriging/PowerVariogram.h"
+#include "./Kriging/Quadtree.h"
+#include "./Kriging/Observation.h"
+
#endif
Modified: issm/trunk/src/c/shared/Alloc/alloc.cpp
===================================================================
--- issm/trunk/src/c/shared/Alloc/alloc.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Alloc/alloc.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -18,10 +18,6 @@
#error "Cannot compile without HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_SERIAL_) && defined(_HAVE_MATLAB_)
-#include "mex.h"
-#endif
-
#include <stdio.h>
#include <stdlib.h>
@@ -36,13 +32,8 @@
if(!size)_error_(" attempting to 0 size allocation!");
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- /* Use the matlab api to do the allocation: */
- memptr=mxMalloc(size);
- #else
/* Use the c library to do the allocation: */
memptr=malloc(size);
- #endif
if(!memptr) _error_("memory allocation failed!");
return memptr;
@@ -54,13 +45,8 @@
if(!size)_error_("attempting to 0 size allocation!");
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- /* Use the matlab api to do the allocation: */
- memptr=mxCalloc(n,size);
- #else
/* Use the c library to do the allocation: */
memptr=calloc(n,size);
- #endif
if(!memptr) _error_("memory allocation failed!");
return memptr;
@@ -69,11 +55,7 @@
void xfree(void* *pv){
if (pv && *pv){
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxFree(*pv);
- #else
- free(*pv);
- #endif
+ free(*pv);
*pv=NULL;
}
@@ -82,18 +64,10 @@
void xdelete(Matrix** pv){
if (pv && *pv){
- #ifdef _PARALLEL_
/*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we
* don't actually free memory in Matlab, we let the memory manager do that. We only
* free in parallel: */
delete *pv;
- #else
- /*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++
- * correctly: */
- #ifdef _HAVE_PETSC_
- MatFree(&(*pv)->matrix);
- #endif
- #endif
*pv=NULL;
}
}
@@ -101,18 +75,10 @@
void xdelete(Vector** pv){
if (pv && *pv){
- #ifdef _PARALLEL_
/*There is no mxDelete in the Matlab API -> using delete trips up Matlab. So we
* don't actually free memory in Matlab, we let the memory manager do that. We only
* free in parallel: */
delete *pv;
- #else
- /*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++
- * correctly: */
- #ifdef _HAVE_PETSC_
- VecFree(&(*pv)->vector);
- #endif
- #endif
*pv=NULL;
}
}
@@ -123,12 +89,7 @@
register void* value=NULL;
if(!size)_error_("attempting to realloc to zero");
-
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- value = (void*)mxRealloc(pv,size);
- #else
value = (void*)realloc(pv,size);
- #endif
if (value == NULL) {
_error_("virtual memory exhausted");
Modified: issm/trunk/src/c/shared/Elements/elements.h
===================================================================
--- issm/trunk/src/c/shared/Elements/elements.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Elements/elements.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -46,5 +46,16 @@
}
printf("\n");
}
+inline void printbinary(int n) {
+ unsigned int i=1L<<(sizeof(n)*8-1);
+ while (i>0) {
+ if (n&i)
+ printf("1");
+ else
+ printf("0");
+ i>>=1;
+ }
+}
+
#endif //ifndef _SHARED_ELEMENTS_H_
Modified: issm/trunk/src/c/shared/Exceptions/Exceptions.cpp
===================================================================
--- issm/trunk/src/c/shared/Exceptions/Exceptions.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Exceptions/Exceptions.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,9 +10,6 @@
#include "../shared.h"
#include "../../include/include.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
ErrorException::ErrorException(const string &what_arg){
@@ -31,6 +28,10 @@
}
ErrorException::~ErrorException() throw(){
+ extern int num_procs;
+ /*We want the report only for matlab modules, otherwise we get twice the report
+ * We assume that if num_procs==1, it is a module (FIXME)*/
+ if(num_procs==1) this->Report();
}
const char* ErrorException::what() const throw(){
@@ -39,18 +40,20 @@
void ErrorException::Report(){
extern int my_rank;
+ extern int num_procs;
if (function_name=="" || file_line==0){ //WINDOWS
printf("%s%s","Error message: ",what());
}
else{
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mexErrMsgTxt(exprintf("\n??? Error using ==> %s at %i\n%s error message: %s\n",
- file_name.c_str(),file_line,function_name.c_str(),what()));
- #else
+ if(num_procs==1){
+ printf("\n??? Error using ==> %s:%i\n",file_name.c_str(),file_line);
+ printf("%s error message: %s\n\n",function_name.c_str(),what());
+ }
+ else{
printf("\n[%i] ??? Error using ==> %s:%i\n",my_rank,file_name.c_str(),file_line);
printf("[%i] %s error message: %s\n\n",my_rank,function_name.c_str(),what());
- #endif
+ }
}
return;
}
Modified: issm/trunk/src/c/shared/Exceptions/exceptions.h
===================================================================
--- issm/trunk/src/c/shared/Exceptions/exceptions.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Exceptions/exceptions.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -22,13 +22,10 @@
int file_line;
public:
-
ErrorException(const string &what_arg); //for windows
ErrorException(string what_file,string what_function,int what_line,string what_arg);//UNIX
~ErrorException() throw();
-
virtual const char *what() const throw();
-
void Report();
};
Modified: issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -12,8 +12,7 @@
#include "../Exceptions/exceptions.h"
#include "../../Container/DataSet.h"
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole=true){
-
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
/*indexing: */
int i,counter;
@@ -101,9 +100,6 @@
cl=false;
if((x[0]==x[n-1]) && (y[0]==y[n-1])){
cl=true;
- if (!whole) {
- n=n-1;
- }
}
/*Assign pointers: */
@@ -125,31 +121,31 @@
else xfree((void**)&closed);
}
-DataSet* DomainOutlineRead(char* domainname,bool whole=true){
+DataSet* DomainOutlineRead(char* domainname){
- /*indexing: */
- int i;
-
/*intermediary: */
- int nprof;
- int* profnvertices=NULL;
- double** pprofx=NULL;
- double** pprofy=NULL;
+ int nprof;
+ int *profnvertices = NULL;
+ double **pprofx = NULL;
+ double **pprofy = NULL;
+ Contour *contour = NULL;
- Contour* contour=NULL;
-
/*output: */
DataSet* domain=NULL;
- /*get domain outline from intermediary function:*/
- DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname,whole);
+ /*If domainname is an empty string, return empty dataset*/
+ if (strcmp(domainname,"")==0){
+ nprof=0;
+ }
+ else{
+ DomainOutlineRead(&nprof,&profnvertices,&pprofx, &pprofy, NULL,domainname);
+ }
/*now create dataset of contours: */
domain=new DataSet(0);
- for(i=0;i<nprof;i++){
+ for(int i=0;i<nprof;i++){
domain->AddObject(new Contour(i,profnvertices[i],pprofx[i],pprofy[i],1));
}
-
return domain;
}
Modified: issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp
===================================================================
--- issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Exp/DomainOutlineWrite.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,7 +10,7 @@
#include "../../include/include.h"
#include "../Exceptions/exceptions.h"
-int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole=true){
+int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname){
/*Error management: */
@@ -20,13 +20,6 @@
/*I/O: */
FILE* fid=NULL;
- /*input: */
-// int nprof; //number of profiles in the domainname file
-// int* profnvertices=NULL; //array holding the number of vertices for the nprof profiles
-// double** pprofx=NULL; //array of profiles x coordinates
-// double** pprofy=NULL; //array of profiles y coordinates
-// bool* closed=NULL; //array holding closed flags for the nprof profiles
-
/*open domain outline file for writing: */
if ((fid=fopen(domainname,"w"))==NULL){
_error_("%s%s","could not open domain file ",domainname);
@@ -42,10 +35,7 @@
fprintf(fid,"%s %s %s %s\n","#","Points","Count","Value");
/*Write number of profile vertices: */
- if(closed[counter] && !whole)
- fprintf(fid,"%u %s\n",profnvertices[counter]+1,"1.");
- else
- fprintf(fid,"%u %s\n",profnvertices[counter] ,"1.");
+ fprintf(fid,"%u %s\n",profnvertices[counter] ,"1.");
/*Write next line: */
fprintf(fid,"%s %s %s %s %s\n","#","X","pos","Y","pos");
@@ -55,10 +45,6 @@
fprintf(fid,"%lf\t%lf\n",pprofx[counter][i],pprofy[counter][i]);
}
- /*Now check that we are dealing with open contours: */
- if(closed[counter] && !whole)
- fprintf(fid,"%lf\t%lf\n",pprofx[counter][0],pprofy[counter][0]);
-
/*Write blank line: */
if(counter < nprof-1) fprintf(fid,"\n");
}
Modified: issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- issm/trunk/src/c/shared/Exp/exp.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Exp/exp.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -12,11 +12,11 @@
int IsInPoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
int IsOutsidePoly(Vector* in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
-int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname,bool whole);
+int DomainOutlineWrite(int nprof,int* profnvertices,double** pprofx,double** pprofy,bool* closed,char* domainname);
int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
-DataSet* DomainOutlineRead(char* domainname,bool whole);
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
+DataSet* DomainOutlineRead(char* domainname);
#endif
Modified: issm/trunk/src/c/shared/Numerics/OptionsFromAnalysis.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/OptionsFromAnalysis.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Numerics/OptionsFromAnalysis.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -8,6 +8,8 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
+#include <cstring>
+
#include "../../objects/objects.h"
#include "../../Container/Parameters.h"
#include "../../EnumDefinitions/EnumDefinitions.h"
@@ -29,13 +31,7 @@
numanalyses=0;
parameters->FindParam(&strings,&numanalyses,PetscOptionsStringsEnum);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_) //do not take this away, because ISSM loads analyses as a Double Param instead of a DoubleVec Param when running with only 1 analysis
- if(numanalyses==1){ analyses=(double*)xmalloc(1*sizeof(double)); parameters->FindParam(analyses,PetscOptionsAnalysesEnum);
- }
- else parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
- #else
parameters->FindParam(&analyses,&dummy,PetscOptionsAnalysesEnum);
- #endif
if(numanalyses==0)return NULL; //we did not find petsc options, don't bother.
Modified: issm/trunk/src/c/shared/Numerics/Synchronize.sh
===================================================================
--- issm/trunk/src/c/shared/Numerics/Synchronize.sh 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Numerics/Synchronize.sh 2012-06-02 00:26:03 UTC (rev 12330)
@@ -1,7 +1,7 @@
#!/bin/bash
#Synchronize Verbosity
#first remove existing files
-rm $ISSM_TIER/src/m/shared/Verb*.m
+rm $ISSM_DIR/src/m/shared/Verb*.m
echo "Synchronizing Verbosity levels..."
@@ -28,9 +28,6 @@
#include "./Verbosity.h"
#include "../../include/macros.h"
#include "../Exceptions/exceptions.h"
-#ifdef _SERIAL_
-#include <mex.h>
-#endif
/*}}}*/
/*Verbosityt levels*/
@@ -53,7 +50,7 @@
echo "$FILENAME -> 2^$POWER = $BINARY"
#Add Verbosity Matlab file{{{
- cat <<END > $ISSM_TIER"/src/m/shared/"$(echo $FILENAME".m")
+ cat <<END > $ISSM_DIR"/src/m/shared/"$(echo $FILENAME".m")
function bool=$(echo $FILENAME)()
%$(echo $FILENAME | awk {'print toupper($1)'}) - Return true if $(echo $LEVELNAME | awk {'print tolower($1)'}) level is activated
%
@@ -139,44 +136,18 @@
if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
-#ifdef _SERIAL_
-
- mxArray* output=NULL;
- mxArray* input=NULL;
- input=mxCreateDoubleScalar((double)level);
-
- mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
-#else
-
verbositylevel = level;
-#endif
}/*}}}*/
/*FUNCTION GetVerbosityLevel {{{*/
int GetVerbosityLevel(void){
-#ifdef _SERIAL_
-
- mxArray* output=NULL;
- mxArray* input=NULL;
- double level;
-
- mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
- level=mxGetScalar(output);
-
- verbositylevel = (int)level;
- return verbositylevel;
-
-#else
-
_assert_(verbositylevel>=0);
return verbositylevel;
-
-#endif
}/*}}}*/
END
#}}}
#Complete verbose.m {{{1
-VERBOSEPATH="$ISSM_TIER/src/m/classes/verbose.m"
+VERBOSEPATH="$ISSM_DIR/src/m/classes/verbose.m"
cat $VERBOSEPATH | sed "/%BEGINFIELDS/,$ d" > temp_begin
cat $VERBOSEPATH | sed "1,/%ENDFIELDS/d" > temp_end
cat temp_begin FIELDS temp_end > $VERBOSEPATH
Modified: issm/trunk/src/c/shared/Numerics/Verbosity.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/Verbosity.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Numerics/Verbosity.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -17,9 +17,6 @@
#include "./Verbosity.h"
#include "../../include/macros.h"
#include "../Exceptions/exceptions.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include <mex.h>
-#endif
/*}}}*/
/*Verbosityt levels*/
@@ -38,37 +35,13 @@
if(level<0) _error_("vebosity level should be a positive integer (user provided %i)",level);
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-
- mxArray* output=NULL;
- mxArray* input=NULL;
- input=mxCreateDoubleScalar((double)level);
-
- mexCallMATLAB(0,&output,1,&input,"SetVerbosityLevel");
-#else
-
verbositylevel = level;
-#endif
}/*}}}*/
/*FUNCTION GetVerbosityLevel {{{*/
int GetVerbosityLevel(void){
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxArray* output=NULL;
- mxArray* input=NULL;
- double level;
-
- mexCallMATLAB(1,&output,0,&input,"GetVerbosityLevel");
- level=mxGetScalar(output);
-
- verbositylevel = (int)level;
- return verbositylevel;
-
-#else
-
_assert_(verbositylevel>=0);
return verbositylevel;
-#endif
}/*}}}*/
Modified: issm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Numerics/XZvectorsToCoordinateSystem.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -1,7 +1,7 @@
-#include "../../io/Matlab/matlabio.h"
#include "../Alloc/alloc.h"
#include "../../include/include.h"
#include "../Exceptions/exceptions.h"
+#include "./isnan.h"
#include <math.h>
void XZvectorsToCoordinateSystem(double* T,double* xzvectors){
Modified: issm/trunk/src/c/shared/Sorting/binary_search.cpp
===================================================================
--- issm/trunk/src/c/shared/Sorting/binary_search.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Sorting/binary_search.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,11 +10,11 @@
#include <stdio.h>
-int binary_search(int* poffset,int target, int* sorted_integers,int num_integers){
+int binary_search(int* poffset,int target,int* sorted_integers,int num_integers){
/*output: */
int offset; //offset, if found
- int found=0; //found=0 if target is not found, 1 otherwise.
+ int found=0; //found=0 if target is not found, 1 otherwise.
/*intermediary: */
int* beg=NULL;
@@ -63,4 +63,3 @@
/*Return result: */
return found;
}
-
Modified: issm/trunk/src/c/shared/Sorting/sorting.h
===================================================================
--- issm/trunk/src/c/shared/Sorting/sorting.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Sorting/sorting.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,8 +5,6 @@
#ifndef _SORTING_H_
#define _SORTING_H_
-int binary_search(int* poffset,int target, int* sorted_integers,int num_integers);
+int binary_search(int* poffset,int target,int* sorted_integers,int num_integers);
-
#endif //ifndef _SORTING_H_
-
Modified: issm/trunk/src/c/shared/Threads/LaunchThread.cpp
===================================================================
--- issm/trunk/src/c/shared/Threads/LaunchThread.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Threads/LaunchThread.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -66,5 +66,4 @@
function((void*)&handle);
#endif
-
}
Modified: issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp
===================================================================
--- issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/TriMesh/SplitMeshForRifts.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -46,17 +46,16 @@
segments=*psegments;
segmentmarkerlist=*psegmentmarkerlist;
-
/*Establish list of segments that belong to a rift: */
- RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments); /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element,
- first node and second snode)*/
+ /*riftsegments of size nriftsegsx4 (4 for first element on segment,second element,first node and second snode)*/
+ RiftSegmentsFromSegments(&nriftsegs,&riftsegments,nel,index,nsegs,segments);
/*Go through all nodes of the rift segments, and start splitting the mesh: */
flags=(int*)xcalloc(nods,sizeof(int)); //to make sure we don't split the same nodes twice!
for (i=0;i<nriftsegs;i++){
for (j=0;j<2;j++){
- node=*(riftsegments+4*i+j+2);
+ node=riftsegments[4*i+j+2];
if(flags[node-1]){
/*This node was already split, skip:*/
continue;
@@ -69,9 +68,13 @@
DetermineGridElementListOnOneSideOfRift(&NumGridElementListOnOneSideOfRift,&GridElementListOnOneSideOfRift,i,nriftsegs,riftsegments,node,index,nel);
- /*Summary: we have for node, a list of elements (GridElementListOnOneSideOfRift, of size NumGridElementListOnOneSideOfRift) that all contain node
- *and that are on the same side of the rift. For all these elements, we clone node into another node, and we swap all instances of node in the triangulation
- *for those elements, to the new node.*/
+ /*Summary: we have for node, a list of elements
+ * (GridElementListOnOneSideOfRift, of size
+ * NumGridElementListOnOneSideOfRift) that all contain node
+ *and that are on the same side of the rift. For all these
+ elements, we clone node into another node, and we swap all
+ instances of node in the triangulation *for those elements, to the
+ new node.*/
//augment number of nodes
nods=nods+1;
@@ -93,7 +96,7 @@
} //for (i=0;i<nriftsegs;i++)
/*update segments: they got modified completely by adding new nodes.*/
- UpdateSegments(&segments,&segmentmarkerlist, &nsegs,index,x,y,riftsegments,nriftsegs);
+ UpdateSegments(&segments,&segmentmarkerlist, &nsegs,index,x,y,riftsegments,nriftsegs,nods,nel);
/*Assign output pointers: */
*pnel=nel;
Modified: issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
===================================================================
--- issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -10,6 +10,7 @@
#include "../../include/include.h"
#define RIFTPENALTYPAIRSWIDTH 8
+/*FUNCTION IsGridOnRift{{{*/
int IsGridOnRift(int* riftsegments, int nriftsegs, int node){
/*Does this node belong to 4 elements, or just 2? If it belongs to 4 elements, it is inside a rift,
@@ -31,9 +32,8 @@
else{
return 0;
}
-}
-
-
+}/*}}}*/
+/*FUNCTION GridElementsList{{{*/
int GridElementsList(int** pGridElements, int* pNumGridElements,int node,double * index,int nel){
/*From a node, recover all the elements that are connected to it: */
@@ -86,9 +86,8 @@
*pGridElements=GridElements;
*pNumGridElements=NumGridElements;
return noerr;
-}
-
-
+}/*}}}*/
+/*FUNCTION IsNeighbor{{{*/
int IsNeighbor(int el1,int el2,double* index){
/*From a triangulation held in index, figure out if elements 1 and 2 have two nodes in common: */
int i,j;
@@ -104,9 +103,8 @@
else{
return 0;
}
-}
-
-
+}/*}}}*/
+/*FUNCTION IsOnRift{{{*/
int IsOnRift(int el,int nriftsegs,int* riftsegments){
/*From a list of elements segments, figure out if el belongs to it: */
int i;
@@ -116,13 +114,8 @@
}
}
return 0;
-}
-
-
-/******************************************************************************************************************************
- RiftSegmentsFromSegments
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION RiftSegmentsFromSegments{{{*/
void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
int i,counter;
@@ -188,12 +181,8 @@
/*Assign output pointers: */
*priftsegments=riftsegments;
*pnriftsegs=nriftsegs;
-}
-
-/******************************************************************************************************************************
- DetermineGridElementListOnOneSideOfRift
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION DetermineGridElementListOnOneSideOfRift{{{*/
int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,double* index,int nel){
int noerr=1;
@@ -256,14 +245,10 @@
*pNumGridElementListOnOneSideOfRift=NumGridElementListOnOneSideOfRift;
*pGridElementListOnOneSideOfRift=GridElementListOnOneSideOfRift;
return noerr;
-}
+}/*}}}*/
+/*FUNCTION UpdateSegments{{{*/
+int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel){
-/******************************************************************************************************************************
- UpdateSegments
-******************************************************************************************************************************/
-
-int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs){
-
int noerr=1;
int i,j,k;
int el1,el2;
@@ -283,22 +268,22 @@
/*First, update the existing segments to the new nodes :*/
for (i=0;i<nriftsegs;i++){
- el1=*(riftsegments+4*i+0);
- el2=*(riftsegments+4*i+1);
+ el1=riftsegments[4*i+0];
+ el2=riftsegments[4*i+1];
for (j=0;j<nsegs;j++){
- if (*(segments+3*j+2)==(el1+1)){
+ if (segments[3*j+2]==(el1+1)){
/*segment j is the same as rift segment i.Let's update segments[j][:] using element el1 and the corresponding rift segment.
*Because riftsegments does not represent a list of rift segments anymore (it got heavily modified in SplitElementsForRifts,
*we can only rely on the position (x,y) of the rift nodes to create a segment:*/
for (k=0;k<3;k++){
if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
- *(segments+3*j+0)=*(index+el1*3+k);
+ *(segments+3*j+0)=*(index+el1*3+k); _assert_(segments[3*j+0]<nods+1);
break;
}
}
for (k=0;k<3;k++){
if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
- *(segments+3*j+1)=*(index+el1*3+k);
+ *(segments+3*j+1)=*(index+el1*3+k); _assert_(segments[3*j+1]<nods+1);
break;
}
}
@@ -307,13 +292,13 @@
*(segmentmarkerlist+(nsegs+i))=*(segmentmarkerlist+j);
for (k=0;k<3;k++){
if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
- *(segments+3*(nsegs+i)+0)=*(index+el2*3+k);
+ *(segments+3*(nsegs+i)+0)=*(index+el2*3+k); _assert_(segments[3*(nsegs+i)+0]<nods+1);
break;
}
}
for (k=0;k<3;k++){
if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
- *(segments+3*(nsegs+i)+1)=*(index+el2*3+k);
+ *(segments+3*(nsegs+i)+1)=*(index+el2*3+k); _assert_(segments[3*(nsegs+i)+1]<nods+1);
break;
}
}
@@ -323,13 +308,13 @@
/*Let's update segments[j][:] using element el2 and the corresponding rift segment: */
for (k=0;k<3;k++){
if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
- *(segments+3*j+0)=*(index+el2*3+k);
+ *(segments+3*j+0)=*(index+el2*3+k); _assert_(segments[3*j+0]<nods+1);
break;
}
}
for (k=0;k<3;k++){
if ((x[(int)*(index+el2*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el2*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
- *(segments+3*j+1)=*(index+el2*3+k);
+ *(segments+3*j+1)=*(index+el2*3+k);_assert_(segments[3*j+1]<nods+1);
break;
}
}
@@ -338,13 +323,13 @@
*(segmentmarkerlist+(nsegs+i))=*(segmentmarkerlist+j);
for (k=0;k<3;k++){
if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+0)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+0)-1])){
- *(segments+3*(nsegs+i)+0)=*(index+el1*3+k);
+ *(segments+3*(nsegs+i)+0)=*(index+el1*3+k);_assert_(segments[3*(nsegs+i)+0]<nods+1);
break;
}
}
for (k=0;k<3;k++){
if ((x[(int)*(index+el1*3+k)-1]==x[(int)*(segments+3*j+1)-1]) && (y[(int)*(index+el1*3+k)-1]==y[(int)*(segments+3*j+1)-1])){
- *(segments+3*(nsegs+i)+1)=*(index+el1*3+k);
+ *(segments+3*(nsegs+i)+1)=*(index+el1*3+k);_assert_(segments[3*(nsegs+i)+1]<nods+1);
break;
}
}
@@ -359,11 +344,8 @@
*pnsegs=nsegs;
return noerr;
-}
-
-/******************************************************************************************************************************
- pnpoly
-******************************************************************************************************************************/
+}/*}}}*/
+/*FUNCTION pnpoly{{{*/
int pnpoly(int npol, double *xp, double *yp, double x, double y) {
int i, j, c = 0;
for (i = 0, j = npol-1; i < npol; j = i++) {
@@ -373,35 +355,8 @@
c = !c;
}
return c;
-}
-
-/******************************************************************************************************************************
- IsInPoly
-******************************************************************************************************************************/
-//void IsInPoly(double* in,double* xc,double* yc,int numnodes,double* x,double* y,int nods){
-//
-// int i;
-// double x0,y0;
-//
-// /*Go through all nodes of the mesh:*/
-// for (i=0;i<nods;i++){
-// if (in[i]){
-// /*this node already is inside one of the contours, continue*/
-// continue;
-// }
-// /*pick up node: */
-// x0=x[i];
-// y0=y[i];
-// if (pnpoly(numnodes,xc,yc,x0,y0)){
-// in[i]=1;
-// }
-// }
-//}
-
-/******************************************************************************************************************************
- FindElement
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION FindElement{{{*/
int FindElement(double A,double B,double* index,int nel){
int n;
@@ -413,13 +368,10 @@
}
}
return el;
-}
-/******************************************************************************************************************************
- SplitRiftSegments
-******************************************************************************************************************************/
+}/*}}}*/
+/*FUNCTION SplitRiftSegments{{{*/
+int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts,int nods,int nel){
-int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts){
-
/*Using segment markers, wring out the rift segments from the segments. Rift markers are
*of the form 2+i where i=0 to number of rifts */
@@ -460,9 +412,9 @@
counter=0;
for (i=0;i<numsegs;i++){
if (segmentmarkerlist[i]==1){
- *(new_segments+3*counter+0)=*(segments+3*i+0);
- *(new_segments+3*counter+1)=*(segments+3*i+1);
- *(new_segments+3*counter+2)=*(segments+3*i+2);
+ new_segments[3*counter+0]=segments[3*i+0];
+ new_segments[3*counter+1]=segments[3*i+1];
+ new_segments[3*counter+2]=segments[3*i+2];
new_segmentmarkers[counter]=segmentmarkerlist[i];
counter++;
}
@@ -483,9 +435,9 @@
counter=0;
for (j=0;j<numsegs;j++){
if (segmentmarkerlist[j]==(2+i)){
- *(riftsegment+3*counter+0)=*(segments+3*j+0);
- *(riftsegment+3*counter+1)=*(segments+3*j+1);
- *(riftsegment+3*counter+2)=*(segments+3*j+2);
+ riftsegment[3*counter+0]=segments[3*j+0];_assert_(riftsegment[3*counter+0]<nods+1);
+ riftsegment[3*counter+1]=segments[3*j+1];_assert_(riftsegment[3*counter+1]<nods+1);
+ riftsegment[3*counter+2]=segments[3*j+2];_assert_(riftsegment[3*counter+2]<nel+1);
counter++;
}
}
@@ -503,12 +455,8 @@
*priftssegments=riftssegments;
*priftsnumsegs=riftsnumsegs;
return noerr;
-}
-
-/******************************************************************************************************************************
- PairRiftElements
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION PairRiftElements{{{*/
int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y){
@@ -557,17 +505,8 @@
*priftspairs=riftspairs;
return noerr;
-}
-
-
-/******************************************************************************************************************************
- RemoveRifts
-******************************************************************************************************************************/
-
-double dabs(double x){
- if (x<0)x=-x;
- return x;
-}
+}/*}}}*/
+/*FUNCTION RemoveRifts{{{*/
int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel){
int noerr=1;
@@ -614,8 +553,8 @@
if (x[i]<xmin)xmin=x[i];
if (y[i]<ymin)ymin=y[i];
}
- xmin=xmin-dabs(xmin);
- ymin=ymin-dabs(ymin);
+ xmin=xmin-fabs(xmin);
+ ymin=ymin-fabs(ymin);
/*Initialize two arrays, one for nodes that are going to be merged, the other with corresponding nodes being merge into: */
max_size=0;
@@ -750,12 +689,8 @@
*pnumsegs=numsegs;
return noerr;
-}
-
-/******************************************************************************************************************************
- IsRiftPresent
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION IsRiftPresent{{{*/
int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs){
int i;
@@ -782,13 +717,9 @@
*pnumrifts=numrifts;
return noerr;
-}
-
-/******************************************************************************************************************************
- OrderRifts
-******************************************************************************************************************************/
-
-int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y){
+}/*}}}*/
+/*FUNCTION OrderRifts{{{*/
+int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels){
int noerr=1;
int i,j,k,counter;
@@ -811,7 +742,6 @@
/*output: */
double* riftstips=NULL;
-
/*Allocate byproduct of this routine, riftstips: */
riftstips=(double*)xmalloc(numrifts*2*sizeof(double));
@@ -821,7 +751,6 @@
riftpairs=riftspairs[i];
numsegs=riftsnumsegments[i];
-
/*Allocate copy of riftsegments and riftpairs,
*as well as ordering vector: */
riftsegments_copy=(double*)xmalloc(numsegs*3*sizeof(double));
@@ -846,7 +775,9 @@
}
}
/* Make sure node3 faces node1 and node4 faces node2: */
- if ((x[node1]==x[node4]) && (y[node1]==y[node4])){
+ _assert_(node1<nods+1 && node4<nods+1);
+ _assert_(node1>0 && node4>0);
+ if ((x[node1-1]==x[node4-1]) && (y[node1-1]==y[node4-1])){
/*Swap node3 and node4:*/
temp_node=node3;
node3=node4;
@@ -942,12 +873,8 @@
/*Assign output pointer:*/
*priftstips=riftstips;
return noerr;
-}
-
-/******************************************************************************************************************************
- PenaltyPairs
-******************************************************************************************************************************/
-
+}/*}}}*/
+/*FUNCTION PenaltyPairs{{{*/
int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double** riftssegments,
int* riftsnumsegs,double** riftspairs,double* riftstips,double* x,double* y){
Modified: issm/trunk/src/c/shared/TriMesh/trimesh.h
===================================================================
--- issm/trunk/src/c/shared/TriMesh/trimesh.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/TriMesh/trimesh.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,40 +5,31 @@
#ifndef _SHARED_TRIMESH_H
#define _SHARED_TRIMESH_H
-
#include <stdio.h>
#include <math.h>
-
-
//#define REAL double //took it out because it may conflict with stdlib.h defines. put back if necessary
-
int AssociateSegmentToElement(double** psegments,int nseg, double* index,int nel);
int OrderSegments(double** psegments,int nseg, double* index,int nel);
-
int GridInsideHole(double* px0,double* py0,int n,double* x,double* y);
int FindElement(double A,double B,double* index,int nel);
-
int SplitMeshForRifts(int* pnel,double** pindex,int* pnods,double** px,double** py,int* pnsegs,double** psegments,double** psegmentmarkerlist);
-
int IsGridOnRift(int* riftsegments, int nriftsegs, int node);
int GridElementsList(int** pGridElements, int* pNumGridElements,int node,double * index,int nel);
int IsNeighbor(int el1,int el2,double* index);
int IsOnRift(int el,int nriftsegs,int* riftsegments);
void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments);
int DetermineGridElementListOnOneSideOfRift(int* pNumGridElementListOnOneSideOfRift, int** pGridElementListOnOneSideOfRift, int segmentnumber, int nriftsegs, int* riftsegments, int node,double* index,int nel);
-int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs);
+int UpdateSegments(double** psegments,double** psegmentmarkerlist, int* pnsegs, double* index, double* x,double* y,int* riftsegments,int nriftsegs,int nods,int nel);
int pnpoly(int npol, double *xp, double *yp, double x, double y);
int FindElement(double A,double B,double* index,int nel);
int RemoveRifts(double** pindex,double** px,double** py,int* pnods,double** psegments,int* pnumsegs,int numrifts1,int* rifts1numsegs,double** rifts1segments,double** rifts1pairs,int nel);
int IsRiftPresent(int* priftflag,int* pnumrifts, double* segmentmarkerlist,int nsegs);
-int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts);
-int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y);
+int SplitRiftSegments(double** psegments,double** psegmentmarkerlist, int* pnumsegs, int* pnumrifts,int** priftsnumsegs,double*** priftssegments,int numrifts,int nods,int nels);
+int OrderRifts(double** priftstips, double** riftssegments,double** riftspairs,int numrifts,int* riftsnumsegments,double* x,double* y,int nods,int nels);
int PenaltyPairs(double*** priftspenaltypairs,int** priftsnumpenaltypairs,int numrifts,double** riftssegments,
int* riftsnumsegments,double** riftspairs,double* riftstips,double* x,double* y);
-
int RemoveCornersFromRifts(double** pindex,int* pnel,double** px,double** py,int* pnods, double* segments,double* segmentmarkers,int num_seg);
int PairRiftElements(int** priftsnumpairs, double*** priftspairs,int numrifts,int* riftsnumsegments, double** riftssegments,double* x,double* y);
-
#endif /* _SHARED_TRIMESH_H */
Modified: issm/trunk/src/c/shared/Wrapper/wrappershared.h
===================================================================
--- issm/trunk/src/c/shared/Wrapper/wrappershared.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/Wrapper/wrappershared.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -7,9 +7,7 @@
#include "../../objects/objects.h"
-#ifdef _SERIAL_
int ModuleBoot(void);
int ModuleEnd(void);
-#endif
#endif
Modified: issm/trunk/src/c/shared/shared.h
===================================================================
--- issm/trunk/src/c/shared/shared.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/shared/shared.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -7,6 +7,7 @@
#include "Alloc/alloc.h"
+#include "Alloc/alloc_module.h"
#include "Exceptions/exceptions.h"
#include "Exp/exp.h"
#include "TriMesh/trimesh.h"
Modified: issm/trunk/src/c/solutions/ProcessArguments.cpp
===================================================================
--- issm/trunk/src/c/solutions/ProcessArguments.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/solutions/ProcessArguments.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -3,6 +3,8 @@
*/
#include <stdio.h>
+#include <cstring>
+
#include "../shared/shared.h"
#include "../include/include.h"
Modified: issm/trunk/src/c/solutions/issm.cpp
===================================================================
--- issm/trunk/src/c/solutions/issm.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/solutions/issm.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -34,25 +34,29 @@
double start_init, finish_init;
int ierr;
- MODULEBOOT();
+ ISSMBOOT();
- #ifndef _PARALLEL_
- _error_(" parallel executable was compiled without support of parallel libraries!");
- #endif
-
/*Initialize environments: Petsc, MPI, etc...: */
#ifdef _HAVE_PETSC_
ierr=PetscInitialize(&argc,&argv,(char*)0,"");
if(ierr) _error_("Could not initialize Petsc");
#else
+ #ifdef _HAVE_MPI_
MPI_Init(&argc,&argv);
#endif
+ #endif
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); start=MPI_Wtime();
+ #else
+ start=(double)clock();
+ #endif
/*Size and rank: */
+ #ifdef _HAVE_MPI_
MPI_Comm_rank(MPI_COMM_WORLD,&my_rank);
MPI_Comm_size(MPI_COMM_WORLD,&num_procs);
+ #endif
/*First process inputs*/
_printf_(true,"\n");
@@ -65,7 +69,11 @@
AnalysisConfiguration(&analyses,&numanalyses,solution_type);
/*Create femmodel, using input file: */
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); start_init=MPI_Wtime();
+ #else
+ start_init=(double)clock();
+ #endif
femmodel=new FemModel(binfilename,outbinfilename,solution_type,analyses,numanalyses);
/*get type of solution we are going to run: */
@@ -85,10 +93,19 @@
femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
+ #else
+ finish_init=(double)clock();
+ #endif
_printf_(true,"call computational core:\n");
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
+ #else
+ start_core=(double)clock();
+ #endif
+
if(dakota_analysis){
#ifdef _HAVE_DAKOTA_
Dakotax(femmodel);
@@ -109,8 +126,12 @@
else{
solutioncore(femmodel);
}
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( );
-
+ #else
+ finish_core=(double)clock();
+ #endif
+
_printf_(true,"write results to disk:\n");
OutputResultsx(femmodel->elements, femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,femmodel->results);
@@ -130,22 +151,32 @@
delete femmodel;
/*Get finish time and close*/
+ #ifdef _HAVE_MPI_
MPI_Barrier(MPI_COMM_WORLD); finish = MPI_Wtime( );
_printf_(true,"\n %-34s %f seconds \n","FemModel initialization elapsed time:",finish_init-start_init);
_printf_(true," %-34s %f seconds \n","Core solution elapsed time:",finish_core-start_core);
_printf_(true,"\n %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600),int(int(finish-start)%3600/60),int(finish-start)%60);
+ #else
+ finish=(double)clock();
+ _printf_(true,"\n %-34s %f seconds \n","FemModel initialization elapsed time:",(finish_init-start_init)/CLOCKS_PER_SEC);
+ _printf_(true," %-34s %f seconds \n","Core solution elapsed time:",(finish_core-start_core)/CLOCKS_PER_SEC);
+ _printf_(true,"\n %s %i hrs %i min %i sec\n\n","Total elapsed time:",int((finish-start)/3600/CLOCKS_PER_SEC),int(int((finish-start)/CLOCKS_PER_SEC)%3600/60),(int(finish-start)/CLOCKS_PER_SEC)%60);
+ #endif
+
+ #ifdef _HAVE_PETSC_
_printf_(true,"closing MPI and Petsc\n");
- #ifdef _HAVE_PETSC_
PetscFinalize();
#else
+ #ifdef _HAVE_MPI_
+ _printf_(true,"closing MPI and Petsc\n");
MPI_Finalize();
#endif
+ #endif
/*end module: */
- MODULEEND();
+ ISSMEND();
return 0; //unix success return;
}
-
Modified: issm/trunk/src/c/solvers/solver_newton.cpp
===================================================================
--- issm/trunk/src/c/solvers/solver_newton.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/solvers/solver_newton.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -66,9 +66,19 @@
/*Check convergence*/
convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters);
xdelete(&Kff); xdelete(&pf);
- if(converged==true) break;
+ if(converged==true){
+ bool max_iteration_state=false;
+ int tempStep=1;
+ double tempTime=1.0;
+ femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ break;
+ }
if(count>=max_nonlinear_iterations){
- _printf_(true," maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations);
+ _printf_(true," maximum number of Newton iterations (%i) exceeded\n",max_nonlinear_iterations);
+ bool max_iteration_state=true;
+ int tempStep=1;
+ double tempTime=1.0;
+ femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
break;
}
Modified: issm/trunk/src/c/solvers/solver_nonlinear.cpp
===================================================================
--- issm/trunk/src/c/solvers/solver_nonlinear.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/solvers/solver_nonlinear.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -84,12 +84,22 @@
/*Increase count: */
count++;
- if(converged==true)break;
+ if(converged==true){
+ bool max_iteration_state=false;
+ int tempStep=1;
+ double tempTime=1.0;
+ femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
+ break;
+ }
if(count>=max_nonlinear_iterations){
- _printf_(true," maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations);
+ _printf_(true," maximum number of nonlinear iterations (%i) exceeded\n",max_nonlinear_iterations);
converged=true;
- InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
- InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
+ InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
+ InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
+ bool max_iteration_state=true;
+ int tempStep=1;
+ double tempTime=1.0;
+ femmodel->results->AddObject(new BoolExternalResult(femmodel->results->Size()+1, MaxIterationConvergenceFlagEnum, max_iteration_state, tempStep, tempTime));
break;
}
}
Modified: issm/trunk/src/c/toolkits/issm/SeqMat.cpp
===================================================================
--- issm/trunk/src/c/toolkits/issm/SeqMat.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/issm/SeqMat.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -91,54 +91,6 @@
}
}
/*}}}*/
-
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-/*FUNCTION SeqMat::ToMatlabMatrix{{{1*/
-mxArray* SeqMat::ToMatlabMatrix(void){
-
- /*Intermediary: */
- double* buffer=NULL;
- mxArray* pfield=NULL;
-
- /*output: */
- mxArray* dataref=NULL;
-
- /*copy vector into a new buffer: */
- if(this->M*this->N){
- buffer=(double*)xmalloc(this->M*this->N*sizeof(double));
- memcpy(buffer,this->matrix,M*N*sizeof(double));
-
- pfield=mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(pfield,this->N);
- mxSetN(pfield,this->M);
- mxSetPr(pfield,buffer);
-
- //transpose the matrix, written directly to matlab! from C to matlab.
- mexCallMATLAB(1,&dataref, 1, &pfield, "transpose");
- }
- else dataref=mxCreateDoubleMatrix(0,0,mxREAL);
-
- /*do not erase buffer!: */
- return dataref;
-
-}
-
-
-
-
-/*}}}*/
-/*FUNCTION MatlabMatrixToSeqMat{{{1*/
-SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref){
-
- SeqMat* output=NULL;
-
- output=new SeqMat();
- MatlabMatrixToDoubleMatrix(&output->matrix,&output->M,&output->N,dataref);
- return output;
-
-}
-/*}}}*/
-#endif
/*FUNCTION SeqMat::Assemble{{{1*/
void SeqMat::Assemble(void){
Modified: issm/trunk/src/c/toolkits/issm/SeqMat.h
===================================================================
--- issm/trunk/src/c/toolkits/issm/SeqMat.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/issm/SeqMat.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,10 +15,6 @@
#include "../toolkitsenums.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
-
/*}}}*/
class SeqVec;
@@ -39,9 +35,6 @@
/*}}}*/
/*SeqMat specific routines {{{1*/
void Echo(void);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxArray* ToMatlabMatrix(void);
- #endif
void Assemble(void);
double Norm(NormMode norm_type);
void GetSize(int* pM,int* pN);
@@ -55,9 +48,4 @@
};
-/*API :*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-SeqMat* MatlabMatrixToSeqMat(const mxArray* dataref);
-#endif
-
#endif //#ifndef _SEQMAT_H_
Modified: issm/trunk/src/c/toolkits/issm/SeqVec.cpp
===================================================================
--- issm/trunk/src/c/toolkits/issm/SeqVec.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/issm/SeqVec.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -65,44 +65,6 @@
}
/*}}}*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-/*FUNCTION SeqVec::ToMatlabVector{{{1*/
-mxArray* SeqVec::ToMatlabVector(void){
-
- double* buffer=NULL;
-
- mxArray* dataref=NULL;
-
- /*copy vector into a new buffer: */
- if(this->M){
- buffer=(double*)xmalloc(this->M*sizeof(double));
- memcpy(buffer,vector,M*sizeof(double));
-
- dataref = mxCreateDoubleMatrix(0,0,mxREAL);
- mxSetM(dataref,this->M);
- mxSetN(dataref,1);
- mxSetPr(dataref,buffer);
- }
- else dataref = mxCreateDoubleMatrix(0,0,mxREAL);
-
-
- /*do not erase buffer!: */
- return dataref;
-
-}
-/*}}}*/
-/*FUNCTION MatlabVectorToSeqVec{{{1*/
-SeqVec* MatlabVectorToSeqVec(const mxArray* dataref){
-
- SeqVec* output=NULL;
-
- output=new SeqVec();
- MatlabVectorToDoubleVector(&output->vector,&output->M,dataref);
- return output;
-
-}
-/*}}}*/
-#endif
/*FUNCTION SeqVec::Assemble{{{1*/
void SeqVec::Assemble(void){
Modified: issm/trunk/src/c/toolkits/issm/SeqVec.h
===================================================================
--- issm/trunk/src/c/toolkits/issm/SeqVec.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/issm/SeqVec.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,10 +15,6 @@
#include "../toolkitsenums.h"
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-#endif
-
/*}}}*/
class SeqVec{
@@ -36,9 +32,6 @@
/*}}}*/
/*SeqVec specific routines {{{1*/
void Echo(void);
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- mxArray* ToMatlabVector(void);
- #endif
void Assemble(void);
void SetValues(int ssize, int* list, double* values, InsMode mode);
void SetValue(int dof, double value, InsMode mode);
@@ -58,10 +51,4 @@
/*}}}*/
};
-
-/*API :*/
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-SeqVec* MatlabVectorToSeqVec(const mxArray* dataref);
-#endif
-
#endif //#ifndef _SEQVEC_H_
Modified: issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp
===================================================================
--- issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/petsc/patches/MatInvert.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -54,12 +54,8 @@
/*Assemble inverse: */
MatAssemblyBegin(inv,MAT_FINAL_ASSEMBLY);
MatAssemblyEnd(inv,MAT_FINAL_ASSEMBLY);
-
- #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
- MatConvert(inv, MATSEQAIJ,MAT_REUSE_MATRIX,&inv);
- #else
- MatConvert(inv, MATMPIAIJ,MAT_REUSE_MATRIX,&inv);
- #endif
+
+ MatConvert(inv, MATMPIAIJ,MAT_REUSE_MATRIX,&inv);
/*Free ressources:*/
MatFree(&identity);
Modified: issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp
===================================================================
--- issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/petsc/patches/NewMat.cpp 2012-06-02 00:26:03 UTC (rev 12330)
@@ -67,7 +67,12 @@
o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2
#ifdef _HAVE_PETSCDEV_
- MatCreateAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
+ if(sparsity==1){
+ MatCreateDense(MPI_COMM_WORLD,m,n,M,N,NULL,&outmatrix);
+ }
+ else{
+ MatCreateAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
+ }
#else
MatCreateMPIAIJ(MPI_COMM_WORLD,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix);
#endif
Modified: issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h
===================================================================
--- issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -15,14 +15,6 @@
class Parameters;
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "mex.h"
-int MatlabMatrixToPetscMatrix(Mat* matrix,int* prows,int* pcols, const mxArray* mxmatrix);
-int MatlabVectorToPetscVector(Vec* pvector,int* pvector_rows,const mxArray* mxvector);
-int PetscMatrixToMatlabMatrix(mxArray** pdataref,Mat matrix);
-int PetscVectorToMatlabVector(mxArray** pdataref,Vec vector);
-#endif
-
Vec NewVec(int size,bool fromlocalsize=false);
Mat NewMat(int M,int N);
Mat NewMat(int M,int N,double sparsity);
@@ -50,4 +42,7 @@
NormType ISSMToPetscNormMode(NormMode mode);
MatType ISSMToPetscMatrixType(MatrixType type);
+void PetscMatrixToDoubleMatrix(double** pmatrix, int* prows, int* pcols,Mat matrix);
+void PetscVectorToDoubleVector(double** pvector, int* prows, Vec vector);
+
#endif
Modified: issm/trunk/src/c/toolkits/python/pythonincludes.h
===================================================================
--- issm/trunk/src/c/toolkits/python/pythonincludes.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/python/pythonincludes.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -6,11 +6,22 @@
#define _PYTHON_INCLUDES_H_
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#if _PYTHON_MAJOR_ == 2
+#undef NPY_NO_DEPRECATED_API
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#else
+#define NPY_NO_DEPRECATED_API
+#endif
+
#include "Python.h"
#include "arrayobject.h"
-
-
#ifdef _HAVE_BOOST_
using namespace std;
#include <boost/python/def.hpp>
Modified: issm/trunk/src/c/toolkits/toolkits.h
===================================================================
--- issm/trunk/src/c/toolkits/toolkits.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/toolkits.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -11,7 +11,7 @@
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
#endif
-#if defined(_HAVE_PYTHON_) && defined(_SERIAL_)
+#ifdef _HAVE_PYTHON_
#include "./python/pythonincludes.h"
#endif
@@ -19,15 +19,15 @@
#include "./petsc/petscincludes.h"
#endif
-#if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
-#include "./matlab/matlabincludes.h"
+#ifdef _HAVE_MPI_
+#include "./mpi/mpiincludes.h"
#endif
+#ifdef _HAVE_METIS_
+#include "./metis/metisincludes.h"
+#endif
-#include "./mpi/mpiincludes.h"
-#include "./metis/metisincludes.h"
#include "./triangle/triangleincludes.h"
-#include "./double/double.h"
#include "./toolkitsenums.h"
#include "./issm/issmtoolkit.h"
Modified: issm/trunk/src/c/toolkits/triangle/triangleincludes.h
===================================================================
--- issm/trunk/src/c/toolkits/triangle/triangleincludes.h 2012-06-02 00:25:46 UTC (rev 12329)
+++ issm/trunk/src/c/toolkits/triangle/triangleincludes.h 2012-06-02 00:26:03 UTC (rev 12330)
@@ -5,14 +5,10 @@
#ifndef _TRIANGLE_INCLUDES_H_
#define _TRIANGLE_INCLUDES_H_
-#ifdef _SERIAL_
-
#ifdef _C_ //only valid for iso C, not C++
/*Triangle includes: */
#include "triangle.h"
#endif //#ifdef _C_
-#endif //ifdef _SERIAL_
-
#endif
More information about the issm-svn
mailing list