Commit a22553c2 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI: Create Newton (at the moment just a copy of Aitken...).

parent 2ae0b0fe
......@@ -335,6 +335,7 @@
BE4ED31D1A2CBAC400DE374E /* MatrixOperations.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE4ED31A1A2CBAC400DE374E /* MatrixOperations.hpp */; };
BE4ED31E1A2CBAC400DE374E /* MatrixOperations.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE4ED31B1A2CBAC400DE374E /* MatrixOperations.hxx */; };
BE501D041A2DC03900B92486 /* MatrixOrVector.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE501D031A2DC03900B92486 /* MatrixOrVector.hpp */; };
BE51121D1BDFB56600CB5D1E /* main_aitken.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE51121C1BDFB56600CB5D1E /* main_aitken.cpp */; };
BE58EB751B9087B1006899EA /* InitializeHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE58EB741B9087B1006899EA /* InitializeHelper.cpp */; };
BE58EB781B908827006899EA /* libModel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE58EB4D1B908757006899EA /* libModel.a */; };
BE58EB7B1B90883E006899EA /* libModel.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE58EB4D1B908757006899EA /* libModel.a */; };
......@@ -1042,7 +1043,6 @@
BEBEBBDA1BDFB2380011D835 /* Policy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEFC2B2A1BD7D6770067F358 /* Policy.cpp */; };
BEBEBBDB1BDFB2380011D835 /* ExplicitStepVariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D291B909F3400F0F4B4 /* ExplicitStepVariationalFormulation.cpp */; };
BEBEBBDC1BDFB2380011D835 /* InputParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D2F1B909F3400F0F4B4 /* InputParameter.cpp */; };
BEBEBBDD1BDFB2380011D835 /* Aitken in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D321B909F3400F0F4B4 /* Aitken */; };
BEBEBBDE1BDFB2380011D835 /* ImplicitStepFluidVariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D2C1B909F3400F0F4B4 /* ImplicitStepFluidVariationalFormulation.cpp */; };
BEBEBBDF1BDFB2380011D835 /* VariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEFC2B2D1BD7D6770067F358 /* VariationalFormulation.cpp */; };
BEBEBBE11BDFB2380011D835 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC37E0617DDC0210021BFB7 /* Accelerate.framework */; };
......@@ -1057,6 +1057,7 @@
BEBEBBEA1BDFB2380011D835 /* libUtilities.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA8A379177AD4FE009436C9 /* libUtilities.a */; };
BEBEBBEB1BDFB2380011D835 /* libOps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE43AD351AFB9ADB0082AF43 /* libOps.a */; };
BEBEBBEC1BDFB2380011D835 /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE781C051B0B582500DBE49F /* libSeldon.a */; };
BEBEBC211BDFB4F10011D835 /* main_newton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEBEBC1C1BDFB4F10011D835 /* main_newton.cpp */; };
BEC157F01A249BB9007D20EB /* TupleHelper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEC157EF1A249BB9007D20EB /* TupleHelper.hpp */; };
BEC157F21A249C3D007D20EB /* Numeric.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BEC157F11A249C3D007D20EB /* Numeric.hpp */; };
BEC37E0717DDC0210021BFB7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC37E0617DDC0210021BFB7 /* Accelerate.framework */; };
......@@ -1074,7 +1075,6 @@
BEC57D351B909F3400F0F4B4 /* ExplicitStepVariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D291B909F3400F0F4B4 /* ExplicitStepVariationalFormulation.cpp */; };
BEC57D361B909F3400F0F4B4 /* ImplicitStepFluidVariationalFormulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D2C1B909F3400F0F4B4 /* ImplicitStepFluidVariationalFormulation.cpp */; };
BEC57D371B909F3400F0F4B4 /* InputParameter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D2F1B909F3400F0F4B4 /* InputParameter.cpp */; };
BEC57D381B909F3400F0F4B4 /* Aitken in Sources */ = {isa = PBXBuildFile; fileRef = BEC57D321B909F3400F0F4B4 /* Aitken */; };
BEC57D391B90A29600F0F4B4 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC37E0617DDC0210021BFB7 /* Accelerate.framework */; };
BECA2FF21B0B6AE60011ED13 /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE781C051B0B582500DBE49F /* libSeldon.a */; };
BECA2FF31B0B6AEA0011ED13 /* libSeldon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BE781C051B0B582500DBE49F /* libSeldon.a */; };
......@@ -3741,6 +3741,7 @@
BE4FC35A18F2AE87007B6DED /* QuadratureRuleList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QuadratureRuleList.cpp; sourceTree = "<group>"; };
BE4FC35B18F2AE87007B6DED /* QuadratureRuleList.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = QuadratureRuleList.hpp; sourceTree = "<group>"; };
BE501D031A2DC03900B92486 /* MatrixOrVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MatrixOrVector.hpp; sourceTree = "<group>"; };
BE51121C1BDFB56600CB5D1E /* main_aitken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main_aitken.cpp; path = Aitken/main_aitken.cpp; sourceTree = "<group>"; };
BE589C281A160ABD00D23130 /* UniqueId.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = UniqueId.hpp; path = Sources/Utilities/UniqueId/UniqueId.hpp; sourceTree = "<group>"; };
BE589C291A160ABD00D23130 /* UniqueId.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = UniqueId.hxx; path = Sources/Utilities/UniqueId/UniqueId.hxx; sourceTree = "<group>"; };
BE589C381A446A1200745D08 /* SConscript */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = SConscript; sourceTree = "<group>"; };
......@@ -4356,6 +4357,11 @@
BEBEB22219C849C200E4EA1D /* ComputeMatrixPattern.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; lineEnding = 0; path = ComputeMatrixPattern.hpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
BEBEBBBA1BDF90180011D835 /* VariationalFormulationElasticity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VariationalFormulationElasticity.cpp; sourceTree = "<group>"; };
BEBEBBF11BDFB2380011D835 /* FSI_EI_Newton */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = FSI_EI_Newton; sourceTree = BUILT_PRODUCTS_DIR; };
BEBEBC1C1BDFB4F10011D835 /* main_newton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main_newton.cpp; path = Newton/main_newton.cpp; sourceTree = "<group>"; };
BEBEBC1D1BDFB4F10011D835 /* Model.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Model.hpp; path = Newton/Model.hpp; sourceTree = "<group>"; };
BEBEBC1E1BDFB4F10011D835 /* Model.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Model.hxx; path = Newton/Model.hxx; sourceTree = "<group>"; };
BEBEBC1F1BDFB4F10011D835 /* ModelAccessors.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ModelAccessors.hxx; path = Newton/ModelAccessors.hxx; sourceTree = "<group>"; };
BEBEBC201BDFB4F10011D835 /* ModelForward.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ModelForward.hxx; path = Newton/ModelForward.hxx; sourceTree = "<group>"; };
BEC157EF1A249BB9007D20EB /* TupleHelper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TupleHelper.hpp; sourceTree = "<group>"; };
BEC157F11A249C3D007D20EB /* Numeric.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Numeric.hpp; path = Sources/Utilities/Numeric/Numeric.hpp; sourceTree = SOURCE_ROOT; };
BEC1B0C519C3209400088A5D /* SConscript */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = SConscript; sourceTree = "<group>"; };
......@@ -4386,7 +4392,6 @@
BEC57D2F1B909F3400F0F4B4 /* InputParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputParameter.cpp; sourceTree = "<group>"; };
BEC57D301B909F3400F0F4B4 /* InputParameter.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InputParameter.hpp; sourceTree = "<group>"; };
BEC57D311B909F3400F0F4B4 /* InputParameterList.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InputParameterList.hpp; sourceTree = "<group>"; };
BEC57D321B909F3400F0F4B4 /* Aitken */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = folder; path = Aitken; sourceTree = "<group>"; };
BEC57D331B909F3400F0F4B4 /* Model.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Model.hpp; path = Aitken/Model.hpp; sourceTree = "<group>"; };
BEC57D341B909F3400F0F4B4 /* Model.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Model.hxx; path = Aitken/Model.hxx; sourceTree = "<group>"; };
BECA4B941B1756DE00DC7265 /* libOperators.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOperators.a; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -7474,7 +7479,7 @@
BEBEBC171BDFB33E0011D835 /* Aitken */ = {
isa = PBXGroup;
children = (
BEC57D321B909F3400F0F4B4 /* Aitken */,
BE51121C1BDFB56600CB5D1E /* main_aitken.cpp */,
BEC57D331B909F3400F0F4B4 /* Model.hpp */,
BEC57D341B909F3400F0F4B4 /* Model.hxx */,
BE6A0F681BC3A8E600CA3D8F /* ModelForward.hxx */,
......@@ -7486,6 +7491,11 @@
BEBEBC181BDFB3480011D835 /* Newton */ = {
isa = PBXGroup;
children = (
BEBEBC1C1BDFB4F10011D835 /* main_newton.cpp */,
BEBEBC1D1BDFB4F10011D835 /* Model.hpp */,
BEBEBC1E1BDFB4F10011D835 /* Model.hxx */,
BEBEBC1F1BDFB4F10011D835 /* ModelAccessors.hxx */,
BEBEBC201BDFB4F10011D835 /* ModelForward.hxx */,
);
name = Newton;
sourceTree = "<group>";
......@@ -10360,8 +10370,8 @@
files = (
BEBEBBDA1BDFB2380011D835 /* Policy.cpp in Sources */,
BEBEBBDB1BDFB2380011D835 /* ExplicitStepVariationalFormulation.cpp in Sources */,
BEBEBC211BDFB4F10011D835 /* main_newton.cpp in Sources */,
BEBEBBDC1BDFB2380011D835 /* InputParameter.cpp in Sources */,
BEBEBBDD1BDFB2380011D835 /* Aitken in Sources */,
BEBEBBDE1BDFB2380011D835 /* ImplicitStepFluidVariationalFormulation.cpp in Sources */,
BEBEBBDF1BDFB2380011D835 /* VariationalFormulation.cpp in Sources */,
);
......@@ -10373,8 +10383,8 @@
files = (
BEFC2B301BD7D6770067F358 /* Policy.cpp in Sources */,
BEC57D351B909F3400F0F4B4 /* ExplicitStepVariationalFormulation.cpp in Sources */,
BE51121D1BDFB56600CB5D1E /* main_aitken.cpp in Sources */,
BEC57D371B909F3400F0F4B4 /* InputParameter.cpp in Sources */,
BEC57D381B909F3400F0F4B4 /* Aitken in Sources */,
BEC57D361B909F3400F0F4B4 /* ImplicitStepFluidVariationalFormulation.cpp in Sources */,
BEFC2B311BD7D6770067F358 /* VariationalFormulation.cpp in Sources */,
);
......
//
// Model.hpp
// HappyHeart
//
// Created by Sebastien Gilles on 07/07/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_HPP_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_HPP_
# include <memory>
# include <vector>
# include "Operators/ConformInterpolatorInstances/P1_to_P2.hpp"
# include "Operators/ConformInterpolatorInstances/SubsetOrSuperset.hpp"
# include "Model/Model.hpp"
# include "ModelInstances/FSI_EI/ExplicitStepVariationalFormulation.hpp"
# include "ModelInstances/FSI_EI/ImplicitStepFluidVariationalFormulation.hpp"
# include "ModelInstances/FSI_EI/InputParameterList.hpp"
# include "ModelInstances/Hyperelasticity/VariationalFormulationHyperElasticity.hpp"
namespace HappyHeart
{
namespace FSI_EINS
{
/*!
* \brief Class in charge of FSI model.
* \tparam SolidVariationalFormulationPolicyT Which elastic or hyperelastic variational formulation should be used.
*
*/
template<class SolidVariationalFormulationPolicyT>
class Model
: public HappyHeart::Model<Model<SolidVariationalFormulationPolicyT>, DoConsiderProcessorWiseLocal2Global::yes>,
public SolidVariationalFormulationPolicyT
{
private:
//! Alias to self.
using self = Model<SolidVariationalFormulationPolicyT>;
using parent = HappyHeart::Model<Model<SolidVariationalFormulationPolicyT>, DoConsiderProcessorWiseLocal2Global::yes>;
public:
//! Return the name of the model.
static const std::string& ClassName();
//! Friendship granted to the base class so this one can manipulates private methods.
friend parent;
public:
/// \name Special members.
///@{
//! Constructor.
Model(const Wrappers::Mpi& mpi,
const InputParameterList& input_parameter_data);
//! Destructor.
~Model() = default;
//! Copy constructor.
Model(const Model&) = delete;
//! Move constructor.
Model(Model&&) = delete;
//! Copy affectation.
Model& operator=(const Model&) = delete;
//! Move affectation.
Model& operator=(Model&&) = delete;
///@}
/// \name Crtp-required methods.
///@{
/*!
* \brief Initialise the problem.
*
* This initialisation includes the resolution of the static problem.
*/
void SupplInitialize(const InputParameterList& input_parameter_data);
//! Manage time iteration.
void Forward();
/*!
* \brief Additional operations to finalize a dynamic step.
*
* Base class already update the time for next time iterations.
*/
void SupplFinalizeStep();
/*!
* \brief Initialise a dynamic step.
*
*/
void SupplFinalize();
private:
/*!
* \brief Whether the model wants to add additional cases in which the Model stops (besides the reach of
* maximum time).
*
* Returns always true (no such additional condition in this Model).
*/
bool SupplHasFinishedConditions() const;
/*!
* \brief Part of InitializedStep() specific to Elastic model.
*
* As there are none, the body of this method is empty.
*/
void SupplInitializeStep();
///@}
void InterpolateSolidDisplacementToInterface(const GlobalVector& source,
GlobalVector& target,
const char* invoking_file,
int invoking_line);
private:
/// \name Forward() methods.
///@{
//! Explicit fluid step.
void ExplicitFluidStep(const std::string& output_dir);
//! Implicit fluid step.
void ImplicitFluidStep(const std::string& output_dir,
unsigned int aitken_index);
//! Update fluid Dirichlet condition.
void UpdateFluidDirichletCondition(const std::string& aitken_output_dir);
//! Update solid displacements before SoF.
void UpdateSolidDisplacementBeforeSoF(const std::string& aitken_output_dir);
//! Compute solid residual (in input of solid variational formulation).
void ComputeSolidResidual(const std::string& output_dir);
//! Implicit solid step.
void ImplicitSolidStep(const std::string& output_dir,
unsigned int aitken_index);
//! Update solid displacements after SoF.
void UpdateSolidDisplacementAfterSoF(const std::string& aitken_output_dir);
//! Compute aitken coefficient.
double ComputeAitkenCoefficient(unsigned int aitken_index, const double omega_0);
//! Compute error at the end of the current aitken iteration.
double ComputeAitkenError();
//! Compute the solid displacement after application of Aitken coefficient,
void UpdateSolidDisplacementEndOfAitken(const double aitken_coefficient,
const std::string& aitken_output_dir);
//! Compute Aitken coefficient mass matrix.
void ComputeAitkenCoefficientMassMatrix();
///@}
private:
//! Underlying variational formulation.
const ExplicitStepVariationalFormulation& GetExplicitStepVariationalFormulation() const noexcept;
//! Underlying variational formulation.
ExplicitStepVariationalFormulation& GetNonCstExplicitStepVariationalFormulation() noexcept;
//! Underlying variational formulation.
const ImplicitStepFluidVariationalFormulation& GetImplicitStepFluidVariationalFormulation() const noexcept;
//! Underlying variational formulation.
ImplicitStepFluidVariationalFormulation& GetNonCstImplicitStepFluidVariationalFormulation() noexcept;
//! Non constant access to sum of explicit and implicit steps residuals.
GlobalVector& GetNonCstSumFluidResidual() noexcept;
//! Non constant access to sum of explicit and implicit steps residuals on solid space.
GlobalVector& GetNonCstSolidResidual() noexcept;
//! Get the interpolation matrix for solid velocity -> fluid velocity.
const GlobalMatrix& GetInterpolationMatrixSolid2FluidVelocity() const noexcept;
//! Get the interpolation matrix for solid velocity -> fluid velocity.
GlobalMatrix& GetNonCstInterpolationMatrixSolid2FluidVelocity() noexcept;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
const GlobalVector& GetSolidDisplacementBeforeSoF() const noexcept;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector& GetNonCstSolidDisplacementBeforeSoF() noexcept;
const GlobalVector& GetSolidDisplacementBeforeSoFPreviousAitkenLoop() const noexcept;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector& GetNonCstSolidDisplacementBeforeSoFPreviousAitkenLoop() noexcept;
const GlobalVector& GetSolidDisplacementAfterSoFPreviousAitkenLoop() const noexcept;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector& GetNonCstSolidDisplacementAfterSoFPreviousAitkenLoop() noexcept;
const GlobalVariationalOperatorNS::Mass& GetAitkenCoefficientMassOperator() const noexcept;
private:
//! Underlying variational formulation for explicit step.
ExplicitStepVariationalFormulation::unique_ptr explicit_step_variational_formulation_ = nullptr;
//! Underlying variational formulation for fluid implicit step.
ImplicitStepFluidVariationalFormulation::unique_ptr implicit_step_fluid_variational_formulation_ = nullptr;
//! Sum of implicit and explicit steps residuals.
GlobalVector::unique_ptr sum_fluid_residual_ = nullptr;
//! Residual on the solid function space of sum_fluid_residual_.
GlobalVector::unique_ptr solid_residual_ = nullptr;
//! Solid displacement before SoF is applied (in Aitken loop). See Bruno's note for more details about Aitken.
GlobalVector::unique_ptr solid_displacement_before_SoF_ = nullptr;
GlobalVector::unique_ptr solid_displacement_before_SoF_previous_aitken_loop_ = nullptr;
GlobalVector::unique_ptr solid_displacement_after_SoF_ = nullptr;
GlobalVector::unique_ptr solid_displacement_after_SoF_previous_aitken_loop_ = nullptr;
GlobalVector::unique_ptr solid_displacement_end_of_aitken_ = nullptr;
GlobalVector::unique_ptr solid_velocity_on_interface_ = nullptr;
GlobalVector::unique_ptr p2_solid_velocity_on_interface_ = nullptr;
GlobalVector::unique_ptr solid_displacement_previous_time_iteration_ = nullptr;
GlobalVector::unique_ptr solid_displacement_end_of_aitken_on_interface_ = nullptr;
GlobalVector::unique_ptr solid_displacement_previous_time_iteration_on_interface_ = nullptr;
GlobalVector::unique_ptr work_vector_1_ = nullptr;
GlobalVector::unique_ptr work_vector_2_ = nullptr;
GlobalVector::unique_ptr work_vector_3_ = nullptr;
GlobalVector::unique_ptr solid_velocity_tmp_ = nullptr; // \todo #717 #608 Just for dev purposes!
/*!
* \brief Interpolation matrix for solid velocity -> fluid velocity.
*
* \internal This matrix is actually the product of three interpolation matrices: two matrices to place
* oneself on the interface and the third one for P1->P2 interpolation.
*/
GlobalMatrix::unique_ptr interpolation_matrix_solid_2_fluid_velocity_ = nullptr;
GlobalVariationalOperatorNS::Mass::const_unique_ptr aitken_coefficient_mass_operator_ = nullptr;
ConformInterpolatorNS::SubsetOrSuperset::unique_ptr solid_to_fsi_interpolator_ = nullptr;
ConformInterpolatorNS::P1_to_P2::unique_ptr solid_to_fluid_velocity_on_fsi_interpolator_ = nullptr;
GlobalMatrix::unique_ptr aitken_coefficient_mass_matrix_ = nullptr;
};
} // namespace FSI_EINS
} // namespace HappyHeart
# include "ModelInstances/FSI_EI/Newton/Model.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_HPP_
This diff is collapsed.
//
// Model.hxx
// HappyHeart
//
// Created by Sebastien Gilles on 07/07/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_ACCESSORS_HXX_
# define HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_ACCESSORS_HXX_
namespace HappyHeart
{
namespace FSI_EINS
{
template<class SolidVariationalFormulationPolicyT>
inline const ExplicitStepVariationalFormulation& Model<SolidVariationalFormulationPolicyT>::GetExplicitStepVariationalFormulation() const noexcept
{
assert(!(!explicit_step_variational_formulation_));
return *explicit_step_variational_formulation_;
}
template<class SolidVariationalFormulationPolicyT>
inline ExplicitStepVariationalFormulation& Model<SolidVariationalFormulationPolicyT>::GetNonCstExplicitStepVariationalFormulation() noexcept
{
return const_cast<ExplicitStepVariationalFormulation&>(GetExplicitStepVariationalFormulation());
}
template<class SolidVariationalFormulationPolicyT>
inline const ImplicitStepFluidVariationalFormulation& Model<SolidVariationalFormulationPolicyT>::GetImplicitStepFluidVariationalFormulation() const noexcept
{
assert(!(!implicit_step_fluid_variational_formulation_));
return *implicit_step_fluid_variational_formulation_;
}
template<class SolidVariationalFormulationPolicyT>
inline ImplicitStepFluidVariationalFormulation& Model<SolidVariationalFormulationPolicyT>::GetNonCstImplicitStepFluidVariationalFormulation() noexcept
{
return const_cast<ImplicitStepFluidVariationalFormulation&>(GetImplicitStepFluidVariationalFormulation());
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetNonCstSumFluidResidual() noexcept
{
assert(!(!sum_fluid_residual_));
return *sum_fluid_residual_;
}
template<class SolidVariationalFormulationPolicyT>
const GlobalMatrix& Model<SolidVariationalFormulationPolicyT>
::GetInterpolationMatrixSolid2FluidVelocity() const noexcept
{
assert(!(!interpolation_matrix_solid_2_fluid_velocity_));
return *interpolation_matrix_solid_2_fluid_velocity_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalMatrix& Model<SolidVariationalFormulationPolicyT>
::GetNonCstInterpolationMatrixSolid2FluidVelocity() noexcept
{
return const_cast<GlobalMatrix&>(GetInterpolationMatrixSolid2FluidVelocity());
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>
::GetNonCstSolidResidual() noexcept
{
assert(!(!solid_residual_));
return *solid_residual_;
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetSolidDisplacementBeforeSoF() const noexcept
{
assert(!(!solid_displacement_before_SoF_));
return *solid_displacement_before_SoF_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>::GetNonCstSolidDisplacementBeforeSoF() noexcept
{
return const_cast<GlobalVector&>(GetSolidDisplacementBeforeSoF());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>
::GetSolidDisplacementBeforeSoFPreviousAitkenLoop() const noexcept
{
assert(!(!solid_displacement_before_SoF_previous_aitken_loop_));
return *solid_displacement_before_SoF_previous_aitken_loop_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>
::GetNonCstSolidDisplacementBeforeSoFPreviousAitkenLoop() noexcept
{
return const_cast<GlobalVector&>(GetSolidDisplacementBeforeSoFPreviousAitkenLoop());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVector& Model<SolidVariationalFormulationPolicyT>
::GetSolidDisplacementAfterSoFPreviousAitkenLoop() const noexcept
{
assert(!(!solid_displacement_after_SoF_previous_aitken_loop_));
return *solid_displacement_after_SoF_previous_aitken_loop_;
}
template<class SolidVariationalFormulationPolicyT>
GlobalVector& Model<SolidVariationalFormulationPolicyT>
::GetNonCstSolidDisplacementAfterSoFPreviousAitkenLoop() noexcept
{
return const_cast<GlobalVector&>(GetSolidDisplacementAfterSoFPreviousAitkenLoop());
}
template<class SolidVariationalFormulationPolicyT>
const GlobalVariationalOperatorNS::Mass& Model<SolidVariationalFormulationPolicyT>
::GetAitkenCoefficientMassOperator() const noexcept
{
assert(!(!aitken_coefficient_mass_operator_));
return *aitken_coefficient_mass_operator_;
}
} // namespace FSI_EINS
} // namespace HappyHeart
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_NEWTON_x_MODEL_ACCESSORS_HXX_
This diff is collapsed.
//
// main.cpp
// HappyHeart
//
// Created by Sebastien Gilles on 07/07/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Utilities/Exceptions/PrintAndAbort.hpp"
#include "Core/InitHappyHeart.hpp"
#include "Operators/LocalVariationalOperatorInstances/NonlinearForm/Hyperelasticity/HyperelasticLaws/CiarletGeymonat.hpp"
#include "Operators/LocalVariationalOperatorInstances/NonlinearForm/Hyperelasticity/HyperelasticLaws/StVenantKirchhoff.hpp"
#include "ModelInstances/FSI_EI/Newton/Model.hpp"
#include "ModelInstances/FSI_EI/InputParameterList.hpp"
#include "ModelInstances/FSI_EI/SolidVariationalFormulationPolicy/Hyperelasticity/Policy.hpp"
#include "ModelInstances/FSI_EI/SolidVariationalFormulationPolicy/Elasticity/Policy.hpp"
using namespace HappyHeart;
int main(int argc, char ** argv)
{
using InputParameterList = FSI_EINS::InputParameterList;
try
{
InitHappyHeart<InputParameterList> happy_heart(argc, argv);
const auto& input_parameter_data = happy_heart.GetInputParameterList();
const auto& mpi = happy_heart.GetMpi();
// \todo #608 Remove temporarily any previous output folder.
{
namespace IPL = Utilities::InputParameterListNS;
const auto& folder = IPL::Extract<InputParameter::Result::OutputDirectory>::Folder(input_parameter_data);
if (mpi.IsRootProcessor())
{
if (Folder::DoExist(folder))
Folder::Remove(folder);
}
mpi.Barrier();
}
#define HYPERELASTICITY_IN_FSI
#ifdef HYPERELASTICITY_IN_FSI
using SolidVariationalFormulationPolicy =