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
M
mfront-wrapper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
navier-fenics
mfront-wrapper
Commits
925dfdec
Commit
925dfdec
authored
Feb 24, 2020
by
Jeremy BLEYER
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added integration type
parent
6879e9ac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
19 deletions
+24
-19
demos/logarithmic_strain_plasticity.py
demos/logarithmic_strain_plasticity.py
+1
-1
demos/small_strain_vonMises_plasticity.py
demos/small_strain_vonMises_plasticity.py
+2
-2
materials/src/Makefile.mfront
materials/src/Makefile.mfront
+2
-2
materials/src/targets.lst
materials/src/targets.lst
+14
-3
mfront_wrapper/nonlinear_problem.py
mfront_wrapper/nonlinear_problem.py
+5
-11
No files found.
demos/logarithmic_strain_plasticity.py
View file @
925dfdec
...
...
@@ -33,7 +33,7 @@ file_results.parameters["functions_share_mesh"] = True
selfweight
=
Expression
((
"0"
,
"0"
,
"-t*qmax"
),
t
=
0.
,
qmax
=
50e6
,
degree
=
0
)
material
=
mf
.
MFrontNonlinearMaterial
(
'../materials/src/libBehaviour.so'
,
material
=
mf
.
MFrontNonlinearMaterial
(
"../materials/src/libBehaviour.so"
,
"LogarithmicStrainPlasticity"
)
problem
=
mf
.
MFrontNonlinearProblem
(
u
,
material
)
problem
.
set_loading
(
dot
(
selfweight
,
u
)
*
dx
)
...
...
demos/small_strain_vonMises_plasticity.py
View file @
925dfdec
...
...
@@ -40,8 +40,8 @@ for hypothesis in ["plane_strain", "axisymmetric"]:
"PoissonRatio"
:
nu
,
"HardeningSlope"
:
H
,
"YieldStrength"
:
sig0
}
material
=
mf
.
MFrontNonlinearMaterial
(
'../materials/src/libBehaviour.so'
,
'IsotropicLinearHardeningPlasticity'
,
material
=
mf
.
MFrontNonlinearMaterial
(
"../materials/src/libBehaviour.so"
,
"IsotropicLinearHardeningPlasticity"
,
hypothesis
=
hypothesis
,
material_properties
=
mat_prop
)
problem
=
mf
.
MFrontNonlinearProblem
(
u
,
material
,
quadrature_degree
=
4
)
...
...
materials/src/Makefile.mfront
View file @
925dfdec
...
...
@@ -12,7 +12,7 @@ INCLUDES := -I../include \
CXXFLAGS
:=
-Wall
-Wfatal-errors
-ansi
$(
shell
tfel-config
--oflags
)
-fPIC
$(INCLUDES)
SRCCXX
=
IsotropicLinearHardeningPlasticity-generic.cxx IsotropicLinearHardeningPlasticity.cxx LogarithmicStrainPlasticity-generic.cxx LogarithmicStrainPlasticity.cxx
SRCCXX
=
IsotropicLinearHardeningPlasticity-generic.cxx IsotropicLinearHardeningPlasticity.cxx LogarithmicStrainPlasticity-generic.cxx LogarithmicStrainPlasticity.cxx
StationaryHeatTransfer-generic.cxx StationaryHeatTransfer.cxx
makefiles1
=
$(SRCCXX:.cxx=.d)
makefiles2
=
$(makefiles1:.cpp=.d)
...
...
@@ -22,7 +22,7 @@ makefiles = $(makefiles2)
all
:
libBehaviour.so
libBehaviour.so
:
IsotropicLinearHardeningPlasticity-generic.o IsotropicLinearHardeningPlasticity.o LogarithmicStrainPlasticity-generic.o LogarithmicStrainPlasticity.o
libBehaviour.so
:
IsotropicLinearHardeningPlasticity-generic.o IsotropicLinearHardeningPlasticity.o LogarithmicStrainPlasticity-generic.o LogarithmicStrainPlasticity.o
StationaryHeatTransfer-generic.o StationaryHeatTransfer.o
@
$(CXX)
-shared
$^
-o
$@
-L
"
$(
strip
$(
shell
tfel-config --library-path
))
"
$(
patsubst
%,-l%,
$(
shell
tfel-config
--library-dependency
--material
--mfront-profiling
--physical-constants
))
install
:
...
...
materials/src/targets.lst
View file @
925dfdec
...
...
@@ -9,7 +9,9 @@ sources : {
"IsotropicLinearHardeningPlasticity-generic.cxx",
"IsotropicLinearHardeningPlasticity.cxx",
"LogarithmicStrainPlasticity-generic.cxx",
"LogarithmicStrainPlasticity.cxx"
"LogarithmicStrainPlasticity.cxx",
"StationaryHeatTransfer-generic.cxx",
"StationaryHeatTransfer.cxx"
};
cppflags : {
"$(shell tfel-config --cppflags --compiler-flags)"
...
...
@@ -33,7 +35,12 @@ epts : {
"LogarithmicStrainPlasticity_Axisymmetrical",
"LogarithmicStrainPlasticity_PlaneStrain",
"LogarithmicStrainPlasticity_GeneralisedPlaneStrain",
"LogarithmicStrainPlasticity_Tridimensional"
"LogarithmicStrainPlasticity_Tridimensional",
"StationaryHeatTransfer_AxisymmetricalGeneralisedPlaneStrain",
"StationaryHeatTransfer_Axisymmetrical",
"StationaryHeatTransfer_PlaneStrain",
"StationaryHeatTransfer_GeneralisedPlaneStrain",
"StationaryHeatTransfer_Tridimensional"
};
};
headers : {
...
...
@@ -44,6 +51,10 @@ headers : {
"MFront/GenericBehaviour/LogarithmicStrainPlasticity-generic.hxx",
"TFEL/Material/LogarithmicStrainPlasticity.hxx",
"TFEL/Material/LogarithmicStrainPlasticityBehaviourData.hxx",
"TFEL/Material/LogarithmicStrainPlasticityIntegrationData.hxx"
"TFEL/Material/LogarithmicStrainPlasticityIntegrationData.hxx",
"MFront/GenericBehaviour/StationaryHeatTransfer-generic.hxx",
"TFEL/Material/StationaryHeatTransfer.hxx",
"TFEL/Material/StationaryHeatTransferBehaviourData.hxx",
"TFEL/Material/StationaryHeatTransferIntegrationData.hxx"
};
};
mfront_wrapper/nonlinear_problem.py
View file @
925dfdec
...
...
@@ -13,6 +13,7 @@ class MFrontNonlinearProblem(NonlinearProblem):
self
.
material
=
material
# print(self.material.hypothesis)
self
.
axisymmetric
=
self
.
material
.
hypothesis
==
mgis_bv
.
Hypothesis
.
Axisymmetrical
self
.
integration_type
=
mgis_bv
.
IntegrationType
.
IntegrationWithConsistentTangentOperator
self
.
quadrature_degree
=
quadrature_degree
self
.
set_quadrature_function_spaces
()
...
...
@@ -106,8 +107,8 @@ class MFrontNonlinearProblem(NonlinearProblem):
self
.
strain
=
Function
(
self
.
Wsig
,
name
=
"Current strain increment"
)
self
.
Ct
=
Function
(
self
.
WCt
,
name
=
"Consistent tangent operator"
)
it
=
mgis_bv
.
IntegrationType
.
PredictionWithElasticOperator
mgis_bv
.
integrate
(
self
.
material
.
data_manager
,
it
,
0
,
0
,
self
.
material
.
data_manager
.
n
);
mgis_bv
.
integrate
(
self
.
material
.
data_manager
,
self
.
integration_type
,
0
,
0
,
self
.
material
.
data_manager
.
n
);
if
self
.
finite_strain
:
local_project
(
self
.
strain_measure
(
self
.
u
),
self
.
Wsig
,
self
.
dx
,
self
.
strain
)
# copy the strain values to `MGIS`
...
...
@@ -120,8 +121,8 @@ class MFrontNonlinearProblem(NonlinearProblem):
# copy the strain values to `MGIS`
self
.
material
.
data_manager
.
s1
.
gradients
[:,
:]
=
self
.
strain
.
vector
().
get_local
().
reshape
((
self
.
material
.
data_manager
.
n
,
self
.
strain_dim
))
# integrate the behaviour
it
=
mgis_bv
.
IntegrationType
.
IntegrationWithConsistentTangentOperator
mgis_bv
.
integrate
(
self
.
material
.
data_manager
,
it
,
0
,
0
,
self
.
material
.
data_manager
.
n
);
mgis_bv
.
integrate
(
self
.
material
.
data_manager
,
self
.
integration_type
,
0
,
0
,
self
.
material
.
data_manager
.
n
);
# getting the stress and consistent tangent operator back to
# the FEniCS world.
if
self
.
finite_strain
:
...
...
@@ -155,13 +156,6 @@ class MFrontNonlinearProblem(NonlinearProblem):
self
.
state_variables
.
append
([
Function
(
W
,
name
=
name
),
position
])
return
self
.
state_variables
[
-
1
][
0
]
# def get_state_variable(self, var, name=None, position=None):
# sizes = self.material.get_state_variable_sizes()
# if name is not None:
# position = self.material.get_state_variable_names().index(name)
# size = sizes[position]
## print(position, size)
# var.vector().set_local(self.material.data_manager.s1.internal_state_variables[:, position:(position+size)].flatten())
def
form
(
self
,
A
,
P
,
b
,
x
):
self
.
update_constitutive_law
(
self
.
u
)
...
...
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