Commit d451ecc9 authored by Baptiste Durand's avatar Baptiste Durand

TODO: Cleaning/Refactoring

[ ] Improve reconstruction
[ ] Cleaning in `part.py`
[ ] Doc for PeriodicDomain
parent c3291eba
......@@ -365,7 +365,6 @@ def reconstruction(
"""
# TODO : récupérer topo_dim à partir des tenseurs de localisation, ou mieux, à partir des espaces fonctionnels
# TODO : choisir comment on fixe la len des listes correspondantes aux composantes de u et de epsilon.
......@@ -474,6 +473,8 @@ def reconstruction(
values[:] = new_val
vec.set_local(values)
vec.apply("insert")
# TODO : Regarder si le passage par np array faire perdre du temps, et auquel cas si l'on peut s'en passer.
# TODO : avec axpy par exemple.
# https://fenicsproject.org/docs/dolfin/2016.2.0/cpp/programmers-reference/la/GenericVector.html #noqa
# * Components -> vector field
......
......@@ -447,10 +447,6 @@ def Gmsh2DPartFromRVE(cell: Gmsh2DRVE, nb_cells, part_name=None):
factory.synchronize()
for gp in phy_surfaces:
gp.add_gmsh()
all_gp = model.getPhysicalGroups()
dimtags_part = [(gp.dim, gp.tag) for gp in phy_surfaces]
remove_gp = [dt for dt in all_gp if not dt in dimtags_part]
model.removePhysicalGroups(remove_gp)
# ! Pour le moment, il semble impossible de réutiliser le tag d'un physical group
# ! qui a été supprimé.
# ! Voir : \Experimental\Test_traction_oct19\pb_complet\run_3\MWE_reuse_tag.py
......
......@@ -320,6 +320,7 @@ class Fenics2DRVE(FenicsPart):
facets = None
if plots:
# TODO : une seule méthode plot, appelée à chaque fois
plt.figure()
fe.plot(mesh)
if subdomains is not None:
......@@ -341,42 +342,43 @@ class Fenics2DRVE(FenicsPart):
if __name__ == "__main__":
pass
# geo.init_geo_tools()
# a = 1
# b, k = a, a/3
# panto_test = Gmsh2DRVE.pantograph(a, b, k, 0.1, nb_cells=(2, 3), soft_mat=False, name='panto_test')
# panto_test.main_mesh_refinement((0.1,0.5),(0.03,0.3),False)
# panto_test.mesh_generate()
# os.system(f"gmsh {panto_test.name}.msh &")
# a = 1
# b, k = a, a/3
# panto_test_offset = Gmsh2DRVE.pantograph(a, b, k, 0.1, nb_cells=(2,3), offset=(0.25,0.25), soft_mat=False, name='panto_test_offset')
# panto_test_offset.main_mesh_refinement((0.1,0.5),(0.03,0.3),False)
# panto_test_offset.mesh_generate()
# os.system(f"gmsh {panto_test_offset.name}.msh &")
# L, t = 1, 0.05
# a = L-3*t
# aux_sqr_test = Gmsh2DRVE.auxetic_square(a, L, t, nb_cells=(4,3), soft_mat=False, name='aux_square_test')
# os.system(f"gmsh {aux_sqr_test.name}.brep &")
# aux_sqr_test.main_mesh_refinement((0.1,0.3), (0.01,0.05), False)
# aux_sqr_test.mesh_generate()
# os.system(f"gmsh {aux_sqr_test.name}.msh &")
# a = 1
# b = a
# w = a/50
# r = 4*w
# beam_panto_test = Gmsh2DRVE.beam_pantograph(a, b, w, r, nb_cells=(1, 1), offset=(0., 0.), soft_mat=False, name='beam_panto_test')
# os.system(f"gmsh {beam_panto_test.name}.brep &")
# beam_panto_test.main_mesh_refinement((5*w, a/2),(w/5, w), True)
# beam_panto_test.mesh_generate()
# os.system(f"gmsh {beam_panto_test.name}.msh &")
# gmsh.option.setNumber('Mesh.SurfaceFaces',1) #Display faces of surface mesh?
# gmsh.fltk.run()
# TODO : Nettoyer
# geo.init_geo_tools()
# a = 1
# b, k = a, a/3
# panto_test = Gmsh2DRVE.pantograph(a, b, k, 0.1, nb_cells=(2, 3), soft_mat=False, name='panto_test')
# panto_test.main_mesh_refinement((0.1,0.5),(0.03,0.3),False)
# panto_test.mesh_generate()
# os.system(f"gmsh {panto_test.name}.msh &")
# a = 1
# b, k = a, a/3
# panto_test_offset = Gmsh2DRVE.pantograph(a, b, k, 0.1, nb_cells=(2,3), offset=(0.25,0.25), soft_mat=False, name='panto_test_offset')
# panto_test_offset.main_mesh_refinement((0.1,0.5),(0.03,0.3),False)
# panto_test_offset.mesh_generate()
# os.system(f"gmsh {panto_test_offset.name}.msh &")
# L, t = 1, 0.05
# a = L-3*t
# aux_sqr_test = Gmsh2DRVE.auxetic_square(a, L, t, nb_cells=(4,3), soft_mat=False, name='aux_square_test')
# os.system(f"gmsh {aux_sqr_test.name}.brep &")
# aux_sqr_test.main_mesh_refinement((0.1,0.3), (0.01,0.05), False)
# aux_sqr_test.mesh_generate()
# os.system(f"gmsh {aux_sqr_test.name}.msh &")
# a = 1
# b = a
# w = a/50
# r = 4*w
# beam_panto_test = Gmsh2DRVE.beam_pantograph(a, b, w, r, nb_cells=(1, 1), offset=(0., 0.), soft_mat=False, name='beam_panto_test')
# os.system(f"gmsh {beam_panto_test.name}.brep &")
# beam_panto_test.main_mesh_refinement((5*w, a/2),(w/5, w), True)
# beam_panto_test.mesh_generate()
# os.system(f"gmsh {beam_panto_test.name}.msh &")
# gmsh.option.setNumber('Mesh.SurfaceFaces',1) #Display faces of surface mesh?
# gmsh.fltk.run()
# msh.set_background_mesh(field)
......
......@@ -64,6 +64,7 @@ class PeriodicDomain(fe.SubDomain):
part_vectors : np.array
shape 2×2. Dimensions of the domain.
Some of them will be used as periodicity vectors.
#TODO : Ajouter précision : Vecteurs de périodicité en colonne
per_choice : str
Can contain X, Y (in the future : Z)
dim : int, optional
......
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