forked from KratosMultiphysics/Kratos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request KratosMultiphysics#757 from KratosMultiphysics/add…
…-testcases-beamtruss Add testcases beamtruss
- Loading branch information
Showing
27 changed files
with
5,548 additions
and
3,219 deletions.
There are no files selected for viewing
3,892 changes: 1,911 additions & 1,981 deletions
3,892
applications/StructuralMechanicsApplication/custom_elements/cr_beam_element_3D2N.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
465 changes: 245 additions & 220 deletions
465
applications/StructuralMechanicsApplication/custom_elements/cr_beam_element_3D2N.hpp
Large diffs are not rendered by default.
Oops, something went wrong.
1,674 changes: 857 additions & 817 deletions
1,674
applications/StructuralMechanicsApplication/custom_elements/truss_element_3D2N.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
368 changes: 177 additions & 191 deletions
368
applications/StructuralMechanicsApplication/custom_elements/truss_element_3D2N.hpp
This file contains 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 |
---|---|---|
@@ -1,191 +1,177 @@ | ||
// ============================================================================== | ||
/* | ||
TRUSS_ELEMENT_3D2N | ||
Main author: Klaus B. Sautter | ||
[email protected] | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following condition: | ||
Distribution of this code for any commercial purpose is permissible | ||
ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNERS. | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
//============================================================================== | ||
|
||
/* **************************************************************************** | ||
* Projectname: $TRUSS_ELEMENT_3D2N | ||
* Last Modified by: $Author: [email protected] $ | ||
* Date: $Date: April 2017 $ | ||
* Revision: $Revision: 1.0 $ | ||
* ***************************************************************************/ | ||
|
||
#if !defined(KRATOS_TRUSS_ELEMENT_3D2N_H_INCLUDED ) | ||
#define KRATOS_TRUSS_ELEMENT_3D2N_H_INCLUDED | ||
|
||
|
||
#include "includes/element.h" | ||
#include "includes/define.h" | ||
#include "includes/variables.h" | ||
|
||
namespace Kratos | ||
{ | ||
|
||
class TrussElement3D2N : public Element | ||
{ | ||
public: | ||
KRATOS_CLASS_POINTER_DEFINITION(TrussElement3D2N); | ||
|
||
|
||
typedef Element BaseType; | ||
typedef BaseType::GeometryType GeometryType; | ||
typedef BaseType::NodesArrayType NodesArrayType; | ||
typedef BaseType::PropertiesType PropertiesType; | ||
typedef BaseType::IndexType IndexType; | ||
typedef BaseType::SizeType SizeType; | ||
typedef BaseType::MatrixType MatrixType; | ||
typedef BaseType::VectorType VectorType; | ||
typedef BaseType::EquationIdVectorType EquationIdVectorType; | ||
typedef BaseType::DofsVectorType DofsVectorType; | ||
|
||
|
||
TrussElement3D2N(IndexType NewId, | ||
GeometryType::Pointer pGeometry, | ||
bool rLinear = false); | ||
TrussElement3D2N(IndexType NewId, | ||
GeometryType::Pointer pGeometry, | ||
PropertiesType::Pointer pProperties, | ||
bool rLinear = false); | ||
|
||
|
||
~TrussElement3D2N() override; | ||
|
||
|
||
BaseType::Pointer Create( | ||
IndexType NewId, | ||
NodesArrayType const& rThisNodes, | ||
PropertiesType::Pointer pProperties) const override; | ||
|
||
void EquationIdVector( | ||
EquationIdVectorType& rResult, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetDofList( | ||
DofsVectorType& rElementalDofList, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void Initialize() override; | ||
|
||
MatrixType CreateElementStiffnessMatrix(); | ||
|
||
void CalculateOnIntegrationPoints( | ||
const Variable<double>& rVariable, | ||
std::vector<double>& rOutput, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetValueOnIntegrationPoints( | ||
const Variable<double>& rVariable, | ||
std::vector<double>& rValues, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void UpdateInternalForces( | ||
VectorType& rinternalForces); | ||
void CreateTransformationMatrix( | ||
Matrix& rRotationMatrix); | ||
double CalculateCurrentLength(); | ||
|
||
void CalculateOnIntegrationPoints( | ||
const Variable<Vector>& rVariable, | ||
std::vector<Vector>& rOutput, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetValueOnIntegrationPoints( | ||
const Variable<Vector>& rVariable, | ||
std::vector<Vector>& rValues, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateLocalSystem( | ||
MatrixType& rLeftHandSideMatrix, | ||
VectorType& rRightHandSideVector, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void CalculateRightHandSide( | ||
VectorType& rRightHandSideVector, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateLeftHandSide( | ||
MatrixType& rLeftHandSideMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateMassMatrix( | ||
MatrixType& rMassMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateDampingMatrix( | ||
MatrixType& rDampingMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void AddExplicitContribution(const VectorType& rRHSVector, | ||
const Variable<VectorType>& rRHSVariable, | ||
Variable<array_1d<double, 3> >& rDestinationVariable, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void GetValuesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
void GetSecondDerivativesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
void GetFirstDerivativesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
int Check( | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
double CalculateGreenLagrangeStrain(); | ||
double CalculateReferenceLength(); | ||
|
||
VectorType CalculateBodyForces(); | ||
|
||
bool ReturnIfIsCable(); | ||
|
||
|
||
|
||
private: | ||
bool mIsCompressed; | ||
bool mIsLinearElement = false; | ||
|
||
TrussElement3D2N() {}; | ||
|
||
friend class Serializer; | ||
void save(Serializer& rSerializer) const override; | ||
void load(Serializer& rSerializer) override; | ||
}; | ||
|
||
|
||
} | ||
|
||
|
||
#endif | ||
// KRATOS ___| | | | | ||
// \___ \ __| __| | | __| __| | | __| _` | | | ||
// | | | | | ( | | | | ( | | | ||
// _____/ \__|_| \__,_|\___|\__|\__,_|_| \__,_|_| MECHANICS | ||
// | ||
// License: BSD License | ||
// license: structural_mechanics_application/license.txt | ||
// | ||
// Main authors: Klaus B. Sautter | ||
// | ||
// | ||
// | ||
|
||
#if !defined(KRATOS_TRUSS_ELEMENT_3D2N_H_INCLUDED ) | ||
#define KRATOS_TRUSS_ELEMENT_3D2N_H_INCLUDED | ||
|
||
// System includes | ||
|
||
// External includes | ||
|
||
// Project includes | ||
#include "includes/element.h" | ||
#include "includes/define.h" | ||
#include "includes/variables.h" | ||
|
||
namespace Kratos | ||
{ | ||
class TrussElement3D2N : public Element | ||
{ | ||
private: | ||
//const values | ||
static constexpr int msNumberOfNodes = 2; | ||
static constexpr int msDimension = 3; | ||
static constexpr unsigned int msLocalSize = msNumberOfNodes * msDimension; | ||
public: | ||
KRATOS_CLASS_POINTER_DEFINITION(TrussElement3D2N); | ||
|
||
|
||
typedef Element BaseType; | ||
typedef BaseType::GeometryType GeometryType; | ||
typedef BaseType::NodesArrayType NodesArrayType; | ||
typedef BaseType::PropertiesType PropertiesType; | ||
typedef BaseType::IndexType IndexType; | ||
typedef BaseType::SizeType SizeType; | ||
typedef BaseType::MatrixType MatrixType; | ||
typedef BaseType::VectorType VectorType; | ||
typedef BaseType::EquationIdVectorType EquationIdVectorType; | ||
typedef BaseType::DofsVectorType DofsVectorType; | ||
|
||
|
||
TrussElement3D2N(IndexType NewId, | ||
GeometryType::Pointer pGeometry, | ||
bool rLinear = false); | ||
TrussElement3D2N(IndexType NewId, | ||
GeometryType::Pointer pGeometry, | ||
PropertiesType::Pointer pProperties, | ||
bool rLinear = false); | ||
|
||
|
||
~TrussElement3D2N() override; | ||
|
||
|
||
BaseType::Pointer Create( | ||
IndexType NewId, | ||
NodesArrayType const& rThisNodes, | ||
PropertiesType::Pointer pProperties) const override; | ||
|
||
void EquationIdVector( | ||
EquationIdVectorType& rResult, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetDofList( | ||
DofsVectorType& rElementalDofList, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void Initialize() override; | ||
|
||
bounded_matrix<double,msLocalSize,msLocalSize> CreateElementStiffnessMatrix(ProcessInfo& rCurrentProcessInfo); | ||
|
||
void CalculateOnIntegrationPoints( | ||
const Variable<double>& rVariable, | ||
std::vector<double>& rOutput, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetValueOnIntegrationPoints( | ||
const Variable<double>& rVariable, | ||
std::vector<double>& rValues, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void UpdateInternalForces(bounded_vector<double,msLocalSize>& rinternalForces); | ||
void CreateTransformationMatrix(bounded_matrix<double,msLocalSize,msLocalSize>& rRotationMatrix); | ||
double CalculateCurrentLength(); | ||
|
||
void CalculateOnIntegrationPoints( | ||
const Variable<Vector>& rVariable, | ||
std::vector<Vector>& rOutput, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void GetValueOnIntegrationPoints( | ||
const Variable<Vector>& rVariable, | ||
std::vector<Vector>& rValues, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateLocalSystem( | ||
MatrixType& rLeftHandSideMatrix, | ||
VectorType& rRightHandSideVector, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void CalculateRightHandSide( | ||
VectorType& rRightHandSideVector, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateLeftHandSide( | ||
MatrixType& rLeftHandSideMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateMassMatrix( | ||
MatrixType& rMassMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
void CalculateDampingMatrix( | ||
MatrixType& rDampingMatrix, | ||
ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void AddExplicitContribution(const VectorType& rRHSVector, | ||
const Variable<VectorType>& rRHSVariable, | ||
Variable<array_1d<double, 3> >& rDestinationVariable, | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
void GetValuesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
void GetSecondDerivativesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
void GetFirstDerivativesVector( | ||
Vector& rValues, | ||
int Step = 0) override; | ||
|
||
int Check( | ||
const ProcessInfo& rCurrentProcessInfo) override; | ||
|
||
|
||
double CalculateGreenLagrangeStrain(); | ||
double CalculateReferenceLength(); | ||
|
||
bounded_vector<double,msLocalSize> CalculateBodyForces(); | ||
|
||
bool ReturnIfIsCable(); | ||
|
||
void CalculateGeometricStiffnessMatrix(bounded_matrix<double,msLocalSize,msLocalSize>& rGeometricStiffnessMatrix, | ||
ProcessInfo& rCurrentProcessInfo); | ||
|
||
void CalculateElasticStiffnessMatrix(bounded_matrix<double,msLocalSize,msLocalSize>& rElasticStiffnessMatrix, | ||
ProcessInfo& rCurrentProcessInfo); | ||
|
||
|
||
private: | ||
bool mIsCompressed; | ||
bool mIsLinearElement = false; | ||
TrussElement3D2N() {}; | ||
|
||
friend class Serializer; | ||
void save(Serializer& rSerializer) const override; | ||
void load(Serializer& rSerializer) override; | ||
}; | ||
|
||
|
||
} | ||
|
||
|
||
#endif |
This file contains 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
Oops, something went wrong.