Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
Orthogonalizer.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2021.
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation version 3.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17// contact: delft3d.support@deltares.nl
18// Stichting Deltares
19// P.O. Box 177
20// 2600 MH Delft, The Netherlands
21//
22// All indications and logos of, and references to, "Delft3D" and "Deltares"
23// are registered trademarks of Stichting Deltares, and remain the property of
24// Stichting Deltares. All rights reserved.
25//
26//------------------------------------------------------------------------------
27
28#pragma once
29
30#include <vector>
31
32#include "MeshKernel/Definitions.hpp"
33
34namespace meshkernel
35{
36 class Mesh2D;
37
42 {
43
44 public:
46 explicit Orthogonalizer(const Mesh2D& mesh,
47 const std::vector<std::vector<UInt>>& nodesNodes,
48 const std::vector<MeshNodeType>& nodeTypes);
49
51 void Compute();
52
57 [[nodiscard]] double GetWeight(UInt node, UInt connectedNode) const
58 {
59 return m_weights[node][connectedNode];
60 }
61
66 [[nodiscard]] double GetRightHandSide(UInt node, UInt connectedNode) const
67 {
68 return m_rhs[node][connectedNode];
69 }
70
71 private:
75 bool AspectRatio(const Mesh2D& mesh);
76
77 const Mesh2D& m_mesh;
78 const std::vector<std::vector<UInt>>& m_nodesNodes;
79 const std::vector<MeshNodeType>& m_nodeType;
80 std::vector<double> m_aspectRatios;
81 std::vector<std::vector<double>> m_weights;
82 std::vector<std::vector<double>> m_rhs;
83 };
84} // namespace meshkernel
A class derived from Mesh, which describes unstructures 2d meshes.
Definition Mesh2D.hpp:58
Orthogonalizion (optimize the aspect ratios) and mesh smoothing (optimize internal face angles or are...
Definition Orthogonalizer.hpp:42
void Compute()
Computes the smoother weights and the right hand side.
double GetRightHandSide(UInt node, UInt connectedNode) const
Gets the weight for a certain node and connected node.
Definition Orthogonalizer.hpp:66
Orthogonalizer(const Mesh2D &mesh, const std::vector< std::vector< UInt > > &nodesNodes, const std::vector< MeshNodeType > &nodeTypes)
Constructor.
double GetWeight(UInt node, UInt connectedNode) const
Gets the weight for a certain node and connected node.
Definition Orthogonalizer.hpp:57
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39