Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
264421b
initial creation of the base 3d beam element in kratos
juancamarotti Mar 31, 2026
02f00f1
new methods added to the base 3d beam element
juancamarotti Apr 2, 2026
fc33704
initial creation of the bernoulli 3d beam element
juancamarotti Apr 2, 2026
4235074
Merge branch 'master' into iga/3d_beam_implementation
juancamarotti Apr 2, 2026
a43e201
adding the bernoulli beam elemen to kratos
juancamarotti Apr 2, 2026
4f48fe0
change names
juancamarotti Apr 2, 2026
320cfcb
Added beam_base_element_3d and non_linear_bernoulli_beam_element_3d
Sep 16, 2026
a535c9d
debugging fixes and tests are running
Nov 14, 2026
e130298
Merge branch 'master' into iga/3d_beam_implementation
juancamarotti Nov 18, 2026
6f46332
revert noise changes in some files
juancamarotti Nov 18, 2026
2de6a0f
erase unrelated file
juancamarotti Nov 18, 2026
fa435a1
erase unnecessary include
juancamarotti Nov 18, 2026
7f20b0d
revert ref modeler to master
juancamarotti Nov 18, 2026
2fa0004
add test to the CI suite
juancamarotti Nov 18, 2026
2571e1d
change test name
juancamarotti Nov 18, 2026
b3c5293
erase CROSS_AREA
juancamarotti Nov 19, 2026
93161b4
change test name
juancamarotti Nov 19, 2026
2dbb027
revert changes in nurbs curve
juancamarotti Nov 19, 2026
d36399b
solve bug in the constitutive law
juancamarotti Nov 19, 2026
c0fe250
clean the tests and rewrite it
juancamarotti Nov 19, 2026
ea5b54a
[IGA] Compute the initial beam frame per curve in ComputeBeamVectorsP…
juancamarotti Nov 19, 2026
20c3ec5
[IGA] Fix cross-section orientation and torsional stress of the Berno…
juancamarotti Nov 19, 2026
3955b59
[IGA] Format beam element files
juancamarotti Nov 19, 2026
7f5069a
[IGA] Address review of the Bernoulli beam element
juancamarotti Nov 19, 2026
a6f45f7
[IGA] Add Alicia Knauer to the beam authors
juancamarotti Nov 19, 2026
d4fc37c
[IGA] Add dynamics to the Bernoulli beam and address Max's review
juancamarotti Nov 20, 2026
df01fd7
[IGA] Speed up the beam dynamics and elastica tests
juancamarotti Nov 20, 2026
253063f
[IGA] Remove unused beam variables
juancamarotti Nov 20, 2026
24a6250
[IGA] Make the beam torsional constant optional
juancamarotti Nov 23, 2026
93f82cb
[IGA] Replace the hand-written product loops of the Bernoulli beam
juancamarotti Nov 23, 2026
3f0cb5c
[IGA] Write the beam variation products block-wise
juancamarotti Nov 23, 2026
f4af69d
Move VTK HDF attribute changes to a separate PR
juancamarotti Nov 26, 2026
9e1d3b7
clarifications in the tests
juancamarotti Nov 26, 2026
a32b4ce
change beam base element name
juancamarotti Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions applications/IgaApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ file(GLOB_RECURSE KRATOS_IGA_APPLICATION_CORE
${CMAKE_CURRENT_SOURCE_DIR}/iga_application.cpp
${CMAKE_CURRENT_SOURCE_DIR}/iga_application_variables.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_conditions/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_constitutive/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_elements/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_modelers/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/custom_processes/*.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
// KRATOS _____________
// / _/ ____/ |
// / // / __/ /| |
// _/ // /_/ / ___ |
// /___/\____/_/ |_| Application
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Max Friedrichs Dachale, Juan Ignacio Camarotti,
// Ricky Aristio, Alicia Knauer
//
Comment thread
juancamarotti marked this conversation as resolved.
Resolved

// System includes
#include <mutex>

// External includes

Comment thread
juancamarotti marked this conversation as resolved.
Resolved
// Project includes
#include "bernoulli_beam_elastic_constitutive_law.h"
#include "iga_application_variables.h"

namespace Kratos
{

namespace
{

/**
* @brief Torsional constant I_T, defaulting to the polar moment I22 + I33 when it is not provided.
* @details The default is exact for circular (solid or hollow) cross sections only; for other
* sections it overestimates the torsional stiffness, hence the warning.
*/
double GetTorsionalInertia(const Properties& rMaterialProperties)
{
if (rMaterialProperties.Has(I_T)) {
return rMaterialProperties[I_T];
}

static std::once_flag warning_flag;
std::call_once(warning_flag, [](){
KRATOS_WARNING("BernoulliBeamElasticConstitutiveLaw")
<< "I_T is not defined in the properties, using I22 + I33 instead. "
<< "This is only exact for circular cross sections." << std::endl;
});

return rMaterialProperties[I22] + rMaterialProperties[I33];
}

} // namespace


BernoulliBeamElasticConstitutiveLaw::BernoulliBeamElasticConstitutiveLaw()
: ConstitutiveLaw()
{
}

BernoulliBeamElasticConstitutiveLaw::BernoulliBeamElasticConstitutiveLaw(const BernoulliBeamElasticConstitutiveLaw& rOther)
: ConstitutiveLaw(rOther)
{
}

ConstitutiveLaw::Pointer BernoulliBeamElasticConstitutiveLaw::Clone() const
{
BernoulliBeamElasticConstitutiveLaw::Pointer p_clone(new BernoulliBeamElasticConstitutiveLaw(*this));
return p_clone;
}

BernoulliBeamElasticConstitutiveLaw::~BernoulliBeamElasticConstitutiveLaw()
{
}

void BernoulliBeamElasticConstitutiveLaw::GetLawFeatures(Features& rFeatures)
{
rFeatures.mStrainSize = 5;
rFeatures.mSpaceDimension = 3;
}

int BernoulliBeamElasticConstitutiveLaw::Check(
const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const ProcessInfo& rCurrentProcessInfo
) const
{
KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(YOUNG_MODULUS)) << "YOUNG_MODULUS is not defined in the properties" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(POISSON_RATIO)) << "POISSON_RATIO is not defined in the properties" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties[YOUNG_MODULUS] > 0.0) << "The YOUNG_MODULUS value is lower than 0.0" << std::endl;
KRATOS_ERROR_IF (rMaterialProperties[POISSON_RATIO] < 0.0) << "The POISSON_RATIO value is lower than 0.0" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties[POISSON_RATIO] < 0.5) << "The POISSON_RATIO cannot be greater than or equal 0.5." << std::endl;

// Check for IGA beam cross-section properties
KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(CROSS_AREA)) << "CROSS_AREA is not defined in the properties" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(I33)) << "I33 is not defined in the properties" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties.Has(I22)) << "I22 is not defined in the properties" << std::endl;

// Validate property values
KRATOS_ERROR_IF_NOT(rMaterialProperties[CROSS_AREA] > 0.0) << "CROSS_AREA must be positive" << std::endl;
Comment thread
juancamarotti marked this conversation as resolved.
Resolved
KRATOS_ERROR_IF_NOT(rMaterialProperties[I33] > 0.0) << "I33 must be positive" << std::endl;
KRATOS_ERROR_IF_NOT(rMaterialProperties[I22] > 0.0) << "I22 must be positive" << std::endl;
KRATOS_ERROR_IF(rMaterialProperties.Has(I_T) && rMaterialProperties[I_T] <= 0.0) << "I_T must be positive" << std::endl;

return 0;
}

void BernoulliBeamElasticConstitutiveLaw::CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters& rValues)
{
CalculateMaterialResponseCauchy(rValues);
}

void BernoulliBeamElasticConstitutiveLaw::CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters& rValues)
{
CalculateMaterialResponseCauchy(rValues);
}

void BernoulliBeamElasticConstitutiveLaw::CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters& rValues)
{
CalculateMaterialResponseCauchy(rValues);
}

void BernoulliBeamElasticConstitutiveLaw::CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters& rValues)
{
const auto& r_cl_law_options = rValues.GetOptions();
const auto &r_material_properties = rValues.GetMaterialProperties();
auto &r_strain_vector = rValues.GetStrainVector();
Comment thread
juancamarotti marked this conversation as resolved.
Resolved

AddInitialStrainVectorContribution(r_strain_vector);
const auto strain_size = GetStrainSize();

const double E = r_material_properties[YOUNG_MODULUS];
const double nu = r_material_properties[POISSON_RATIO];
const double G = E / (2.0 * (1.0 + nu));

// Retrieve beam cross-section properties
const double A = r_material_properties[CROSS_AREA];
// Moments of inertia about the local cross-section axes 2 (normal n) and 3 (v = t x n)
const double I_22 = r_material_properties[I22];
const double I_33 = r_material_properties[I33];
const double I_t = GetTorsionalInertia(r_material_properties);

if (r_cl_law_options.Is(ConstitutiveLaw::COMPUTE_STRESS)) {
auto &r_stress_vector = rValues.GetStressVector();
if (r_stress_vector.size() != strain_size)
r_stress_vector.resize(strain_size, false);

// Compute stresses according to 5x5 diagonal constitutive matrix with beam properties
r_stress_vector[0] = E * A * r_strain_vector[0]; // N = E*A*ε (normal force)
r_stress_vector[1] = E * I_33 * r_strain_vector[1]; // M_3 = E*I_33*κ_21 (curvature along n, bending about v)
r_stress_vector[2] = E * I_22 * r_strain_vector[2]; // M_2 = E*I_22*κ_31 (curvature along v, bending about n)
// The torsional energy is split between the two shear components κ32 and κ23 (equal in magnitude),
// so each one carries half of the torsional stiffness, consistent with the constitutive matrix below.
r_stress_vector[3] = 0.5 * G * I_t * r_strain_vector[3]; // T = G*I_t*γ_t1 (torsion)
r_stress_vector[4] = 0.5 * G * I_t * r_strain_vector[4]; // T = G*I_t*γ_t2 (torsion)

AddInitialStressVectorContribution(r_stress_vector);
}

if (r_cl_law_options.Is(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR)) {
auto &r_constitutive_matrix = rValues.GetConstitutiveMatrix();
if (r_constitutive_matrix.size1() != strain_size || r_constitutive_matrix.size2() != strain_size)
r_constitutive_matrix.resize(strain_size, strain_size, false);
r_constitutive_matrix.clear();

// 5x5 diagonal constitutive matrix with beam cross-section properties
r_constitutive_matrix(0,0) = E * A; // Normal stiffness
r_constitutive_matrix(1,1) = E * I_33; // Bending stiffness about v
r_constitutive_matrix(2,2) = E * I_22; // Bending stiffness about n
r_constitutive_matrix(3,3) = 0.5 * G * I_t; // Torsional stiffness
r_constitutive_matrix(4,4) = 0.5 * G * I_t; // Torsional stiffness
}
}

} // namespace Kratos
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
// KRATOS _____________
// / _/ ____/ |
// / // / __/ /| |
// _/ // /_/ / ___ |
// /___/\____/_/ |_| Application
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Max Friedrichs Dachale, Juan Ignacio Camarotti,
// Ricky Aristio, Alicia Knauer
//

#pragma once

// System includes

// External includes

// Project includes
#include "includes/constitutive_law.h"

namespace Kratos
{

class KRATOS_API(IGA_APPLICATION) BernoulliBeamElasticConstitutiveLaw : public ConstitutiveLaw
{
public:
/**
* Type Definitions
*/
using ProcessInfoType = ProcessInfo;
using BaseType = ConstitutiveLaw;
using SizeType = std::size_t;

/**
* Counted pointer of BernoulliBeamElasticConstitutiveLaw
*/
KRATOS_CLASS_POINTER_DEFINITION(BernoulliBeamElasticConstitutiveLaw);

/**
* Life Cycle
*/

/**
* Default constructor.
*/
BernoulliBeamElasticConstitutiveLaw();

ConstitutiveLaw::Pointer Clone() const override;

/**
* Copy constructor.
*/
BernoulliBeamElasticConstitutiveLaw(const BernoulliBeamElasticConstitutiveLaw& rOther);

/**
* Destructor.
*/
~BernoulliBeamElasticConstitutiveLaw() override;

/**
* Operators
*/

/**
* Operations needed by the base class:
*/

/**
* This function is designed to be called once to check compatibility with element
* @param rFeatures
*/
void GetLawFeatures(Features& rFeatures) override;

/**
* Voigt tensor size:
*/
SizeType GetStrainSize() const override
{
return 5;
}

/**
* This function provides the place to perform checks on the completeness of the input.
* It is designed to be called only once (or anyway, not often) typically at the beginning
* of the calculations, so to verify that nothing is missing from the input
* or that no common error is found.
* @param rMaterialProperties: The properties of the material
* @param rElementGeometry: The geometry of the element
* @param rCurrentProcessInfo: The current process info instance
*/
int Check(
const Properties& rMaterialProperties,
const GeometryType& rElementGeometry,
const ProcessInfo& rCurrentProcessInfo
) const override;

/**
* @brief Computes the material response in terms of 1st Piola-Kirchhoff stresses and constitutive tensor
* @see Parameters
*/
void CalculateMaterialResponsePK1(ConstitutiveLaw::Parameters &rValues) override;

/**
* @brief Computes the material response in terms of 2nd Piola-Kirchhoff stresses and constitutive tensor
* @see Parameters
*/
void CalculateMaterialResponsePK2(ConstitutiveLaw::Parameters &rValues) override;

/**
* @brief Computes the material response in terms of Kirchhoff stresses and constitutive tensor
* @see Parameters
*/
void CalculateMaterialResponseKirchhoff(ConstitutiveLaw::Parameters &rValues) override;

/**
* @brief Computes the material response in terms of Cauchy stresses and constitutive tensor
* @see Parameters
*/
void CalculateMaterialResponseCauchy(ConstitutiveLaw::Parameters &rValues) override;

/**
* @brief If the CL requires to initialize the material response, called by the element in InitializeSolutionStep.
*/
bool RequiresFinalizeMaterialResponse() override
{
return false;
}

/**
* @brief If the CL requires to initialize the material response, called by the element in InitializeSolutionStep.
*/
bool RequiresInitializeMaterialResponse() override
{
return false;
}

protected:


private:


///@}
///@name Serialization
///@{
friend class Serializer;

void save(Serializer& rSerializer) const override
{
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw)
}

void load(Serializer& rSerializer) override
{
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw)
}

}; // Class BernoulliBeamElasticConstitutiveLaw
} // namespace Kratos.
Loading
Loading