source: issm/oecreview/Archive/21724-22754/ISSM-22416-22417.diff@ 22755

Last change on this file since 22755 was 22755, checked in by Mathieu Morlighem, 7 years ago

CHG: added 21724-22754

File size: 5.7 KB
RevLine 
[22755]1Index: ../trunk-jpl/src/c/modules/modules.h
2===================================================================
3--- ../trunk-jpl/src/c/modules/modules.h (revision 22416)
4+++ ../trunk-jpl/src/c/modules/modules.h (revision 22417)
5@@ -5,12 +5,16 @@
6 #ifndef _ISSM_MODULES_H_
7 #define _ISSM_MODULES_H_
8
9+#ifdef _HAVE_BAMG_
10+#include "./Bamgx/Bamgx.h"
11+#include "./BamgConvertMeshx/BamgConvertMeshx.h"
12+#include "./BamgTriangulatex/BamgTriangulatex.h"
13+#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h"
14+#endif
15+
16 /*Modules: */
17 #include "./AllocateSystemMatricesx/AllocateSystemMatricesx.h"
18 #include "./AverageOntoPartitionx/AverageOntoPartitionx.h"
19-#include "./Bamgx/Bamgx.h"
20-#include "./BamgConvertMeshx/BamgConvertMeshx.h"
21-#include "./BamgTriangulatex/BamgTriangulatex.h"
22 #include "./Calvingx/Calvingx.h"
23 #include "./Chacox/Chacox.h"
24 #include "./ConfigureObjectsx/ConfigureObjectsx.h"
25@@ -39,7 +43,6 @@
26 #include "./InputExtrudex/InputExtrudex.h"
27 #include "./InterpFromMesh2dx/InterpFromMesh2dx.h"
28 #include "./InterpFromGridToMeshx/InterpFromGridToMeshx.h"
29-#include "./InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.h"
30 #include "./InterpFromMeshToMesh3dx/InterpFromMeshToMesh3dx.h"
31 #include "./InterpFromMeshToGridx/InterpFromMeshToGridx.h"
32 #include "./InputUpdateFromConstantx/InputUpdateFromConstantx.h"
33Index: ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
34===================================================================
35--- ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp (revision 22416)
36+++ ../trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp (revision 22417)
37@@ -70,6 +70,8 @@
38 xDelete<int>(gate.numdone);
39 }
40 else if(strcmp(output,"delaunay")==0){
41+
42+ #ifdef _HAVE_BAMG_
43 int nobs,nel;
44 double *x = NULL;
45 double *y = NULL;
46@@ -88,6 +90,9 @@
47 xDelete<double>(y);
48 xDelete<double>(data);
49 xDelete<int>(index);
50+ #else
51+ _error_("you did not compile ISSM with bamg");
52+ #endif
53 }
54 else if(strcmp(output,"nearestneighbor")==0){
55 /*initialize thread parameters: */
56Index: ../trunk-jpl/src/c/Makefile.am
57===================================================================
58--- ../trunk-jpl/src/c/Makefile.am (revision 22416)
59+++ ../trunk-jpl/src/c/Makefile.am (revision 22417)
60@@ -48,7 +48,8 @@
61 ./shared/Bamg/BigPrimeNumber.cpp\
62 ./modules/Bamgx/Bamgx.cpp\
63 ./modules/BamgConvertMeshx/BamgConvertMeshx.cpp\
64- ./modules/BamgTriangulatex/BamgTriangulatex.cpp
65+ ./modules/BamgTriangulatex/BamgTriangulatex.cpp\
66+ ./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp
67
68 #do not include AmrBamg with ADOLC
69 if ADOLC
70@@ -303,7 +304,6 @@
71 ./modules/ConstraintsStatex/RiftConstraintsState.cpp\
72 ./modules/ModelProcessorx/CreateOutputDefinitions.cpp\
73 ./modules/OutputDefinitionsResponsex/OutputDefinitionsResponsex.cpp\
74- ./modules/InterpFromMeshToMesh2dx/InterpFromMeshToMesh2dx.cpp\
75 ./classes/Inputs/PentaInput.cpp\
76 ./classes/Inputs/TetraInput.cpp
77 #}}}
78Index: ../trunk-jpl/src/c/classes/FemModel.h
79===================================================================
80--- ../trunk-jpl/src/c/classes/FemModel.h (revision 22416)
81+++ ../trunk-jpl/src/c/classes/FemModel.h (revision 22417)
82@@ -175,7 +175,9 @@
83 void CreateNodes(int newnumberofvertices,int* my_vertices,int nodecounter,int analysis_enum,Nodes* nodes);
84 void CreateConstraints(Vertices* newfemmodel_vertices,int nodecounter,int constraintcounter,int analysis_enum,Constraints* newfemmodel_constraints);
85 void GetInputs(int* pnumP0inputs,IssmDouble** pP0inputs,int** pP0input_enums,int** pP0input_interp,int* pnumP1inputs,IssmDouble** pP1inputs,int** pP1input_enums,int** pP1input_interp);
86+ #ifdef _HAVE_BAMG_
87 void InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements);
88+ #endif
89 void UpdateElements(int newnumberofelements,int* newelementslist,bool* my_elements,int nodecounter,int analysis_counter,Elements* newelements);
90 void ElementsAndVerticesPartitioning(int& newnumberofvertices,int& newnumberofelements,int& elementswidth,int* newelementslist,bool** pmy_elements,int** pmy_vertices);
91 void WriteMeshInResults(void);
92Index: ../trunk-jpl/src/c/classes/FemModel.cpp
93===================================================================
94--- ../trunk-jpl/src/c/classes/FemModel.cpp (revision 22416)
95+++ ../trunk-jpl/src/c/classes/FemModel.cpp (revision 22417)
96@@ -2512,7 +2512,7 @@
97 /*}}}*/
98
99 /*AMR*/
100-#if !defined(_HAVE_ADOLC_)
101+#if !defined(_HAVE_ADOLC_)
102 void FemModel::ReMesh(void){/*{{{*/
103
104 /*Intermediaries*/
105@@ -2627,7 +2627,11 @@
106 }
107
108 /*Finally: interpolate all inputs and insert them into the new elements.*/
109+ #ifdef _HAVE_BAMG_
110 this->InterpolateInputs(new_vertices,new_elements);
111+ #else
112+ _error_("Cannot interpolate inputs without bamg");
113+ #endif
114
115 /*Delete old structure and set new pointers*/
116 delete this->vertices; this->vertices = new_vertices;
117@@ -2866,6 +2870,7 @@
118 xDelete<int>(pos);
119 }
120 /*}}}*/
121+#ifdef _HAVE_BAMG_
122 void FemModel::InterpolateInputs(Vertices* newfemmodel_vertices,Elements* newfemmodel_elements){/*{{{*/
123
124 int numberofelements = this->elements->NumberOfElements(); //global, entire old mesh
125@@ -2980,6 +2985,7 @@
126 xDelete<IssmDouble>(values);
127 }
128 /*}}}*/
129+#endif
130 void FemModel::WriteMeshInResults(void){/*{{{*/
131
132 /*Write the erros estimators*/
133@@ -3420,9 +3426,13 @@
134 spc=vspc->ToMPISerial();
135
136 /*Interpolate spc values and flags in the new partition*/
137+ #ifdef _HAVE_BAMG_
138 InterpFromMeshToMesh2dx(&newspc,elementslist,x,y,numberofvertices,numberofelements,
139 spc,numberofvertices,numberofcols,
140 newx,newy,newnumberofvertices,NULL);
141+ #else
142+ _error_("cannot interpolate without bamg");
143+ #endif
144
145 /*Now, insert the interpolated constraints in the data set (constraints)*/
146 count=0;
Note: See TracBrowser for help on using the repository browser.