Commit ccbf9a09 authored by Baptiste Durand's avatar Baptiste Durand

Minor fixes or changes

parent 55cf5c62
.vscode/ .vscode/
old_lib & drafts/
issues & misc/
*.pyc *.pyc
*.brep *.brep
*.msh *.msh
*.xml *.xml
t1.py
t10.py
t10_modif.py
geometry_essai1_abandon.py
boolean.py
classes_geometriques_backup_13avril.py
draft.py
explore_library.py
gen.py
gmsh_brouillon.py
gmsh_mesh.py
gui.py
libgmsh.so
periodic.py
activity.log
test_convert_import_mesh/
TODO.txt
*.xdmf *.xdmf
*.h5 *.h5
\ No newline at end of file *.egg-info
*.egg-info/
ho_homog.egg-info/top_level.txt
...@@ -68,7 +68,7 @@ gmsh.option.setNumber("Geometry.MatchMeshTolerance", 1e-12) ...@@ -68,7 +68,7 @@ gmsh.option.setNumber("Geometry.MatchMeshTolerance", 1e-12)
a = 1 a = 1
b, k = a, a / 3 b, k = a, a / 3
r = a / 1e4 r = a / 1e3
gmsh.logger.start() gmsh.logger.start()
rve_geo = mesh_generate_2D.Gmsh2DRVE.pantograph(a, b, k, r, name="panto_rve") rve_geo = mesh_generate_2D.Gmsh2DRVE.pantograph(a, b, k, r, name="panto_rve")
process_gmsh_log(gmsh.logger.get()) process_gmsh_log(gmsh.logger.get())
...@@ -86,15 +86,15 @@ gmsh.logger.stop() ...@@ -86,15 +86,15 @@ gmsh.logger.stop()
gmsh.model.mesh.renumberNodes() gmsh.model.mesh.renumberNodes()
gmsh.model.mesh.renumberElements() gmsh.model.mesh.renumberElements()
gmsh.write(str(rve_geo.mesh_abs_path)) gmsh.write(str(rve_geo.mesh_abs_path))
rve_path, = msh_conversion(rve_geo.mesh_abs_path, ".xdmf") rve_path = msh_conversion(rve_geo.mesh_abs_path, ".xdmf")
# * Step 3 : Build the mesh of the part from the mesh of the RVE # * Step 3 : Build the mesh of the part from the mesh of the RVE
gmsh.logger.start() gmsh.logger.start()
part_geo = mesh_generate_2D.Gmsh2DPartFromRVE(rve_geo, (75, 1)) part_geo = mesh_generate_2D.Gmsh2DPartFromRVE(rve_geo, (10, 1))
process_gmsh_log(gmsh.logger.get()) process_gmsh_log(gmsh.logger.get())
gmsh.logger.stop() gmsh.logger.stop()
part_path, = msh_conversion(part_geo.mesh_abs_path, ".xdmf") part_path = msh_conversion(part_geo.mesh_abs_path, ".xdmf")
# * Step 4 : Defining the material properties # * Step 4 : Defining the material properties
E, nu = 1.0, 0.3 E, nu = 1.0, 0.3
...@@ -226,11 +226,11 @@ for key, scd_dict in hom_model.localization.items(): ...@@ -226,11 +226,11 @@ for key, scd_dict in hom_model.localization.items():
localztn_expr[key] = dict() localztn_expr[key] = dict()
for scd_key, localztn_fields in scd_dict.items(): for scd_key, localztn_fields in scd_dict.items():
updated_key2 = key_conversion[scd_key] updated_key2 = key_conversion[scd_key]
localztn_expr[key][ localztn_expr[key][updated_key2] = list()
updated_key2 # 1 field per component of U, E, EG and EGG
] = list() # 1 field per component of U, E, EG and EGG
for i, field in enumerate(localztn_fields): for i, field in enumerate(localztn_fields):
new_fields = list() # 1 field per component of U, Sigma and Epsilon new_fields = list()
# 1 field per component of U, Sigma and Epsilon
for component in field.split(): for component in field.split():
per_field = periodicity.PeriodicExpr( per_field = periodicity.PeriodicExpr(
component, rve_geo.gen_vect, degree=3 component, rve_geo.gen_vect, degree=3
......
...@@ -120,8 +120,10 @@ class Fenics2DHomogenization(object): ...@@ -120,8 +120,10 @@ class Fenics2DHomogenization(object):
elif self._solver["type"] == "LU": elif self._solver["type"] == "LU":
self.solver = fe.LUSolver(self.K, self._solver["method"]) self.solver = fe.LUSolver(self.K, self._solver["method"])
self.solver.parameters["symmetric"] = True self.solver.parameters["symmetric"] = True
if not self._solver["preconditioner"] is None: try:
self.solver.parameters.preconditioner = self._solver["preconditioner"] self.solver.parameters.preconditioner = self._solver["preconditioner"]
except KeyError:
pass
# fe.info(self.solver.parameters, True) # fe.info(self.solver.parameters, True)
self.localization = dict() self.localization = dict()
......
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