Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 52 additions & 21 deletions include/core/mortar_coupling_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,28 @@ class MortarManagerBase
get_config(const Point<dim> &face_center, const bool is_inner) const;

/**
* @brief Convert radiant to quadrature point in real space.
* @brief Convert angle (in radians) to quadrature point in real space
*
* @param[in] angle_rad Angle (in radians)
* @return Point in cartesian coordinates
*/
virtual Point<dim>
from_1D(const double radiant) const = 0;
from_1D(const double angle_rad) const = 0;

/**
* @brief Convert quadrature point in real space to radiant.
* @brief Convert quadrature point in real space to angle (in radians)
*
* @param[in] point Point in cartesian coordinates
* @return Angle (in radians)
*/
virtual double
to_1D(const Point<dim> &point) const = 0;

/**
* @brief Return the normal for a given quadrature point.
* @brief Return the normal for a given quadrature point
*
* @param[in] point Point in cartesian coordinates
* @return Corresponding outward normal vector
*/
virtual Tensor<1, dim, double>
get_normal(const Point<dim> &point) const = 0;
Expand All @@ -183,15 +192,18 @@ class MortarManagerBase
};

/**
* @brief Compute the number of subdivisions at the rotor-stator interface and the rotor radius
* @brief Compute parameters of the mortar interface: n_subdivisions, interface_dimensions,
* and pre_rotation_angle
* @param[in] triangulation The triangulation object
* @param[in] mapping Mapping associated to the domain
* @param[in] mortar_parameters The information about the mortar method
* control, including the rotor mesh parameters
*
* @return n_subdivisions Number of cells at the interface between inner
* and outer domains
* @return radius Radius at the interface between inner and outer domains
* @return interface_dimensions Vector containing the radius at the mortar interface and the
* domain length in the direction of the rotation axis
* @return pre_rotation_angle Rotation angle of the initial mesh configuration
*/
template <int dim>
std::tuple<std::vector<unsigned int>, std::vector<double>, double>
Expand Down Expand Up @@ -243,7 +255,7 @@ class MortarManagerCircle : public MortarManagerBase<dim>

protected:
Point<dim>
from_1D(const double rad) const override;
from_1D(const double angle_rad) const override;

double
to_1D(const Point<dim> &point) const override;
Expand Down Expand Up @@ -628,14 +640,20 @@ class CouplingOperator
{
public:
/**
* @brief Constructor.
* @brief Mortar coupling operator constructor
*
* @param[in] quadrature Quadrature for local cell operations
* @param[in] dof_handler DoFHandler associated to the triangulation
* @param[in] constraints Constraints object
* @param[in] evaluator Mortar evaluation data
* @param[in] mortar_manager Mortar manager
* @param[in] bid_m Boundary ID of the face whose outwards-pointing
* normal shows in the same direction as the normal provided by
* @p mortar_manager.
* @param[in] bid_p Boundary ID of the face whose outwards-pointing
* normal shows in the opposite direction as the normal provided by
* @p mortar_manager.
* normal shows in the same direction as the normal provided by
* @p mortar_manager.
* @param[in] bid_p Boundary ID of the face whose outwards-pointing normal
* shows in the opposite direction as the normal provided by
* @p mortar_manager.
* @param[in] sip_factor Penalty factor used in SIPG term
*/
CouplingOperator(
const Mapping<dim> &mapping,
Expand Down Expand Up @@ -718,12 +736,12 @@ class CouplingOperator
const typename Triangulation<dim>::cell_iterator &cell) const;

/**
* @brief Returns angle of a point (cell center)
* @brief Returns the point corresponding to the cell center
*
* @param[in] cell Cell iterator
* @param[in] face Face iterator
*
* @return Angle in radians
* @return Cell center in cartesian coordinates
*/
Point<dim>
get_face_center(const typename Triangulation<dim>::cell_iterator &cell,
Expand All @@ -733,6 +751,8 @@ class CouplingOperator
* @brief Returns dof indices
*
* @param[in] cell Cell iterator
*
* @return Vector of global dof indices
*/
std::vector<types::global_dof_index>
get_dof_indices(
Expand All @@ -757,9 +777,11 @@ class CouplingOperator
/// Number of data points per quadrature point
unsigned int q_data_size;

/// Boundary ID of the inner domain (rotor)
/// Boundary ID of the face whose outwards-pointing normal shows in the
/// same direction as the normal provided by @p mortar_manager
const unsigned int bid_m;
/// Boundary ID of the outer domain (stator)
/// Boundary ID of the face whose outwards-pointing normal shows in the
/// opposite direction as the normal provided by @p mortar_manager
const unsigned int bid_p;

/// List of relevant DoF indices per cell
Expand Down Expand Up @@ -788,14 +810,17 @@ class CouplingOperator
/**
* @brief Create a temporary vector where mortar evaluation data is stored
* before being passed to the system matrix
*
* @param[in] ptr Vector of values on one of the mortar sides
* @param[in] offset Number of components to offset the ptr vector
*/
template <typename T>
class BufferRW
{
public:
/**
* @brief Class constructor
*
* @param[in] ptr Vector of values on one of the mortar sides
* @param[in] offset Number of components to offset the ptr vector
*/
BufferRW(T *ptr, const unsigned int offset)
: ptr(ptr ? (ptr + offset) : nullptr)
{}
Expand Down Expand Up @@ -910,12 +935,18 @@ class NavierStokesCouplingEvaluation

using u_value_type = typename FEPointIntegratorU::value_type;

/**
* @brief Class constructor
* @param[in] mapping Mapping associated to the domain
* @param[in] dof_handler DoFHandler associated to the triangulation
* @param[in] kinematic_vicosity Kinematic viscosity
*/
NavierStokesCouplingEvaluation(const Mapping<dim> &mapping,
const DoFHandler<dim> &dof_handler,
const double kinematic_viscosity);

/**
* @brief Default destructor.
* @brief Default destructor
*/
virtual ~NavierStokesCouplingEvaluation() = default;

Expand Down
10 changes: 5 additions & 5 deletions include/core/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -978,19 +978,19 @@ point_to_angle(const Point<dim> &point,

/**
* @brief Converts radius to point in cartesian coordinates (in the x-y plane)
* @param[in] radius Radial distance.
* @param[in] rad Angle (in radians).
* @param[in] radius Radial distance
* @param[in] angle_rad Angle (in radians)
*
* @return point Point cartesian coordinates
*/
template <int dim>
inline Point<dim>
radius_to_point(const double radius, const double rad)
radius_to_point(const double radius, const double angle_rad)
{
Point<dim> point;

point[0] = radius * std::cos(rad);
point[1] = radius * std::sin(rad);
point[0] = radius * std::cos(angle_rad);
point[1] = radius * std::sin(angle_rad);

return point;
}
Expand Down
3 changes: 3 additions & 0 deletions include/solvers/fluid_dynamics_matrix_free.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ class MFNavierStokesPreconditionGMGBase
/// DoF handlers for each of the levels of the global coarsening algorithm
MGLevelObject<DoFHandler<dim>> dof_handlers;

/// MappingQCache for each of the levels of the global coarsening algorithm
MGLevelObject<std::shared_ptr<MappingQCache<dim>>> mappings;

/// Transfers for each of the levels of the global coarsening algorithm
MGLevelObject<MGTwoLevelTransfer<dim, MGVectorType>> transfers;

Expand Down
2 changes: 1 addition & 1 deletion source/core/grids.cc
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ read_mesh_and_manifolds_for_stator_and_rotor(
std::to_string(n_faces_rotor_interface_total) +
") is different from the number of faces at the stator interface ID #" +
std::to_string(mortar_parameters.stator_boundary_id) + " (" +
std::to_string(n_faces_rotor_interface_total) + ")."));
std::to_string(n_faces_stator_interface_total) + ")."));
}

template void
Expand Down
20 changes: 6 additions & 14 deletions source/core/mortar_coupling_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ MortarManagerBase<dim>::get_n_total_mortars() const
n_total_subdivisions *= n_subdivisions[1];

if (this->is_mesh_aligned()) // aligned
{
return n_total_subdivisions;
}
return n_total_subdivisions;
else // inside/outside
{
return 2 * n_total_subdivisions;
}
return 2 * n_total_subdivisions;
}

template <int dim>
Expand All @@ -64,13 +60,9 @@ MortarManagerBase<dim>::get_n_mortars() const
return 1;

if (this->is_mesh_aligned()) // aligned
{
return 1;
}
return 1;
else // inside/outside
{
return 2;
}
return 2;
}

template <int dim>
Expand Down Expand Up @@ -678,9 +670,9 @@ construct_quadrature(const Quadrature<dim> &quadrature,
/*-------------- MortarManagerCircle -------------------------------*/
template <int dim>
Point<dim>
MortarManagerCircle<dim>::from_1D(const double radiant) const
MortarManagerCircle<dim>::from_1D(const double angle_rad) const
{
return radius_to_point<dim>(this->radius[0], radiant + pre_rotation_angle);
return radius_to_point<dim>(this->radius[0], angle_rad + pre_rotation_angle);
}

template <int dim>
Expand Down
6 changes: 3 additions & 3 deletions source/solvers/fluid_dynamics_block.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright (c) 2019-2025 The Lethe Authors
// SPDX-FileCopyrightText: Copyright (c) 2019-2026 The Lethe Authors
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later

#include <core/bdf.h>
Expand Down Expand Up @@ -832,7 +832,7 @@ template <int dim>
void
FluidDynamicsBlock<dim>::setup_ILU()
{
TimerOutput::Scope t(this->computing_timer, "setup_ILU");
TimerOutput::Scope t(this->computing_timer, "Setup ILU");

//**********************************************
// Trillinos Wrapper ILU Preconditioner
Expand Down Expand Up @@ -875,7 +875,7 @@ template <int dim>
void
FluidDynamicsBlock<dim>::setup_AMG()
{
TimerOutput::Scope t(this->computing_timer, "setup_AMG");
TimerOutput::Scope t(this->computing_timer, "Setup AMG");

//**********************************************
// Trillinos Wrapper AMG Preconditioner
Expand Down
4 changes: 2 additions & 2 deletions source/solvers/fluid_dynamics_matrix_based.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: Copyright (c) 2019-2025 The Lethe Authors
// SPDX-FileCopyrightText: Copyright (c) 2019-2026 The Lethe Authors
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later

#include <core/bdf.h>
Expand Down Expand Up @@ -1480,7 +1480,7 @@ template <int dim>
void
FluidDynamicsMatrixBased<dim>::setup_AMG()
{
TimerOutput::Scope t(this->computing_timer, "setup_AMG");
TimerOutput::Scope t(this->computing_timer, "Setup AMG");

// Constant modes for velocity
std::vector<std::vector<bool>> constant_modes;
Expand Down
Loading