Skip to content

Commit 0874290

Browse files
authored
New tests again (#158)
* Forgotten debug traces * New unstructured mesh test * New scaling test
1 parent 7859946 commit 0874290

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

src/Core/Geom/EntityFactory.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,8 @@ Surface* EntityFactory::newSurface(const std::vector<Geom::Curve*>& curves)
675675
if(!curve->isLinear()){
676676
Utils::Math::Point pnew;
677677
curve->getPoint(0.3,pnew,true);
678-
std::cout << "Point à 0.3 " << pnew << std::endl;
679678
vec_vertices.push_back(pnew);
680679
curve->getPoint(0.7,pnew,true);
681-
std::cout << "Point à 0.7 " << pnew << std::endl;
682680
vec_vertices.push_back(pnew);
683681
}
684682
}

src/Core/Mesh/MeshImplementation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ Utils::Math::Point MeshImplementation::getCoordNode(gmds::Node nd)
209209
/*----------------------------------------------------------------------------*/
210210
bool MeshImplementation::createGMDSGroups()
211211
{
212-
std::cout<<"MeshImplementation::createGMDSGroups()"<<std::endl;
213212
// création des clouds, lines, surfaces et volumes gmds correspondants aux
214213
// Mgx3D::Mesh::Cloud, Line, Surface et Volume
215214

test_link/test_command_edit_geom.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ def test_command_scaling(capfd):
9393
ctx.redo()
9494
assertPoint(gm, "Pt0001", 1, 1, 1)
9595

96+
def test_command_scaling_2(capfd):
97+
ctx = Mgx3D.getStdContext()
98+
ctx.clearSession() # Clean the session after the previous test
99+
gm = ctx.getGeomManager ()
100+
tm = ctx.getTopoManager()
101+
102+
# Création de la boite Vol0000
103+
gm.newBox (Mgx3D.Point(0, 0, 0), Mgx3D.Point(1, 1, 1))
104+
# Création d'un bloc topologique structuré sur une géométrie (Vol0000)
105+
tm.newStructuredTopoOnGeometry ("Vol0000")
106+
assertPoint(tm, "Som0006", 1, 1, 1)
107+
108+
# Homothétie d'une géométrie avec sa topologie
109+
gm.scale (["Vol0000"], 3.000000e+00)
110+
assertPoint(tm, "Som0006", 3, 3, 3)
111+
96112
def test_command_remove(capfd):
97113
ctx = Mgx3D.getStdContext()
98114
ctx.clearSession() # Clean the session after the previous test
@@ -220,8 +236,8 @@ def test_command_common2d(capfd):
220236
assert gm.getNbSurfaces()==15
221237
assert gm.getNbCurves()==25
222238

223-
def assertPoint(gm, point, x, y, z):
224-
p = gm.getCoord(point)
239+
def assertPoint(m, point, x, y, z):
240+
p = m.getCoord(point)
225241
assert p.getX() == x
226242
assert p.getY() == y
227243
assert p.getZ() == z

test_link/test_ns_mesh.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@ def test_ns_mesh_2(capfd):
7070
mm.newAllBlocksMesh()
7171

7272
assert gm.getNbVolumes() == 2
73+
assert mm.getNbFaces() < 1900
74+
assert mm.getNbFaces() > 1850
75+
out, err = capfd.readouterr()
76+
assert len(err) == 0
77+
78+
def test_ns_mesh_2(capfd):
79+
ctx = Mgx3D.getStdContext()
80+
ctx.clearSession() # Clean the session after the previous test
81+
gm = ctx.getGeomManager()
82+
tm = ctx.getTopoManager()
83+
mm = ctx.getMeshManager()
84+
85+
tm.newCylinderWithTopo (Mgx3D.Point(0, 0, 0), 1, Mgx3D.Vector(5, 0, 0), 90, False, 1, 10, 10, 10)
86+
emp = Mgx3D.EdgeMeshingPropertyUniform(30)
87+
ctx.getTopoManager().setMeshingProperty (emp, ["Ar0003","Ar0008","Ar0001"])
88+
ctx.getMeshManager().newAllBlocksMesh()
89+
90+
assert mm.getNbFaces() < 1980
91+
assert mm.getNbFaces() > 1940
7392
out, err = capfd.readouterr()
7493
assert len(err) == 0
7594

0 commit comments

Comments
 (0)