diff --git a/demos/logarithmic_strain_plasticity.py b/demos/logarithmic_strain_plasticity.py index be13c1367a231462ebe80d65fc5da9c82733d7a8..05da23715cd5a1f9f0900b679e978dbc8ccc2bf1 100644 --- a/demos/logarithmic_strain_plasticity.py +++ b/demos/logarithmic_strain_plasticity.py @@ -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) diff --git a/demos/small_strain_vonMises_plasticity.py b/demos/small_strain_vonMises_plasticity.py index 0e565758a9cf93b587a4e6515d89b8757c70368b..c624717ddb5b828ed5a34591883d2051700e44ce 100644 --- a/demos/small_strain_vonMises_plasticity.py +++ b/demos/small_strain_vonMises_plasticity.py @@ -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) diff --git a/materials/src/Makefile.mfront b/materials/src/Makefile.mfront index be7355dcca5a1d3ed86d8fcaa9446594e7edafda..370212a76ff5de9cd61263b8aefadaf2d952854c 100644 --- a/materials/src/Makefile.mfront +++ b/materials/src/Makefile.mfront @@ -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 : diff --git a/materials/src/targets.lst b/materials/src/targets.lst index cb48aaa529559f214f3b0b052a427b4e8db28d45..efa22a36cce1e6e04f990653eb327b20f7cd0651 100644 --- a/materials/src/targets.lst +++ b/materials/src/targets.lst @@ -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" }; }; diff --git a/mfront_wrapper/nonlinear_problem.py b/mfront_wrapper/nonlinear_problem.py index b740ecef3674b138300ddf27d07b5b084a588727..bdfc6e09b24a00a57088728cafea35ffc73154b8 100644 --- a/mfront_wrapper/nonlinear_problem.py +++ b/mfront_wrapper/nonlinear_problem.py @@ -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)