Repository navigation
[IGA] Nonlinear isogeometric spatial Bernoulli beam element #15015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+7,865
−3
Merged
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 02f00f1
new methods added to the base 3d beam element
juancamarotti fc33704
initial creation of the bernoulli 3d beam element
juancamarotti 4235074
Merge branch 'master' into iga/3d_beam_implementation
juancamarotti a43e201
adding the bernoulli beam elemen to kratos
juancamarotti 4f48fe0
change names
juancamarotti 320cfcb
Added beam_base_element_3d and non_linear_bernoulli_beam_element_3d
a535c9d
debugging fixes and tests are running
e130298
Merge branch 'master' into iga/3d_beam_implementation
juancamarotti 6f46332
revert noise changes in some files
juancamarotti 2de6a0f
erase unrelated file
juancamarotti fa435a1
erase unnecessary include
juancamarotti 7f20b0d
revert ref modeler to master
juancamarotti 2fa0004
add test to the CI suite
juancamarotti 2571e1d
change test name
juancamarotti b3c5293
erase CROSS_AREA
juancamarotti 93161b4
change test name
juancamarotti 2dbb027
revert changes in nurbs curve
juancamarotti d36399b
solve bug in the constitutive law
juancamarotti c0fe250
clean the tests and rewrite it
juancamarotti ea5b54a
[IGA] Compute the initial beam frame per curve in ComputeBeamVectorsP…
juancamarotti 20c3ec5
[IGA] Fix cross-section orientation and torsional stress of the Berno…
juancamarotti 3955b59
[IGA] Format beam element files
juancamarotti 7f5069a
[IGA] Address review of the Bernoulli beam element
juancamarotti a6f45f7
[IGA] Add Alicia Knauer to the beam authors
juancamarotti d4fc37c
[IGA] Add dynamics to the Bernoulli beam and address Max's review
juancamarotti df01fd7
[IGA] Speed up the beam dynamics and elastica tests
juancamarotti 253063f
[IGA] Remove unused beam variables
juancamarotti 24a6250
[IGA] Make the beam torsional constant optional
juancamarotti 93f82cb
[IGA] Replace the hand-written product loops of the Bernoulli beam
juancamarotti 3f0cb5c
[IGA] Write the beam variation products block-wise
juancamarotti f4af69d
Move VTK HDF attribute changes to a separate PR
juancamarotti 9e1d3b7
clarifications in the tests
juancamarotti a32b4ce
change beam base element name
juancamarotti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
172 changes: 172 additions & 0 deletions
172
applications/IgaApplication/custom_constitutive/bernoulli_beam_elastic_constitutive_law.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| // | ||
|
|
||
| // System includes | ||
| #include <mutex> | ||
|
|
||
| // External includes | ||
|
|
||
|
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; | ||
|
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(); | ||
|
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 | ||
161 changes: 161 additions & 0 deletions
161
applications/IgaApplication/custom_constitutive/bernoulli_beam_elastic_constitutive_law.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.