Skip to content
Snippets Groups Projects
Commit 5d4047d3 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Displace symmetry utilities in `geometry/SymmetryUtils.hpp`

parent 4926b9a0
Branches
No related tags found
1 merge request!205High-order polynomial reconstruction
#ifndef SYMMETRY_UTILS_HPP
#define SYMMETRY_UTILS_HPP
#include <algebra/TinyMatrix.hpp>
#include <algebra/TinyVector.hpp>
#include <utils/PugsMacros.hpp>
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_vector(const TinyVector<Dimension>& normal, const TinyVector<Dimension>& u)
{
return u - 2 * dot(u, normal) * normal;
}
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_matrix(const TinyVector<Dimension>& normal, const TinyMatrix<Dimension>& A)
{
const TinyMatrix S = TinyMatrix<Dimension>{identity} - 2 * tensorProduct(normal, normal);
return S * A * S;
}
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_coordinates(const TinyVector<Dimension>& origin,
const TinyVector<Dimension>& normal,
const TinyVector<Dimension>& u)
{
return u - 2 * dot(u - origin, normal) * normal;
}
#endif // SYMMETRY_UTILS_HPP
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
#include <algebra/Givens.hpp> #include <algebra/Givens.hpp>
#include <algebra/ShrinkMatrixView.hpp> #include <algebra/ShrinkMatrixView.hpp>
#include <algebra/ShrinkVectorView.hpp>
#include <algebra/SmallMatrix.hpp> #include <algebra/SmallMatrix.hpp>
#include <geometry/SymmetryUtils.hpp>
#include <mesh/MeshData.hpp> #include <mesh/MeshData.hpp>
#include <mesh/MeshDataManager.hpp> #include <mesh/MeshDataManager.hpp>
#include <mesh/MeshFlatFaceBoundary.hpp> #include <mesh/MeshFlatFaceBoundary.hpp>
...@@ -18,31 +18,6 @@ ...@@ -18,31 +18,6 @@
#include <scheme/reconstruction_utils/ElementIntegralReconstructionMatrixBuilder.hpp> #include <scheme/reconstruction_utils/ElementIntegralReconstructionMatrixBuilder.hpp>
#include <scheme/reconstruction_utils/MutableDiscreteFunctionDPkVariant.hpp> #include <scheme/reconstruction_utils/MutableDiscreteFunctionDPkVariant.hpp>
#warning put in a file in geometry
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_vector(const TinyVector<Dimension>& normal, const TinyVector<Dimension>& u)
{
return u - 2 * dot(u, normal) * normal;
}
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_matrix(const TinyVector<Dimension>& normal, const TinyMatrix<Dimension>& A)
{
const TinyMatrix S = TinyMatrix<Dimension>{identity} - 2 * tensorProduct(normal, normal);
return S * A * S;
}
template <size_t Dimension>
PUGS_INLINE auto
symmetrize_coordinates(const TinyVector<Dimension>& origin,
const TinyVector<Dimension>& normal,
const TinyVector<Dimension>& u)
{
return u - 2 * dot(u - origin, normal) * normal;
}
template <MeshConcept MeshType> template <MeshConcept MeshType>
class PolynomialReconstruction::Internal class PolynomialReconstruction::Internal
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment