IsotropicLinearHardeningPlasticity-generic.cxx 8.19 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
/*!
* \file   IsotropicLinearHardeningPlasticity-generic.cxx
* \brief  This file implements the umat interface for the IsotropicLinearHardeningPlasticity behaviour law
* \author Thomas Helfer
* \date   14 / 10 / 2016
*/

#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif /* NOMINMAX */
#include <windows.h>
#ifdef small
#undef small
#endif /* small */
#endif /* _WIN32 */

#ifndef MFRONT_SHAREDOBJ
#define MFRONT_SHAREDOBJ TFEL_VISIBILITY_EXPORT
#endif /* MFRONT_SHAREDOBJ */

#include<iostream>
#include<cstdlib>
#include"TFEL/Material/OutOfBoundsPolicy.hxx"
#include"TFEL/Material/IsotropicLinearHardeningPlasticity.hxx"
#include"MFront/GenericBehaviour/Integrate.hxx"

#include"MFront/GenericBehaviour/IsotropicLinearHardeningPlasticity-generic.hxx"

static tfel::material::OutOfBoundsPolicy&
IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy(){
using namespace tfel::material;
static OutOfBoundsPolicy policy = None;
return policy;
}

#ifdef __cplusplus
extern "C"{
#endif /* __cplusplus */

41 42 43
MFRONT_SHAREDOBJ const char* 
IsotropicLinearHardeningPlasticity_build_id = "";

44 45 46 47
MFRONT_SHAREDOBJ const char* 
IsotropicLinearHardeningPlasticity_mfront_ept = "IsotropicLinearHardeningPlasticity";

MFRONT_SHAREDOBJ const char* 
48
IsotropicLinearHardeningPlasticity_tfel_version = "3.3.0";
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_mfront_mkt = 1u;

MFRONT_SHAREDOBJ const char *
IsotropicLinearHardeningPlasticity_mfront_interface = "Generic";

MFRONT_SHAREDOBJ const char *
IsotropicLinearHardeningPlasticity_src = "IsotropicLinearHardeningPlasticity.mfront";

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nModellingHypotheses = 5u;

MFRONT_SHAREDOBJ const char * 
IsotropicLinearHardeningPlasticity_ModellingHypotheses[5u] = {"AxisymmetricalGeneralisedPlaneStrain",
"Axisymmetrical",
"PlaneStrain",
"GeneralisedPlaneStrain",
"Tridimensional"};

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nMainVariables = 1;
MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nGradients = 1;

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_GradientsTypes[1] = {1};
MFRONT_SHAREDOBJ const char * IsotropicLinearHardeningPlasticity_Gradients[1] = {"Strain"};
MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nThermodynamicForces = 1;

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_ThermodynamicForcesTypes[1] = {1};
MFRONT_SHAREDOBJ const char * IsotropicLinearHardeningPlasticity_ThermodynamicForces[1] = {"Stress"};
MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nTangentOperatorBlocks = 2;

MFRONT_SHAREDOBJ const char * IsotropicLinearHardeningPlasticity_TangentOperatorBlocks[2] = {"Stress",
"Strain"};
MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_BehaviourType = 1u;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_BehaviourKinematic = 1u;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_SymmetryType = 0u;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_ElasticSymmetryType = 0u;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_UsableInPurelyImplicitResolution = 1;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nMaterialProperties = 4u;

MFRONT_SHAREDOBJ const char *IsotropicLinearHardeningPlasticity_MaterialProperties[4u] = {"YoungModulus",
"PoissonRatio",
"HardeningSlope",
"YieldStrength"};

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nInternalStateVariables = 2;
MFRONT_SHAREDOBJ const char * IsotropicLinearHardeningPlasticity_InternalStateVariables[2] = {"ElasticStrain",
"EquivalentPlasticStrain"};
MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_InternalStateVariablesTypes [] = {1,0};

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nExternalStateVariables = 0;
MFRONT_SHAREDOBJ const char * const * IsotropicLinearHardeningPlasticity_ExternalStateVariables = nullptr;

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_nParameters = 2;
MFRONT_SHAREDOBJ const char * IsotropicLinearHardeningPlasticity_Parameters[2] = {"minimal_time_step_scaling_factor",
"maximal_time_step_scaling_factor"};
MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_ParametersTypes [] = {0,0};

MFRONT_SHAREDOBJ double IsotropicLinearHardeningPlasticity_minimal_time_step_scaling_factor_ParameterDefaultValue = 0.1;

112
MFRONT_SHAREDOBJ double IsotropicLinearHardeningPlasticity_maximal_time_step_scaling_factor_ParameterDefaultValue = 1.7976931348623e+308;
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191

MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_requiresStiffnessTensor = 0;
MFRONT_SHAREDOBJ unsigned short IsotropicLinearHardeningPlasticity_requiresThermalExpansionCoefficientTensor = 0;

MFRONT_SHAREDOBJ void
IsotropicLinearHardeningPlasticity_setOutOfBoundsPolicy(const int p){
if(p==0){
IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy() = tfel::material::None;
} else if(p==1){
IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy() = tfel::material::Warning;
} else if(p==2){
IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy() = tfel::material::Strict;
} else {
std::cerr << "IsotropicLinearHardeningPlasticity_setOutOfBoundsPolicy: invalid argument\n";
}
}

MFRONT_SHAREDOBJ int
IsotropicLinearHardeningPlasticity_setParameter(const char *const key,const double value){
using tfel::material::IsotropicLinearHardeningPlasticityParametersInitializer;
auto& i = IsotropicLinearHardeningPlasticityParametersInitializer::get();
try{
i.set(key,value);
} catch(std::runtime_error& e){
std::cerr << e.what() << std::endl;
return 0;
}
return 1;
}

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_AxisymmetricalGeneralisedPlaneStrain(MFront_GB_BehaviourData* const d){
using namespace tfel::material;
using real = mfront::gb::real;
constexpr const auto h = ModellingHypothesis::AXISYMMETRICALGENERALISEDPLANESTRAIN;
using Behaviour = IsotropicLinearHardeningPlasticity<h,real,false>;
const auto r = mfront::gb::integrate<Behaviour>(*d,Behaviour::STANDARDTANGENTOPERATOR, IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy());
return r;
} // end of IsotropicLinearHardeningPlasticity_AxisymmetricalGeneralisedPlaneStrain

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_Axisymmetrical(MFront_GB_BehaviourData* const d){
using namespace tfel::material;
using real = mfront::gb::real;
constexpr const auto h = ModellingHypothesis::AXISYMMETRICAL;
using Behaviour = IsotropicLinearHardeningPlasticity<h,real,false>;
const auto r = mfront::gb::integrate<Behaviour>(*d,Behaviour::STANDARDTANGENTOPERATOR, IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy());
return r;
} // end of IsotropicLinearHardeningPlasticity_Axisymmetrical

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_PlaneStrain(MFront_GB_BehaviourData* const d){
using namespace tfel::material;
using real = mfront::gb::real;
constexpr const auto h = ModellingHypothesis::PLANESTRAIN;
using Behaviour = IsotropicLinearHardeningPlasticity<h,real,false>;
const auto r = mfront::gb::integrate<Behaviour>(*d,Behaviour::STANDARDTANGENTOPERATOR, IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy());
return r;
} // end of IsotropicLinearHardeningPlasticity_PlaneStrain

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_GeneralisedPlaneStrain(MFront_GB_BehaviourData* const d){
using namespace tfel::material;
using real = mfront::gb::real;
constexpr const auto h = ModellingHypothesis::GENERALISEDPLANESTRAIN;
using Behaviour = IsotropicLinearHardeningPlasticity<h,real,false>;
const auto r = mfront::gb::integrate<Behaviour>(*d,Behaviour::STANDARDTANGENTOPERATOR, IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy());
return r;
} // end of IsotropicLinearHardeningPlasticity_GeneralisedPlaneStrain

MFRONT_SHAREDOBJ int IsotropicLinearHardeningPlasticity_Tridimensional(MFront_GB_BehaviourData* const d){
using namespace tfel::material;
using real = mfront::gb::real;
constexpr const auto h = ModellingHypothesis::TRIDIMENSIONAL;
using Behaviour = IsotropicLinearHardeningPlasticity<h,real,false>;
const auto r = mfront::gb::integrate<Behaviour>(*d,Behaviour::STANDARDTANGENTOPERATOR, IsotropicLinearHardeningPlasticity_getOutOfBoundsPolicy());
return r;
} // end of IsotropicLinearHardeningPlasticity_Tridimensional

#ifdef __cplusplus
}
#endif /* __cplusplus */