Commit 3edd5ab6 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#723 FSI/Newton: remove some parts closely related to Aitken.

parent a22553c2
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0710"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BEBEBBC21BDFB2380011D835"
BuildableName = "FSI_EI_Newton"
BlueprintName = "FSI_EI_Newton"
ReferencedContainer = "container:HappyHeart.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BEBEBBC21BDFB2380011D835"
BuildableName = "FSI_EI_Newton"
BlueprintName = "FSI_EI_Newton"
ReferencedContainer = "container:HappyHeart.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BEBEBBC21BDFB2380011D835"
BuildableName = "FSI_EI_Newton"
BlueprintName = "FSI_EI_Newton"
ReferencedContainer = "container:HappyHeart.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "--input_parameters ${HOME}/Codes/HappyHeart/Data/Lua/demo_input_fsi_ei.lua"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BEBEBBC21BDFB2380011D835"
BuildableName = "FSI_EI_Newton"
BlueprintName = "FSI_EI_Newton"
ReferencedContainer = "container:HappyHeart.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -538,7 +538,4 @@ namespace HappyHeart
} // namespace HappyHeart
# include "ModelInstances/FSI_EI/Aitken/ModelAccessors.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x_AITKEN_x_MODEL_FORWARD_HXX_
......@@ -154,37 +154,22 @@ namespace HappyHeart
void ExplicitFluidStep(const std::string& output_dir);
//! Implicit fluid step.
void ImplicitFluidStep(const std::string& output_dir,
unsigned int aitken_index);
void ImplicitFluidStep();
//! Update fluid Dirichlet condition.
void UpdateFluidDirichletCondition(const std::string& aitken_output_dir);
void UpdateFluidDirichletCondition();
//! Update solid displacements before SoF.
void UpdateSolidDisplacementBeforeSoF(const std::string& aitken_output_dir);
void UpdateSolidDisplacementBeforeSoF();
//! Compute solid residual (in input of solid variational formulation).
void ComputeSolidResidual(const std::string& output_dir);
void ComputeSolidResidual();
//! Implicit solid step.
void ImplicitSolidStep(const std::string& output_dir,
unsigned int aitken_index);
void ImplicitSolidStep(const std::string& output_dir);
//! 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();
void UpdateSolidDisplacementAfterSoF();
///@}
......@@ -221,18 +206,6 @@ namespace HappyHeart
//! 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:
......@@ -253,19 +226,15 @@ namespace HappyHeart
//! 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.
......@@ -275,13 +244,10 @@ namespace HappyHeart
*/
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;
};
......
......@@ -21,7 +21,7 @@ namespace HappyHeart
template<class SolidVariationalFormulationPolicyT>
inline const std::string& Model<SolidVariationalFormulationPolicyT>::ClassName()
{
static std::string name("FSI_EI");
static std::string name("FSI_EI_Newton");
return name;
}
......@@ -97,9 +97,6 @@ namespace HappyHeart
const auto& numbering_subset = god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_displacement));
solid_velocity_tmp_ = std::make_unique<GlobalVector>(god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_velocity)));
AllocateGlobalVector(god_of_dof, *solid_velocity_tmp_);
auto&& bc_list = { bc_manager.GetDirichletBoundaryConditionPtr("solid") };
SolidVariationalFormulationPolicyT::CreateSolidFormulation(mpi,
......@@ -123,33 +120,21 @@ namespace HappyHeart
HappyHeart::AllocateGlobalVector(god_of_dof, solid_displacement_before_SoF);
solid_displacement_before_SoF_previous_aitken_loop_ =
std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_after_SoF_previous_aitken_loop_ =
std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_after_SoF_ =
std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_end_of_aitken_ =
std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_previous_time_iteration_ =
std::make_unique<GlobalVector>(solid_displacement_before_SoF);
solid_displacement_end_of_aitken_on_interface_ =
std::make_unique<GlobalVector>(solid_numbering_subset_on_interface);
AllocateGlobalVector(god_of_dof, *solid_displacement_end_of_aitken_on_interface_);
solid_displacement_previous_time_iteration_on_interface_ =
std::make_unique<GlobalVector>(*solid_displacement_end_of_aitken_on_interface_);
std::make_unique<GlobalVector>(solid_numbering_subset_on_interface);
HappyHeart::AllocateGlobalVector(god_of_dof, *solid_displacement_previous_time_iteration_on_interface_);
work_vector_1_ = std::make_unique<GlobalVector>(*solid_displacement_end_of_aitken_on_interface_);
work_vector_2_ = std::make_unique<GlobalVector>(*solid_displacement_end_of_aitken_on_interface_);
work_vector_3_ = std::make_unique<GlobalVector>(*solid_displacement_end_of_aitken_on_interface_);
work_vector_1_ = std::make_unique<GlobalVector>(*solid_displacement_previous_time_iteration_on_interface_);
work_vector_2_ = std::make_unique<GlobalVector>(*solid_displacement_previous_time_iteration_on_interface_);
work_vector_3_ = std::make_unique<GlobalVector>(*solid_displacement_previous_time_iteration_on_interface_);
}
......@@ -249,25 +234,6 @@ namespace HappyHeart
solid_to_fsi_interpolator_->Init();
}
{
// Initialize the mass operator used within the aitken loop.
namespace GVO = GlobalVariationalOperatorNS;
aitken_coefficient_mass_operator_ =
std::make_unique<GVO::Mass>(god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fsi)),
unknown_manager.GetUnknown(EnumUnderlyingType(UnknownIndex::solid_displacement)),
god_of_dof.GetGeometricMeshRegion().GetDimension(),
SolidVariationalFormulationPolicyT::GetVariationalFormulation().GetQuadratureRulePerTopologyType(),
DoComputeProcessorWiseLocal2Global::yes);
{
const auto& numbering_subset = god_of_dof.GetNumberingSubset(EnumUnderlyingType(NumberingSubsetIndex::solid_displacement_on_interface));
aitken_coefficient_mass_matrix_ = std::make_unique<GlobalMatrix>(numbering_subset, numbering_subset);
AllocateGlobalMatrix(god_of_dof,
*aitken_coefficient_mass_matrix_);
}
}
}
......@@ -290,10 +256,8 @@ namespace HappyHeart
}
{
auto& variational_formulation = SolidVariationalFormulationPolicyT::GetNonCstVariationalFormulation();
variational_formulation.UpdatePreviousTimeIterationData(*solid_displacement_end_of_aitken_,
*solid_displacement_previous_time_iteration_,
output_dir);
// Update previous time iteration data
// auto& variational_formulation = SolidVariationalFormulationPolicyT::GetNonCstVariationalFormulation();
}
{
......@@ -305,29 +269,6 @@ namespace HappyHeart
__FILE__, __LINE__);
}
{
auto& solid_displacement_end_of_aitken = *solid_displacement_end_of_aitken_;
solid_displacement_end_of_aitken.template
Print<MpiScale::processor_wise>(mpi, output_dir + "solution_implicit_solid.hhdata",
__FILE__, __LINE__);
}
{
auto& solid_displacement_previous_time_iteration = *solid_displacement_previous_time_iteration_;
solid_displacement_previous_time_iteration.Copy(*solid_displacement_end_of_aitken_,
__FILE__, __LINE__);
auto& solid_displacement_previous_time_iteration_on_interface = *solid_displacement_previous_time_iteration_on_interface_;
InterpolateSolidDisplacementToInterface(solid_displacement_previous_time_iteration,
solid_displacement_previous_time_iteration_on_interface,
__FILE__, __LINE__);
}
{
const auto& implicit_step_formulation = GetImplicitStepFluidVariationalFormulation();
......@@ -349,9 +290,7 @@ namespace HappyHeart
template<class SolidVariationalFormulationPolicyT>
void Model<SolidVariationalFormulationPolicyT>::SupplFinalize()
{
// TODO: Put there what to do when all the time steps are done
}
{ }
......
......@@ -98,49 +98,7 @@ namespace HappyHeart
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_;
}
......
......@@ -507,7 +507,4 @@ namespace HappyHeart
} // namespace HappyHeart
# include "ModelInstances/FSI_EI_2_meshes/ModelAccessors.hxx"
#endif // HAPPY_HEART_x_MODEL_INSTANCES_x_F_S_I_x_E_I_x2_xMESHES_x_MODEL_FORWARD_HXX_
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment