Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
HO_homog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Baptiste Durand
HO_homog
Commits
307bd4a2
Commit
307bd4a2
authored
Jul 01, 2019
by
Baptiste Durand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
homog2d demo corrections
Correction of the values given for constitutive tensors E,E and EGbis,EGbis.
parent
a0c08104
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
31 deletions
+22
-31
demo/demo_homog2d.py
demo/demo_homog2d.py
+22
-31
demo/loc_E12_u.pdf
demo/loc_E12_u.pdf
+0
-0
No files found.
demo/demo_homog2d.py
View file @
307bd4a2
...
...
@@ -12,24 +12,9 @@ import matplotlib.pyplot as plt
from
ho_homog
import
homog2d
as
hom
import
dolfin
as
fe
from
ho_homog
import
geometry
as
geo
from
pathlib
import
Path
import
numpy
as
np
import
logging
from
logging.handlers
import
RotatingFileHandler
plt
.
ioff
()
#* Logging
logger
=
logging
.
getLogger
(
__name__
)
logger
.
setLevel
(
logging
.
INFO
)
formatter
=
logging
.
Formatter
(
'%(asctime)s :: %(levelname)s :: %(message)s'
,
"%H:%M"
)
stream_handler
=
logging
.
StreamHandler
()
stream_handler
.
setLevel
(
logging
.
INFO
)
stream_handler
.
setFormatter
(
formatter
)
logger
.
addHandler
(
stream_handler
)
geo
.
init_geo_tools
()
geo
.
set_gmsh_option
(
"General.Verbosity"
,
2
)
...
...
@@ -46,22 +31,26 @@ fe.set_log_level(20)
# * Step 1 : Generating the mesh file
a
=
1
b
,
k
=
a
,
a
/
3
r
=
a
/
1e3
panto_test
=
mesh_generate_2D
.
Gmsh2DRVE
.
pantograph
(
a
,
b
,
k
,
r
,
nb_cells
=
(
1
,
1
),
soft_mat
=
True
,
name
=
'panto_with_soft'
)
panto_test
.
main_mesh_refinement
((
3
*
r
,
a
/
2
),
(
r
/
6
,
a
/
6
),
True
)
panto_test
.
soft_mesh_refinement
((
3
*
r
,
a
/
2
),
(
r
/
6
,
a
/
6
),
True
)
b
,
k
=
a
,
a
/
3
r
=
a
/
1e3
panto_test
=
mesh_generate_2D
.
Gmsh2DRVE
.
pantograph
(
a
,
b
,
k
,
r
,
nb_cells
=
(
1
,
1
),
soft_mat
=
True
,
name
=
"panto_with_soft"
)
panto_test
.
main_mesh_refinement
((
3
*
r
,
a
/
2
),
(
r
/
6
,
a
/
6
),
True
)
panto_test
.
soft_mesh_refinement
((
3
*
r
,
a
/
2
),
(
r
/
6
,
a
/
6
),
True
)
panto_test
.
mesh_generate
()
# * Step 2 : Defining the material mechanical properties for each subdomain
E1
,
nu1
=
1.
,
0.3
E2
,
nu2
=
E1
/
100.
,
nu1
E1
,
nu1
=
1.
0
,
0.3
E2
,
nu2
=
E1
/
100.0
,
nu1
E_nu_tuples
=
[(
E1
,
nu1
),
(
E2
,
nu2
)]
subdo_tags
=
tuple
([
subdo
.
tag
for
subdo
in
panto_test
.
phy_surf
])
# Here: soft_mat = True => tags = (1, 2)
subdo_tags
=
tuple
(
[
subdo
.
tag
for
subdo
in
panto_test
.
phy_surf
]
)
# Here: soft_mat = True => tags = (1, 2)
material_dict
=
dict
()
for
coeff
,
tag
in
zip
(
E_nu_tuples
,
subdo_tags
):
material_dict
[
tag
]
=
mat
.
Material
(
coeff
[
0
],
coeff
[
1
],
'cp'
)
material_dict
[
tag
]
=
mat
.
Material
(
coeff
[
0
],
coeff
[
1
],
"cp"
)
# * Step 3 : Creating the Python object that represents the RVE and is suitable for FEniCS
# * Two alternatives :
...
...
@@ -79,16 +68,16 @@ rve = part.Fenics2DRVE.gmsh_2_Fenics_2DRVE(panto_test, material_dict)
hom_model
=
hom
.
Fenics2DHomogenization
(
rve
)
# * Step 5 : Computing the homogenized consitutive tensors
DictOfLocalizationsU
,
DictOfLocalizationsSigma
,
DictOfLocalizationsEpsilon
,
DictOfConstitutiveTensors
=
hom_model
.
homogenizationScheme
(
'EG'
)
*
localization_dicts
,
constitutive_tensors
=
hom_model
.
homogenizationScheme
(
"EG"
)
# * Step 6 : Postprocessing
print
(
DictOfConstitutiveT
ensors
)
print
(
DictOfConstitutiveTensors
[
'E'
][
'E'
])
print
(
constitutive_t
ensors
)
print
(
constitutive_tensors
[
"E"
][
"E"
])
# *[[0.041 0.0156 0. ]
# * [0.0156 0.0688 0. ]
# * [0. 0. 0.0307]]
print
(
DictOfConstitutiveTensors
[
'EGbis'
][
'EGbis'
])
print
(
constitutive_tensors
[
"EGbis"
][
"EGbis"
])
# * [[ 0.2831 0.078 0. 0. 0. 0.0336]
# * [ 0.078 0.0664 -0. 0. -0. 0.0282]
# * [ 0. -0. 0.0756 0.0343 0.0243 -0. ]
...
...
@@ -96,9 +85,11 @@ print(DictOfConstitutiveTensors['EGbis']['EGbis'])
# * [ 0. -0. 0.0243 0.1113 0.1419 0. ]
# * [ 0.0336 0.0282 -0. 0. 0. 0.0541]]
plt
.
figure
()
fe
.
plot
(
fe
.
project
(
0.1
*
hom_model
.
localization
[
'E'
][
'U'
][
2
],
hom_model
.
V
),
mode
=
'displacement'
)
plt
.
savefig
(
"loc_EU.pdf"
)
fe
.
plot
(
fe
.
project
(
0.1
*
hom_model
.
localization
[
"E"
][
"U"
][
2
],
hom_model
.
V
),
mode
=
"displacement"
,
)
plt
.
savefig
(
"loc_E12_u.pdf"
)
plt
.
show
()
demo/loc_E
U
.pdf
→
demo/loc_E
12_u
.pdf
View file @
307bd4a2
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment