Commit 925dfdec authored by Jeremy BLEYER's avatar Jeremy BLEYER

Added integration type

parent 6879e9ac
......@@ -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)
......
......@@ -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)
......
......@@ -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 :
......
......@@ -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"
};
};
......@@ -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)
......
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