Commit 2dcec557 authored by Baptiste Durand's avatar Baptiste Durand

Fix : Gmsh2DRVE for unit-cell that are not rectangular

parent b32d1916
......@@ -7,4 +7,5 @@
*.h5
demo/loc_E12_u.pdf
*.pyc.*
*.egg-info/
\ No newline at end of file
*.egg-info/
ho_homog/.idea
\ No newline at end of file
......@@ -84,7 +84,8 @@ __all__ = [
"part",
"full_scale_pb",
"toolbox_FEniCS",
"toolbox_gmsh" "set_log_path",
"toolbox_gmsh",
"set_log_path",
"set_log_handlers",
"log_level",
"log_path",
......
......@@ -107,7 +107,9 @@ class Gmsh2DRVE(object):
):
"""
Contrat : Créer un maillage pour des RVE 2D, plans, comportant au plus 2 matériaux constitutifs et pouvant contenir plusieurs cellules.
#! La cellule est un parallélogramme.
cell_vect : Vecteurs de périodicité en colonne, définit également le parallélogramme qui contient la cellule.
#! La cellule doit être un parallélogramme.
Parameters
----------
......@@ -146,9 +148,14 @@ class Gmsh2DRVE(object):
duplicate_pattern(pattern_ll, nb_pattern, cell_vect)
rve_vect = cell_vect * nb_cells[:, np.newaxis]
O = np.zeros((3,))
macro_vtx = [O, rve_vect[0], rve_vect[0] + rve_vect[1], rve_vect[1]]
macro_ll = geo.LineLoop([geo.Point(c) for c in macro_vtx])
pt_o = np.zeros((3,))
macro_vtcs = [
pt_o,
rve_vect[:, 0],
rve_vect[:, 0] + rve_vect[:, 1],
rve_vect[:, 1],
]
macro_ll = geo.LineLoop([geo.Point(c) for c in macro_vtcs])
macro_s = geo.PlaneSurface(macro_ll)
if attractors:
......@@ -221,9 +228,11 @@ class Gmsh2DRVE(object):
else:
try:
s = one(rve_s)
boundary = geo.AbstractSurface.get_surfs_boundary(s,recursive=False)
boundary = geo.AbstractSurface.get_surfs_boundary(s, recursive=False)
except ValueError:
boundary = geo.AbstractSurface.get_surfs_boundary(rve_s,recursive=False)
boundary = geo.AbstractSurface.get_surfs_boundary(
rve_s, recursive=False
)
for b in boundary:
b.get_boundary(get_coords=True)
# factory.synchronize()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment