Index: ../trunk-jpl/src/c/modules/modules.h =================================================================== --- ../trunk-jpl/src/c/modules/modules.h (revision 22416) +++ ../trunk-jpl/src/c/modules/modules.h (revision 22417) @@ -5,12 +5,16 @@ #ifndef _ISSM_MODULES_H_ #define _ISSM_MODULES_H_ +#ifdef _HAVE_BAMG_ +#include "./Bamgx/Bamgx.h" +#include "./BamgConvertMeshx/BamgConvertMeshx.h" +#include "./BamgTriangulatex/BamgTriangulatex.h" +#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h" +#endif + /*Modules: */ #include "./AllocateSystemMatricesx/AllocateSystemMatricesx.h" #include "./AverageOntoPartitionx/AverageOntoPartitionx.h" -#include "./Bamgx/Bamgx.h" -#include "./BamgConvertMeshx/BamgConvertMeshx.h" -#include "./BamgTriangulatex/BamgTriangulatex.h" #include "./Calvingx/Calvingx.h" #include "./Chacox/Chacox.h" #include "./ConfigureObjectsx/ConfigureObjectsx.h" @@ -39,7 +43,6 @@ #include "./InputExtrudex/InputExtrudex.h" #include "./InterpFromMesh2dx/InterpFromMesh2dx.h" #include "./InterpFromGridToMeshx/InterpFromGridToMeshx.h" -#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h" #include "./InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h" #include "./InterpFromMeshToGridx/InterpFromMeshToGridx.h" #include "./InputUpdateFromConstantx/InputUpdateFromConstantx.h" Index: ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp =================================================================== --- ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp (revision 22416) +++ ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp (revision 22417) @@ -70,6 +70,8 @@ xDelete(gate.numdone); } else if(strcmp(output,"delaunay")==0){ + + #ifdef _HAVE_BAMG_ int nobs,nel; double *x = NULL; double *y = NULL; @@ -88,6 +90,9 @@ xDelete(y); xDelete(data); xDelete(index); + #else + _error_("you did not compile ISSM with bamg"); + #endif } else if(strcmp(output,"nearestneighbor")==0){ /*initialize thread parameters: */ Index: ../trunk-jpl/src/c/Makefile.am =================================================================== --- ../trunk-jpl/src/c/Makefile.am (revision 22416) +++ ../trunk-jpl/src/c/Makefile.am (revision 22417) @@ -48,7 +48,8 @@ ./shared/Bamg/BigPrimeNumber.cpp\ ./modules/Bamgx/Bamgx.cpp\ ./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\ - ./modules/BamgTriangulatex/BamgTriangulatex.cpp + ./modules/BamgTriangulatex/BamgTriangulatex.cpp\ + ./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp #do not include AmrBamg with ADOLC if ADOLC @@ -303,7 +304,6 @@ ./modules/ConstraintsStatex/RiftConstraintsState.cpp\ ./modules/ModelProcessorx/CreateOutputDefinitions.cpp\ ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\ - ./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\ ./classes/Inputs/PentaInput.cpp\ ./classes/Inputs/TetraInput.cpp #}}} Index: ../trunk-jpl/src/c/classes/FemModel.h =================================================================== --- ../trunk-jpl/src/c/classes/FemModel.h (revision 22416) +++ ../trunk-jpl/src/c/classes/FemModel.h (revision 22417) @@ -175,7 +175,9 @@ void CreateNodes(int newnumberofvertices,int* my_vertices,int nodecounter,int analysis_enum,Nodes* nodes); void CreateConstraints(Vertices* newfemmodel_vertices,int nodecounter,int constraintcounter,int analysis_enum,Constraints* newfemmodel_constraints); void GetInputs(int* pnumP0inputs,IssmDouble** pP0inputs,int** pP0input_enums,int** pP0input_interp,int* pnumP1inputs,IssmDouble** pP1inputs,int** pP1input_enums,int** pP1input_interp); + #ifdef _HAVE_BAMG_ void InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements); + #endif void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int nodecounter,int analysis_counter,Elements* newelements); void ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices); void WriteMeshInResults(void); Index: ../trunk-jpl/src/c/classes/FemModel.cpp =================================================================== --- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 22416) +++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 22417) @@ -2512,7 +2512,7 @@ /*}}}*/ /*AMR*/ -#if !defined(_HAVE_ADOLC_) +#if !defined(_HAVE_ADOLC_) void FemModel::ReMesh(void){/*{{{*/ /*Intermediaries*/ @@ -2627,7 +2627,11 @@ } /*Finally: interpolate all inputs and insert them into the new elements.*/ + #ifdef _HAVE_BAMG_ this->InterpolateInputs(new_vertices,new_elements); + #else + _error_("Cannot interpolate inputs without bamg"); + #endif /*Delete old structure and set new pointers*/ delete this->vertices; this->vertices = new_vertices; @@ -2866,6 +2870,7 @@ xDelete(pos); } /*}}}*/ +#ifdef _HAVE_BAMG_ void FemModel::InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements){/*{{{*/ int numberofelements = this->elements->NumberOfElements(); //global, entire old mesh @@ -2980,6 +2985,7 @@ xDelete(values); } /*}}}*/ +#endif void FemModel::WriteMeshInResults(void){/*{{{*/ /*Write the erros estimators*/ @@ -3420,9 +3426,13 @@ spc=vspc->ToMPISerial(); /*Interpolate spc values and flags in the new partition*/ + #ifdef _HAVE_BAMG_ InterpFromMeshToMesh2dx(&newspc,elementslist,x,y,numberofvertices,numberofelements, spc,numberofvertices,numberofcols, newx,newy,newnumberofvertices,NULL); + #else + _error_("cannot interpolate without bamg"); + #endif /*Now, insert the interpolated constraints in the data set (constraints)*/ count=0;