Skip to content

Commit 11da11e

Browse files
authored
Merge pull request #3 from LIHPC-Computational-Geometry/upgrade_gmds_1
Migrate on gmds 1.2.1
2 parents 60a3354 + 92448b3 commit 11da11e

File tree

8 files changed

+61
-50
lines changed

8 files changed

+61
-50
lines changed

smooth3D/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ add_library(smooth3D ${SMOOTH3D_HEADER_FILES} ${SMOOTH3D_SRC_FILES})
8686
#target_compile_features(gmds PUBLIC cxx_std_11)
8787

8888

89-
target_link_libraries(smooth3D PRIVATE gmds)
89+
target_link_libraries(smooth3D PRIVATE GMDSIg)
9090
target_link_libraries(smooth3D PRIVATE Lima::Lima Mesquite::Mesquite)
9191
target_link_libraries(smooth3D PUBLIC MachineTypes::MachineTypes)
9292

smooth3D/inc/smooth3D/smooth3d.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ int S3_ConditionNumber2D(int_type nb_cells, int_type nb_nodes,
3939
double *y, double *z, const double * weights, const double * relax,
4040
int_type n_iter);
4141

42+
// S3_GETMe2D is no longer available.
4243
int S3_GETMe2D(const double alpha, const double beta, int_type nb_cells,
4344
int_type nb_nodes, const int_type * nb_nodes_per_cell,
4445
const int_type *nodes_number, double *x, double *y, double *z,

smooth3D/src/getme/GetMe2D.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
#include <cstdlib> // pour rand
1212

1313
#include "smooth3D/smooth.h"
14-
#include <GMDS/IG/IGMesh.h>
15-
#include <GMDS/IG/IGMeshDoctor.h>
14+
#include <gmds/ig/Mesh.h>
15+
#include <gmds/ig/MeshDoctor.h>
1616

1717
#include "math/Real3.h"
1818
#include "math/MeanRatio.h"
1919

20-
// Fonction spécialisée pour calculer le meanRatio pour un triangle
20+
/*
21+
// Fonction sp�cialis�e pour calculer le meanRatio pour un triangle
2122
static Smooth3D::Real computeMeanRatio(gmds::Node& n0, gmds::Node& n1,
2223
gmds::Node& n2) {
2324
Smooth3D::Real3 p[3];
@@ -39,7 +40,7 @@ static Smooth3D::Real computeMeanRatio(gmds::Node& n0, gmds::Node& n1,
3940
return (mean_ratio);
4041
}
4142
42-
// Fonction spécialisée pour calculer le meanRatio pour un quadrilatère
43+
// Fonction sp�cialis�e pour calculer le meanRatio pour un quadrilat�re
4344
static Smooth3D::Real computeMeanRatio(gmds::Node& n0, gmds::Node& n1,
4445
gmds::Node& n2, gmds::Node& n3) {
4546
static const int kTriQuads[4][3] = { { 0, 1, 3 }, { 1, 2, 0 }, { 2, 3, 1 }, {
@@ -225,11 +226,11 @@ static FourNodes computeGetMeQuadrangle3D(gmds::Face& face,
225226
return compute_nodes;
226227
}
227228
228-
static void computeN2N(gmds::IGMesh& mesh) {
229+
static void computeN2N(gmds::Mesh& mesh) {
229230
230231
std::map<gmds::TCellID, std::set<gmds::TCellID> > n2n;
231232
232-
gmds::IGMesh::face_iterator it_faces = mesh.faces_begin();
233+
gmds::Mesh::face_iterator it_faces = mesh.faces_begin();
233234
234235
while (!it_faces.isDone()) {
235236
gmds::Face f = it_faces.value();
@@ -255,14 +256,17 @@ static void computeN2N(gmds::IGMesh& mesh) {
255256
current_node.set<gmds::Node>(adj_nodes);
256257
}
257258
}
258-
259+
*/
259260

260261
extern "C" int S3_GETMe2D(const double alpha, const double beta,
261262
int_type nb_cells, int_type nb_nodes, const int_type * nb_nodes_per_cell,
262263
const int_type *nodes_number, double *x, double *y, double *z,
263264
const double * weights, const double * relax, int_type n_iter) {
265+
std::cerr<<"S3_GETMe2D is no longer available."<<std::endl;
266+
return -1;
267+
/*
264268
const int kTGMDSMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N | gmds::N2N;
265-
gmds::IGMesh internal_mesh(kTGMDSMask);
269+
gmds::Mesh internal_mesh(kTGMDSMask);
266270
267271
gmds::Node* temp_array_nodes = new gmds::Node[nb_nodes];
268272
@@ -284,7 +288,7 @@ extern "C" int S3_GETMe2D(const double alpha, const double beta,
284288
internal_mesh.newFace(nodes_cell);
285289
}
286290
287-
gmds::IGMeshDoctor mesh_doc(&internal_mesh);
291+
gmds::MeshDoctor mesh_doc(&internal_mesh);
288292
mesh_doc.updateUpwardConnectivity();
289293
computeN2N(internal_mesh);
290294
@@ -312,7 +316,7 @@ extern "C" int S3_GETMe2D(const double alpha, const double beta,
312316
weights_pos[vtx] = 0.0;
313317
}
314318
315-
for (gmds::IGMesh::face_iterator it = internal_mesh.faces_begin();
319+
for (gmds::Mesh::face_iterator it = internal_mesh.faces_begin();
316320
!it.isDone(); it.next()) {
317321
gmds::Face current_face = it.value();
318322
@@ -417,14 +421,16 @@ delete[] new_pos;
417421
delete[] temp_array_nodes;
418422
419423
return (0);
424+
*/
420425
}
421426

427+
/*
422428
void testGetMeUnitTri(void) {
423429
Smooth3D::Real theta = M_PI / 6.0;
424430
Smooth3D::Real lambda = 0.0;
425431
426432
const int kTGmdsMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N;
427-
gmds::IGMesh internal_mesh(kTGmdsMask);
433+
gmds::Mesh internal_mesh(kTGmdsMask);
428434
429435
// we start with a square triangle
430436
gmds::Node noeuds[3];
@@ -462,7 +468,7 @@ Smooth3D::Real theta = M_PI / 6.0;
462468
Smooth3D::Real lambda = 0.25;
463469
464470
const int kTGMDSMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N;
465-
gmds::IGMesh internal_mesh(kTGMDSMask);
471+
gmds::Mesh internal_mesh(kTGMDSMask);
466472
467473
// we start with a square triangle
468474
gmds::Node noeuds[4];
@@ -502,7 +508,7 @@ Smooth3D::Real theta = M_PI / 6.0;
502508
Smooth3D::Real lambda = 0.25;
503509
504510
const int kTGMDSMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N;
505-
gmds::IGMesh internal_mesh(kTGMDSMask);
511+
gmds::Mesh internal_mesh(kTGMDSMask);
506512
507513
// we start with a non convex quadrangle
508514
@@ -538,3 +544,4 @@ for (int i = 0; i < 10; i++) {
538544
}
539545
540546
}
547+
*/

smooth3D/src/opt2D/ObjectiveCondition2D.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ Real ObjectiveCondition2D::evalF(const Real3 & p) {
3838

3939
gmds::Node adj12, adj21, temp;
4040
thisFace.getAdjacentNodes(adj1, adj12, temp);
41-
if (temp.getID() != m_node.getID())
41+
if (temp.id() != m_node.id())
4242
adj12 = temp;
4343
thisFace.getAdjacentNodes(adj2, adj21, temp);
44-
if (temp.getID() != m_node.getID())
44+
if (temp.id() != m_node.id())
4545
adj21 = temp;
4646

4747
n12 = Real3(adj12.X(), adj12.Y(), adj12.Z());
@@ -69,10 +69,10 @@ void ObjectiveCondition2D::evalDF(const Real3 & p, Real3 & grad) {
6969

7070
gmds::Node adj12, adj21, temp;
7171
thisFace.getAdjacentNodes(adj1, adj12, temp);
72-
if (temp.getID() != m_node.getID())
72+
if (temp.id() != m_node.id())
7373
adj12 = temp;
7474
thisFace.getAdjacentNodes(adj2, adj21, temp);
75-
if (temp.getID() != m_node.getID())
75+
if (temp.id() != m_node.id())
7676
adj21 = temp;
7777

7878
n12 = Real3(adj12.X(), adj12.Y(), adj12.Z());
@@ -98,10 +98,10 @@ Real ObjectiveCondition2D::evalFDF(const Real3 & p, Real3 & grad) {
9898

9999
gmds::Node adj12, adj21, temp;
100100
thisFace.getAdjacentNodes(adj1, adj12, temp);
101-
if (temp.getID() != m_node.getID())
101+
if (temp.id() != m_node.id())
102102
adj12 = temp;
103103
thisFace.getAdjacentNodes(adj2, adj21, temp);
104-
if (temp.getID() != m_node.getID())
104+
if (temp.id() != m_node.id())
105105
adj21 = temp;
106106

107107
n12 = Real3(adj12.X(), adj12.Y(), adj12.Z());

smooth3D/src/opt2D/ObjectiveCondition2D.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#define OBJECTIVECONDITION2D_H_
1010

1111
#include "IObjective3D.h"
12-
#include "GMDS/IG/IG.h"
12+
#include "gmds/ig/Node.h"
13+
#include "gmds/ig/Face.h"
1314

1415
namespace Smooth3D {
1516

smooth3D/src/opt2D/ObjectiveOrthogonal2D.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#define OPT2D_OBJECTIVEORTHOGONAL2D_H_
1010

1111
#include "IObjective3D.h"
12-
#include <GMDS/IG/IG.h>
12+
#include <gmds/ig/Node.h>
13+
#include <gmds/ig/Face.h>
1314

1415
namespace Smooth3D {
1516

smooth3D/src/opt2D/s3_conditionnumber2D.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include <cstdlib> // pour rand
1414

1515
#include "smooth3D/smooth.h"
16-
#include <GMDS/IG/IGMesh.h>
17-
#include <GMDS/IG/IGMeshDoctor.h>
16+
#include <gmds/ig/Mesh.h>
17+
#include <gmds/ig/MeshDoctor.h>
1818

1919
#include "math/Real3.h"
2020

@@ -32,7 +32,7 @@ extern "C" int S3_ConditionNumber2D(
3232
int_type n_iter)
3333
{
3434
const int tGMDSMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N | gmds::N2F;
35-
gmds::IGMesh internal_mesh(tGMDSMask);
35+
gmds::Mesh internal_mesh(tGMDSMask);
3636

3737
gmds::Node * temp_array_nodes = new gmds::Node [nb_nodes];
3838

@@ -47,7 +47,7 @@ extern "C" int S3_ConditionNumber2D(
4747
internal_mesh.newFace(nodes_cell);
4848
}
4949

50-
gmds::IGMeshDoctor mesh_doc(&internal_mesh);
50+
gmds::MeshDoctor mesh_doc(&internal_mesh);
5151
mesh_doc.updateUpwardConnectivity();
5252

5353
delete[] temp_array_nodes;
@@ -61,14 +61,13 @@ extern "C" int S3_ConditionNumber2D(
6161
for (int iter = 0; iter < n_iter; iter++) {
6262

6363
// LOOP 2 : FOR ALL NODES
64-
for (gmds::IGMesh::node_iterator it = internal_mesh.nodes_begin();
65-
!it.isDone(); it.next()) {
66-
gmds::Node current_node = it.value();
67-
if (relax[current_node.getID()] != 0.0) {
64+
for (auto i : internal_mesh.nodes()){
65+
auto current_node = internal_mesh.get<gmds::Node>(i);
66+
if (relax[current_node.id()] != 0.0) {
6867

6968
// We are only interested on Relaxed nodes
7069
condition.set_node(current_node);
71-
int nb_faces = current_node.getNbFaces();
70+
int nb_faces = current_node.nbFaces();
7271

7372
// First face connected to the node is chosen ramdomly
7473
int face_int = std::rand() % nb_faces;
@@ -147,10 +146,9 @@ extern "C" int S3_ConditionNumber2D(
147146
}
148147

149148

150-
for (gmds::IGMesh::node_iterator it = internal_mesh.nodes_begin();
151-
!it.isDone(); it.next()) {
152-
gmds::Node current_node = it.value();
153-
int vtx = current_node.getID();
149+
for (auto i : internal_mesh.nodes()){
150+
auto current_node = internal_mesh.get<gmds::Node>(i);
151+
int vtx = current_node.id();
154152
double rel = relax[vtx];
155153

156154
if (rel != 0.0)

smooth3D/src/opt2D/s3_orthogonal2D.cpp

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include <cstdlib> // pour rand
1414

1515
#include "smooth3D/smooth.h"
16-
#include <GMDS/IG/IGMesh.h>
17-
#include <GMDS/IG/IGMeshDoctor.h>
16+
#include <gmds/ig/Mesh.h>
17+
#include <gmds/ig/MeshDoctor.h>
1818

1919
#include "math/Real3.h"
2020

@@ -32,7 +32,7 @@ extern "C" int S3_Orthogonal2D(
3232
int_type n_iter)
3333
{
3434
const int tGMDSMask = gmds::DIM3 | gmds::N | gmds::F | gmds::F2N | gmds::N2F;
35-
gmds::IGMesh internal_mesh(tGMDSMask);
35+
gmds::Mesh internal_mesh(tGMDSMask);
3636

3737
gmds::Node * temp_array_nodes = new gmds::Node [nb_nodes];
3838

@@ -47,7 +47,7 @@ extern "C" int S3_Orthogonal2D(
4747
internal_mesh.newFace(nodes_cell);
4848
}
4949

50-
gmds::IGMeshDoctor mesh_doc(&internal_mesh);
50+
gmds::MeshDoctor mesh_doc(&internal_mesh);
5151
mesh_doc.updateUpwardConnectivity();
5252

5353
delete[] temp_array_nodes;
@@ -61,14 +61,16 @@ extern "C" int S3_Orthogonal2D(
6161
for (int iter = 0; iter < n_iter; iter++) {
6262

6363
// LOOP 2 : FOR ALL NODES
64-
for (gmds::IGMesh::node_iterator it = internal_mesh.nodes_begin();
65-
!it.isDone(); it.next()) {
66-
gmds::Node current_node = it.value();
67-
if (relax[current_node.getID()] != 0.0) {
64+
//for (gmds::Mesh::node_iterator it = internal_mesh.nodes_begin();
65+
//!it.isDone(); it.next()) {
66+
for (auto i : internal_mesh.nodes()){
67+
//gmds::Node current_node = it.value();
68+
auto current_node = internal_mesh.get<gmds::Node>(i);
69+
if (relax[current_node.id()] != 0.0) {
6870

6971
// We are only interested on Relaxed nodes
7072
orthogonal.setNode(current_node);
71-
int nb_faces = current_node.getNbFaces();
73+
int nb_faces = current_node.nbFaces();
7274

7375
// First face connected to the node is chosen ramdomly
7476
int face_int = std::rand() % nb_faces;
@@ -145,12 +147,13 @@ extern "C" int S3_Orthogonal2D(
145147
}
146148
}
147149
}
148-
149-
150-
for (gmds::IGMesh::node_iterator it = internal_mesh.nodes_begin();
151-
!it.isDone(); it.next()) {
152-
gmds::Node current_node = it.value();
153-
int vtx = current_node.getID();
150+
151+
// for (gmds::Mesh::node_iterator it = internal_mesh.nodes_begin();
152+
// !it.isDone(); it.next()) {
153+
// gmds::Node current_node = it.value();
154+
for (auto i : internal_mesh.nodes()){
155+
auto current_node = internal_mesh.get<gmds::Node>(i);
156+
int vtx = current_node.id();
154157
double rel = relax[vtx];
155158

156159
if (rel != 0.0)

0 commit comments

Comments
 (0)