Commit 823e1df1 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#757 FSI: introduce a macro to be able to deal with both P1b and P2 cases.

parent e7491d08
......@@ -632,31 +632,6 @@ FiniteElementSpace6 = {
-- FiniteElementSpace7 -- Test for Dirichlet axis
FiniteElementSpace7 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 4,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = { 'fluid_velocity'},
-- List of the shape function to use for each unknown;
-- Expected format: {"VALUE1", "VALUE2", ...}
shape_function_list = { 'P1' },
-- List of the numbering subset to use for each unknown;
-- Expected format: {VALUE1, VALUE2, ...}
numbering_subset_list = { 2 }
}
Petsc1 = {
-- Absolute tolerance
......
......@@ -49,10 +49,7 @@ namespace HappyHeart
SetLabelList(mesh_label_index_list);
if (!geometric_type_list.empty())
{
std::cout << "SET LIST FOR DOMAIN " << unique_id << std::endl;
SetGeometricEltTypeList(geometric_type_list);
}
}
......
......@@ -85,12 +85,9 @@ namespace HappyHeart
{
const auto& type_list = GetGeometricTypeList();
const auto foo =std::binary_search(type_list.cbegin(),
return std::binary_search(type_list.cbegin(),
type_list.cend(),
object.GetIdentifier());
std::cout << "FOO -> " << foo << std::endl;
return foo;
}
}
......
......@@ -57,6 +57,7 @@ namespace HappyHeart
fsi = 3,
fluid_velocity_pressure = 4,
inlet_border = 5,
fluid_only_pressure = 6 // For dev purposes only
};
......@@ -85,7 +86,8 @@ namespace HappyHeart
solid_velocity = 5,
fluid_on_interface = 6,
solid_velocity_on_interface = 7,
solid_displacement_on_interface = 8
solid_displacement_on_interface = 8,
fluid_pressure = 9
};
......@@ -115,6 +117,7 @@ namespace HappyHeart
InputParameter::NumberingSubset<EnumUnderlyingType(NumberingSubsetIndex::fluid_on_interface)>,
InputParameter::NumberingSubset<EnumUnderlyingType(NumberingSubsetIndex::solid_velocity_on_interface)>,
InputParameter::NumberingSubset<EnumUnderlyingType(NumberingSubsetIndex::solid_displacement_on_interface)>,
InputParameter::NumberingSubset<EnumUnderlyingType(NumberingSubsetIndex::fluid_pressure)>,
InputParameter::Unknown<EnumUnderlyingType(UnknownIndex::fluid_velocity)>,
InputParameter::Unknown<EnumUnderlyingType(UnknownIndex::fluid_pressure)>,
......@@ -139,11 +142,7 @@ namespace HappyHeart
InputParameter::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::fsi)>,
InputParameter::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::fluid_velocity_pressure)>,
InputParameter::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::inlet_border)>,
<<<<<<< HEAD
=======
InputParameter::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::fluid_only_pressure)>,
InputParameter::FEltSpace<EnumUnderlyingType(FEltSpaceIndex::dirichlet_axis)>,
>>>>>>> 07976dd... #759 Boundary condition: now domain is fully applied, not only the mesh labels part of it.
InputParameter::Petsc<EnumUnderlyingType(SolverIndex::main_solver)>,
InputParameter::Petsc<EnumUnderlyingType(SolverIndex::dh_solver)>,
......
......@@ -316,8 +316,10 @@ namespace HappyHeart
ConformInterpolatorNS::SubsetOrSuperset::unique_ptr solid_to_fsi_interpolator_ = nullptr;
# ifdef HH_P2
ConformInterpolatorNS::P1_to_P2::unique_ptr solid_to_fluid_velocity_on_fsi_interpolator_ = nullptr;
# endif // HH_P2
Wrappers::Petsc::Snes::unique_ptr differential_solid_solver_ = nullptr;
Wrappers::Petsc::Snes::unique_ptr dH_solver_ = nullptr;
......
......@@ -149,6 +149,7 @@ namespace HappyHeart
}
# ifdef HH_P2
{
const auto& fsi_felt_space = god_of_dof.GetFEltSpace(EnumUnderlyingType(FEltSpaceIndex::fsi));
......@@ -177,6 +178,7 @@ namespace HappyHeart
solid_to_fluid_velocity_on_fsi_interpolator_->Init();
}
# endif // HH_P2
{
......@@ -214,11 +216,22 @@ namespace HappyHeart
auto& interpolation_matrix_solid_2_fluid_velocity = GetNonCstInterpolationMatrixSolid2FluidVelocity();
# ifdef HH_P2
Wrappers::Petsc::MatMatMatMult(fsi_2_fluid.GetInterpolationMatrix(),
solid_to_fluid_velocity_on_fsi_interpolator_->GetInterpolationMatrix(), // \TODO #608 Use accessor!
solid_2_fsi.GetInterpolationMatrix(),
interpolation_matrix_solid_2_fluid_velocity,
__FILE__, __LINE__);
# else // HH_P2
Wrappers::Petsc::MatMatMult(fsi_2_fluid.GetInterpolationMatrix(),
solid_2_fsi.GetInterpolationMatrix(),
interpolation_matrix_solid_2_fluid_velocity,
__FILE__, __LINE__);
# endif // HH_P2
}
{
......
......@@ -167,11 +167,15 @@ namespace HappyHeart
auto& p2_solid_velocity_on_interface = GetNonCstVector<Fluid::p2_vel_on_interface>();
# ifdef HH_P2
Wrappers::Petsc::MatMult(solid_to_fluid_velocity_on_fsi_interpolator_->GetInterpolationMatrix(),
velFromSr_on_interface,
p2_solid_velocity_on_interface,
__FILE__, __LINE__);
# else // HH_P2
p2_solid_velocity_on_interface.Copy(velFromSr_on_interface, __FILE__, __LINE__);
# endif // HH_P2
{
const PetscReal evaluation_state_min = p2_solid_velocity_on_interface.Min(__FILE__, __LINE__).second;
const PetscReal evaluation_state_max = p2_solid_velocity_on_interface.Max(__FILE__, __LINE__).second;
......
......@@ -69,10 +69,10 @@ namespace HappyHeart
template<class MatrixT>
std::enable_if_t<std::is_base_of<Private::BaseMatrix, MatrixT>::value, void>
MatMatMatMult(const MatrixT& matrix1,
const MatrixT& matrix2,
const MatrixT& matrix3,
MatrixT& matrix4,
const char* invoking_file, int invoking_line)
const MatrixT& matrix2,
const MatrixT& matrix3,
MatrixT& matrix4,
const char* invoking_file, int invoking_line)
{
Mat result;
......
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