Skip to content

Commit

Permalink
Merge branch 'master' into adding-plane-strain-Timoshenko-beams
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCornejo committed Jan 6, 2025
2 parents c3b1294 + 885a57e commit 5e4e385
Show file tree
Hide file tree
Showing 130 changed files with 1,863 additions and 1,128 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ void KratosConstitutiveLawsApplication::Register()
KRATOS_REGISTER_CONSTITUTIVE_LAW("SerialParallelRuleOfMixturesLaw", mSerialParallelRuleOfMixturesLaw);

// Anisotropic law
KRATOS_REGISTER_CONSTITUTIVE_LAW("GenericAnisotropicPlaneStrain2DLaw", mGenericAnisotropicPlaneStrain2DLaw);
KRATOS_REGISTER_CONSTITUTIVE_LAW("GenericAnisotropic3DLaw", mGenericAnisotropic3DLaw);
KRATOS_REGISTER_CONSTITUTIVE_LAW("GenericAnisotropicPlaneStress2DLaw", mGenericAnisotropicPlaneStress2DLaw);

/// Plasticity

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
#include "custom_constitutive/small_strains/plastic_damage/generic_small_strain_plastic_damage_model.h"
#include "custom_constitutive/small_strains/damage/generic_small_strain_orthotropic_damage.h"
#include "custom_constitutive/composites/serial_parallel_rule_of_mixtures_law.h"
#include "custom_constitutive/small_strains/anisotropy_orthotropy/generic_anisotropic_3d_law.h"
#include "custom_constitutive/small_strains/anisotropy_orthotropy/generic_anisotropic_law.h"
#include "custom_constitutive/small_strains/anisotropy_orthotropy/generic_anisotropic_plane_stress_2d_law.h"
#include "custom_constitutive/small_strains/linear/multi_linear_elastic_1d_law.h"
#include "custom_constitutive/small_strains/linear/multi_linear_isotropic_plane_stress_2d.h"
#include "custom_constitutive/small_strains/damage/generic_small_strain_isotropic_damage_plane_stress.h"
Expand Down Expand Up @@ -623,7 +624,9 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) KratosConstitutiveLawsApplicatio
const ParallelRuleOfMixturesLaw<2> mParallelRuleOfMixturesLaw2D;

// Anisotropic law
const GenericAnisotropic3DLaw mGenericAnisotropic3DLaw;
const GenericAnisotropicLaw<2> mGenericAnisotropicPlaneStrain2DLaw;
const GenericAnisotropicLaw<3> mGenericAnisotropic3DLaw;
const GenericAnisotropicPlaneStress2DLaw mGenericAnisotropicPlaneStress2DLaw;

const AssociativePlasticDamageModel <VonMisesYieldSurface<VonMisesPlasticPotential<6>>> mAssociativePlasticDamageModel3DVonMises;
const AssociativePlasticDamageModel <DruckerPragerYieldSurface<DruckerPragerPlasticPotential<6>>> mAssociativePlasticDamageModel3DDruckerPrager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ void ParallelRuleOfMixturesLaw<TDim>::CalculateRotationMatrix(
const double euler_angle_theta = layers_euler_angles[3*Layer + 1];
const double euler_angle_hi = layers_euler_angles[3*Layer + 2];

BoundedMatrix<double, 3, 3> rotation_matrix;
BoundedMatrix<double, Dimension, Dimension> rotation_matrix;

if (std::abs(euler_angle_phi) + std::abs(euler_angle_theta) + std::abs(euler_angle_hi) > machine_tolerance) {
AdvancedConstitutiveLawUtilities<VoigtSize>::CalculateRotationOperator(euler_angle_phi, euler_angle_theta, euler_angle_hi, rotation_matrix);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// license: structural_mechanics_application/license.txt
//
// Main authors: Alejandro Cornejo
// Collaborator: Lucia Barbu
//
//

#pragma once
Expand All @@ -30,6 +30,9 @@ namespace Kratos
///@name Type Definitions
///@{

/// The size type definition
using SizeType = std::size_t;

///@}
///@name Enum's
///@{
Expand All @@ -41,48 +44,45 @@ namespace Kratos
///@}
///@name Kratos Classes
///@{
/**
* @class GenericAnisotropic3DLaw
* @ingroup StructuralMechanicsApplication
* @brief This CL takes into account the material anisotropy in terms of
* young modulus, poisson ratio, orientation and strengths.
* @details See "Comportamiento mecánico de los materiales compuestos" by S. Oller,
* Chapter "Anisotropía mecánica"

/*
* @class GenericAnisotropicLaw
* @ingroup ConstitutiveLawsApplication
* @brief This CL takes into account the material anisotropy in terms of young modulus, poisson ratio, orientation and strengths. 3D CLs and plane strain.
* @details See "Nonlinear behavior of existing pre-tensioned concrete beams: Experimental study and finite element modeling with the constitutive Serial-Parallel rule of mixtures", DOI: https://doi.org/10.1016/j.istruc.2024.106990
* @author Alejandro Cornejo
*/
class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
template <SizeType TDim>
class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropicLaw
: public ConstitutiveLaw
{
public:
public:
///@name Type Definitions
///@{

/// The node definition
typedef Node NodeType;
using NodeType = Node;

/// The geometry definition
typedef Geometry<NodeType> GeometryType;
using GeometryType = Geometry<NodeType>;

/// Definition of the machine precision tolerance
static constexpr double machine_tolerance = std::numeric_limits<double>::epsilon();

/// The size type definition
typedef std::size_t SizeType;

/// Static definition of the dimension
static constexpr SizeType Dimension = 3;
static constexpr SizeType Dimension = TDim;

/// Static definition of the VoigtSize
static constexpr SizeType VoigtSize = 6;
static constexpr SizeType VoigtSize = (Dimension == 3) ? 6 : 3;

/// The definition of the bounded matrix type
typedef BoundedMatrix<double, 3, 3> BoundedMatrixType;
using BoundedMatrixType = BoundedMatrix<double, Dimension, Dimension>;

/// The definition of the bounded matrix type
typedef BoundedMatrix<double, VoigtSize, VoigtSize> BoundedMatrixVoigtType;
using BoundedMatrixVoigtType = BoundedMatrix<double, VoigtSize, VoigtSize>;

/// Counted pointer of GenericAnisotropic3DLaw
KRATOS_CLASS_POINTER_DEFINITION(GenericAnisotropic3DLaw);
/// Counted pointer of GenericAnisotropicLaw
KRATOS_CLASS_POINTER_DEFINITION(GenericAnisotropicLaw);

///@}
///@name Life Cycle
Expand All @@ -91,7 +91,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
/**
* Constructor.
*/
GenericAnisotropic3DLaw()
GenericAnisotropicLaw()
{
}

Expand All @@ -100,11 +100,11 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
*/
ConstitutiveLaw::Pointer Clone() const override
{
return Kratos::make_shared<GenericAnisotropic3DLaw>(*this);
return Kratos::make_shared<GenericAnisotropicLaw<TDim>>(*this);
}

// Copy constructor
GenericAnisotropic3DLaw(GenericAnisotropic3DLaw const& rOther)
GenericAnisotropicLaw(GenericAnisotropicLaw const& rOther)
: ConstitutiveLaw(rOther),
mpIsotropicCL(rOther.mpIsotropicCL)
{
Expand All @@ -113,7 +113,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
/**
* Destructor.
*/
~GenericAnisotropic3DLaw() override
~GenericAnisotropicLaw() override
{
}

Expand All @@ -137,15 +137,15 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
*/
SizeType WorkingSpaceDimension() override
{
return 3;
return Dimension;
};

/**
* @brief Voigt tensor size:
*/
SizeType GetStrainSize() const override
{
return 6;
return VoigtSize;
};

/**
Expand Down Expand Up @@ -311,6 +311,13 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
BoundedMatrixVoigtType& rAsInv
);

/**
* @brief This computes the rotation matrix, from global to local
*/
void CalculateRotationMatrixVoigt(
const Properties& rProperties,
BoundedMatrixVoigtType &rT);

/**
* @brief This computes the mapper operator between the strain in the isotropic
* "ficticious" space and the real anisotropic space
Expand All @@ -323,8 +330,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
const BoundedMatrixVoigtType& rAnisotropicElasticMatrix,
const BoundedMatrixVoigtType& rIsotropicElasticMatrix,
const BoundedMatrixVoigtType &rAs,
BoundedMatrixVoigtType& rAe
);
BoundedMatrixVoigtType& rAe);

/**
* Initialize the material response in terms of 2nd Piola-Kirchhoff stresses
Expand All @@ -348,15 +354,22 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
return mpIsotropicCL->RequiresFinalizeMaterialResponse();
}

void CalculateOrthotropicElasticMatrix(
/**
* @brief This method computes the orthotropic elastic constitutive matrix
* This method is overriden in the derived class for plane stress
*/
virtual void CalculateOrthotropicElasticMatrix(
BoundedMatrixVoigtType &rElasticityTensor,
const Properties &rMaterialProperties);

int Check(const Properties &rMaterialProperties,
const GeometryType &rElementGeometry,
const ProcessInfo &rCurrentProcessInfo) const override;
/**
* @brief This method checks the properties in the nested CL
*/
int Check(
const Properties &rMaterialProperties,
const GeometryType &rElementGeometry,
const ProcessInfo &rCurrentProcessInfo) const override;

void CalculateTangentTensor(ConstitutiveLaw::Parameters &rValues);
///@}
///@name Access
///@{
Expand All @@ -375,7 +388,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw

///@}

protected:
protected:
///@name Protected static Member Variables
///@{

Expand Down Expand Up @@ -403,7 +416,6 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
mpIsotropicCL = pIsotropicConstitutiveLaw;
}


///@}
///@name Protected Operations
///@{
Expand All @@ -421,7 +433,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
///@{

///@}
private:
private:
///@name Static Member Variables
///@{

Expand All @@ -439,10 +451,6 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw
///@name Private Operations
///@{

void CalculateCauchyGreenStrain(
ConstitutiveLaw::Parameters &rValues,
Vector &rStrainVector);

///@}
///@name Private Access
///@{
Expand Down Expand Up @@ -473,6 +481,6 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) GenericAnisotropic3DLaw

///@}

}; // Class GenericAnisotropic3DLaw
}; // Class GenericAnisotropicLaw

} // namespace Kratos
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// KRATOS ___ _ _ _ _ _ __ _
// / __\___ _ __ ___| |_(_) |_ _ _| |_(_)_ _____ / / __ ___ _____ /_\ _ __ _ __
// / / / _ \| '_ \/ __| __| | __| | | | __| \ \ / / _ \/ / / _` \ \ /\ / / __| //_\\| '_ \| '_ |
// / /__| (_) | | | \__ \ |_| | |_| |_| | |_| |\ V / __/ /__| (_| |\ V V /\__ \/ _ \ |_) | |_) |
// \____/\___/|_| |_|___/\__|_|\__|\__,_|\__|_| \_/ \___\____/\__,_| \_/\_/ |___/\_/ \_/ .__/| .__/
// |_| |_|
//
// License: BSD License
// license: structural_mechanics_application/license.txt
//
// Main authors: Alejandro Cornejo
//
//

// System includes

// External includes

// Project includes

#include "generic_anisotropic_plane_stress_2d_law.h"
#include "custom_utilities/advanced_constitutive_law_utilities.h"

namespace Kratos
{

/***********************************************************************************/
/***********************************************************************************/

ConstitutiveLaw::Pointer GenericAnisotropicPlaneStress2DLaw::Create(Kratos::Parameters NewParameters) const
{
return Kratos::make_shared<GenericAnisotropicPlaneStress2DLaw>();
}

/***********************************************************************************/
/***********************************************************************************/

void GenericAnisotropicPlaneStress2DLaw::CalculateOrthotropicElasticMatrix(
BoundedMatrixVoigtType& rElasticityTensor,
const Properties& rMaterialProperties)
{
AdvancedConstitutiveLawUtilities<VoigtSize>::CalculateOrthotropicElasticMatrixPlaneStress(rElasticityTensor, rMaterialProperties);
}

/***********************************************************************************/
/***********************************************************************************/

} // namespace Kratos
Loading

0 comments on commit 5e4e385

Please sign in to comment.