-
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
Conversation
// Vicente Mataix Ferrandiz | ||
// Fernando Rastellini | ||
// Collaborator: Lucia Barbu | ||
// Vicente Mataix |
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.
(I like my mother's name)
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.
Besides, she's a good woman, I'll put her back
return Kratos::make_shared<SerialParallelRuleOfMixturesLaw>(fiber_volumetric_participation, parallel_directions); | ||
|
||
Vector parallel_directions = NewParameters["parallel_behaviour_directions"].GetVector(); | ||
KRATOS_ERROR_IF_NOT(parallel_directions.size() == VoigtSize) << "The parallel_behaviour_directions vector is not consistent with the VoigtSize of the Serial Parallel Rule of Mixtures CL..." << std::endl; |
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.
KRATOS_ERROR_IF_NOT(parallel_directions.size() == VoigtSize) << "The parallel_behaviour_directions vector is not consistent with the VoigtSize of the Serial Parallel Rule of Mixtures CL..." << std::endl; | |
KRATOS_ERROR_IF_NOT(parallel_directions.size() == VoigtSize) << "The parallel_behaviour_directions vector is not consistent with the VoigtSize of the Serial Parallel Rule of Mixtures CL. parallel_directions.size(): " << parallel_directions.size() << " vs VoigtSize: " << VoigtSize << std::endl; |
Specify sizes
const std::size_t voigt_size = this->GetStrainSize(); | ||
const int num_parallel_components = inner_prod(mParallelDirections, mParallelDirections); | ||
const int num_serial_components = voigt_size - num_parallel_components; | ||
const SizeType voigt_size = GetStrainSize(); |
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.
Question. Do we do not assume the Voigt size from the Dimension size?, sorry I forgot that detail
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.
yes, the GetStrainSize()
return a static SizeType
, I can remove it if you think is best to access it directly.
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.
I those method were override somewhere else it could make some sense, but here I thinbk it is better to just use it.
noalias(B_tensor) = prod(F, trans(F)); | ||
|
||
AdvancedConstitutiveLawUtilities<6>::CalculateAlmansiStrain(B_tensor, r_strain_vector); | ||
AdvancedConstitutiveLawUtilities<VoigtSize>::CalculateAlmansiStrain(B_tensor, r_strain_vector); |
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.
But in here VoigtSize is retrieved as static
if (rValue.size1() != voigt_size) | ||
rValue.resize(voigt_size, voigt_size, false); | ||
noalias(rValue) = MathUtils<double>::StrainVectorToTensor(matrix_strain_vector); | ||
return rValue; | ||
} else if (rThisVariable == GREEN_LAGRANGE_STRAIN_TENSOR_FIBER) { | ||
const std::size_t voigt_size = this->GetStrainSize(); | ||
const std::size_t voigt_size = GetStrainSize(); |
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.
The same for the every GetStrainSize
KRATOS_ERROR_IF(VoigtSize != mpMatrixConstitutiveLaw->GetStrainSize()) << "The Strain size of the mpMatrixConstitutiveLaw is not consistent with the Srial Parallel Rule of Mixtures..." << std::endl; | ||
KRATOS_ERROR_IF(VoigtSize != mpFiberConstitutiveLaw->GetStrainSize()) << "The Strain size of the mpFiberConstitutiveLaw is not consistent with the Srial Parallel Rule of Mixtures..." << std::endl; | ||
KRATOS_ERROR_IF(mpMatrixConstitutiveLaw->WorkingSpaceDimension() != mpFiberConstitutiveLaw->WorkingSpaceDimension()) << "The WorkingSpaceDimension of the fiber and matrix mismatch..." << std::endl; | ||
KRATOS_ERROR_IF(mpMatrixConstitutiveLaw->GetStrainSize() != mpFiberConstitutiveLaw->GetStrainSize()) << "The GetStrainSize of the fiber and matrix mismatch..." << std::endl; |
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.
As in the other example, Add the sizes in the error message
@@ -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" |
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)
}; | ||
|
||
/** | ||
* @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 comment
The 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.
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.
Comments
📝 Description
In this PR I am:
SerialParallelRuleOfMixturesLaw
to be used in 3d and in 2d simulations. The implementation is generic thanks to the newly templatedDimension
. A few checks have been added to avoid incompatibilities between 2D and 3D individual constitutive laws.AdvancedConstitutiveLawsUtilities
have been enhanced with aCalculateTangentTensorByPerturbation
method to start avoiding repetition in other CLs in the future.