-
Notifications
You must be signed in to change notification settings - Fork 247
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
[CLApp] Generalizing the Serial Parallel Rule of Mixtures to perform 2d simulations #12983
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
079392e
update DOI and refs
AlejandroCornejo 90b59ed
Merge branch 'master' into serial-parallel-rom-in-2d
AlejandroCornejo 486dc72
improvements
AlejandroCornejo 332cf85
unify the perturbation method in the utils
AlejandroCornejo 98059c6
more improvements
AlejandroCornejo ced3789
more...
AlejandroCornejo 5321a0e
improved more
AlejandroCornejo 2073d8a
now compiles
AlejandroCornejo 872c020
avoid seg fault
AlejandroCornejo d660886
minor
AlejandroCornejo 92bcc18
space
AlejandroCornejo 70d7928
adding template to CL
AlejandroCornejo c132da5
now using the temaplte
AlejandroCornejo 0af5eab
final touch :)
AlejandroCornejo 57d92f7
surname is BACK
AlejandroCornejo d767615
using the static variable of VoigtSize
AlejandroCornejo 666926c
addressing comments
AlejandroCornejo 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 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
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
330 changes: 193 additions & 137 deletions
330
...veLawsApplication/custom_constitutive/composites/serial_parallel_rule_of_mixtures_law.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,8 +10,8 @@ | |
// | ||
// Main authors: Alejandro Cornejo | ||
// Vicente Mataix | ||
// Fernando Rastellini | ||
// Collaborator: Lucia Barbu | ||
// | ||
// | ||
// | ||
|
||
#pragma once | ||
|
@@ -47,10 +47,13 @@ namespace Kratos | |
/** | ||
* @class SerialParallelRuleOfMixturesLaw | ||
* @ingroup StructuralMechanicsApplication | ||
* @brief This CL implements the serial-parallel rule of mixtures developed by F.Rastellini | ||
* @brief This CL implements the serial-parallel rule of mixtures detailed in Cornejo et al. "Methodology for the analysis of post-tensioned structures using a constitutive serial-parallel rule of mixtures" | ||
* DOI: https://doi.org/10.1016/j.compstruct.2018.05.123 | ||
* The SP-RoM is able to work in 2D and in 3D. | ||
* @details | ||
* @author Alejandro Cornejo | ||
*/ | ||
template<unsigned int TDim> | ||
class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | ||
: public ConstitutiveLaw | ||
{ | ||
|
@@ -59,10 +62,16 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
///@{ | ||
|
||
/// The node definition | ||
typedef Node NodeType; | ||
using NodeType = Node; | ||
|
||
/// The geometry definition | ||
typedef Geometry<NodeType> GeometryType; | ||
using GeometryType = Geometry<NodeType>; | ||
|
||
using BaseType = ConstitutiveLaw; | ||
|
||
static constexpr SizeType Dimension = TDim; | ||
|
||
static constexpr SizeType VoigtSize = (TDim == 3) ? 6 : 3; | ||
|
||
/// Definition of the machine precision tolerance | ||
static constexpr double machine_tolerance = std::numeric_limits<double>::epsilon(); | ||
|
@@ -99,7 +108,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
|
||
// Copy constructor | ||
SerialParallelRuleOfMixturesLaw(SerialParallelRuleOfMixturesLaw const& rOther) | ||
: ConstitutiveLaw(rOther), mpMatrixConstitutiveLaw(rOther.mpMatrixConstitutiveLaw), mpFiberConstitutiveLaw(rOther.mpFiberConstitutiveLaw), | ||
: BaseType(rOther), mpMatrixConstitutiveLaw(rOther.mpMatrixConstitutiveLaw), mpFiberConstitutiveLaw(rOther.mpFiberConstitutiveLaw), | ||
mFiberVolumetricParticipation(rOther.mFiberVolumetricParticipation), mParallelDirections(rOther.mParallelDirections) , | ||
mPreviousStrainVector(rOther.mPreviousStrainVector) , mPreviousSerialStrainMatrix(rOther.mPreviousSerialStrainMatrix) , mIsPrestressed(rOther.mIsPrestressed) | ||
{ | ||
|
@@ -132,15 +141,15 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
*/ | ||
SizeType WorkingSpaceDimension() override | ||
{ | ||
return 3; | ||
return Dimension; | ||
}; | ||
|
||
/** | ||
* @brief Voigt tensor size: | ||
*/ | ||
SizeType GetStrainSize() const override | ||
{ | ||
return 6; | ||
return VoigtSize; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would keep the methods of course, but in code use directly the static sizes. |
||
}; | ||
|
||
/** | ||
|
@@ -260,7 +269,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
* @param rValue new value of the specified variable | ||
* @param rCurrentProcessInfo the process info | ||
*/ | ||
void SetValue( | ||
void SetValue( | ||
const Variable<double>& rThisVariable, | ||
const double& rValue, | ||
const ProcessInfo& rCurrentProcessInfo | ||
|
@@ -539,23 +548,30 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
* @brief This method computes the tangent tensor | ||
* @param rValues The constitutive law parameters and flags | ||
*/ | ||
void CalculateTangentTensor(ConstitutiveLaw::Parameters& rValues, | ||
void CalculateTangentTensor( | ||
ConstitutiveLaw::Parameters& rValues, | ||
const ConstitutiveLaw::StressMeasure& rStressMeasure = ConstitutiveLaw::StressMeasure_Cauchy); | ||
|
||
/** | ||
* @brief If the CL requires to initialize the material response, called by the element in InitializeSolutionStep. | ||
*/ | ||
bool RequiresInitializeMaterialResponse() override | ||
{ | ||
return true; | ||
if (mpMatrixConstitutiveLaw->RequiresInitializeMaterialResponse() || mpFiberConstitutiveLaw->RequiresInitializeMaterialResponse()) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* @brief If the CL requires to initialize the material response, called by the element in InitializeSolutionStep. | ||
*/ | ||
bool RequiresFinalizeMaterialResponse() override | ||
{ | ||
return true; | ||
if (mpMatrixConstitutiveLaw->RequiresFinalizeMaterialResponse() || mpFiberConstitutiveLaw->RequiresFinalizeMaterialResponse()) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
|
@@ -641,7 +657,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
int GetNumberOfSerialComponents() | ||
{ | ||
const int parallel_components = inner_prod(mParallelDirections, mParallelDirections); | ||
return this->GetStrainSize() - parallel_components; | ||
return GetStrainSize() - parallel_components; | ||
} | ||
|
||
///@} | ||
|
@@ -672,8 +688,8 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
ConstitutiveLaw::Pointer mpMatrixConstitutiveLaw; | ||
ConstitutiveLaw::Pointer mpFiberConstitutiveLaw; | ||
double mFiberVolumetricParticipation; | ||
array_1d<double, 6> mParallelDirections = ZeroVector(6); | ||
array_1d<double, 6> mPreviousStrainVector = ZeroVector(6); | ||
Vector mParallelDirections = ZeroVector(VoigtSize); | ||
Vector mPreviousStrainVector = ZeroVector(VoigtSize); | ||
Vector mPreviousSerialStrainMatrix = ZeroVector(GetNumberOfSerialComponents()); | ||
bool mIsPrestressed = false; | ||
|
||
|
@@ -703,7 +719,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
|
||
void save(Serializer& rSerializer) const override | ||
{ | ||
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, ConstitutiveLaw) | ||
KRATOS_SERIALIZE_SAVE_BASE_CLASS(rSerializer, BaseType) | ||
rSerializer.save("MatrixConstitutiveLaw", mpMatrixConstitutiveLaw); | ||
rSerializer.save("FiberConstitutiveLaw", mpFiberConstitutiveLaw); | ||
rSerializer.save("FiberVolumetricParticipation", mFiberVolumetricParticipation); | ||
|
@@ -715,7 +731,7 @@ class KRATOS_API(CONSTITUTIVE_LAWS_APPLICATION) SerialParallelRuleOfMixturesLaw | |
|
||
void load(Serializer& rSerializer) override | ||
{ | ||
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, ConstitutiveLaw) | ||
KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, BaseType) | ||
rSerializer.load("MatrixConstitutiveLaw", mpMatrixConstitutiveLaw); | ||
rSerializer.load("FiberConstitutiveLaw", mpFiberConstitutiveLaw); | ||
rSerializer.load("FiberVolumetricParticipation", mFiberVolumetricParticipation); | ||
|
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
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
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It's a heart)