Documentation 6b54b78464
Loading...
Searching...
No Matches
CIsoparametric.hpp
Go to the documentation of this file.
1/*!
2 * \file CIsoparametric.hpp
3 * \brief Isoparametric interpolation using FE shape functions.
4 * \author P. Gomes
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27#pragma once
28
29#include "CInterpolator.hpp"
30
31/*!
32 * \brief Isoparametric interpolation.
33 * \ingroup Interfaces
34 */
35class CIsoparametric final : public CInterpolator {
36 private:
37 /*--- Statistics. ---*/
38 su2double MaxDistance = 0.0, ErrorRate = 0.0;
39 unsigned long ErrorCounter = 0;
40
41 /*! \brief Helper struct to store information about candidate donor elements. */
42 struct DonorInfo {
43 su2double isoparams[4] = {0.0}; /*!< \brief Interpolation coefficients. */
44 su2double distance = 0.0; /*!< \brief Distance from target to final mapped point on donor plane. */
45 unsigned iElem = 0; /*!< \brief Identification of the element. */
46 int error = 0; /*!< \brief If the mapped point is "outside" of the donor. */
47
48 /*--- Best donor is one for which the mapped point is closest to target. ---*/
49 bool operator<(const DonorInfo& other) const { return distance < other.distance; }
50 };
51
52 public:
53 /*!
54 * \brief Constructor of the class.
55 * \param[in] geometry - Geometrical definition of the problem.
56 * \param[in] config - Definition of the particular problem.
57 * \param[in] iZone - index of the donor zone.
58 * \param[in] jZone - index of the target zone.
59 */
60 CIsoparametric(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone,
61 unsigned int jZone);
62
63 /*!
64 * \brief Set up transfer matrix defining relation between two meshes
65 * \param[in] config - Definition of the particular problem.
66 */
67 void SetTransferCoeff(CGeometry**** geometry, const CConfig* const* config) override;
68
69 /*!
70 * \brief Print information about the interpolation.
71 */
72 void PrintStatistics(void) const override;
73
74 private:
75 /*!
76 * \brief Compute the isoparametric interpolation coefficients for a 2D line element.
77 * \param[in] X - Coordinate matrix defining the line.
78 * \param[in] xj - Coordinates of the target point.
79 * \param[out] isoparams - Isoparametric coefficients.
80 * \return 0 on success, 1 if xj is too far outside element bounds.
81 */
82 static int LineIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams);
83
84 /*!
85 * \brief Compute the isoparametric interpolation coefficients for a 3D triangle element.
86 * \param[in] X - Coordinate matrix defining the triangle.
87 * \param[in] xj - Coordinates of the target point.
88 * \param[out] isoparams - Isoparametric coefficients.
89 * \return 0 on success, 1 if xj is too far outside element bounds.
90 */
91 static int TriangleIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams);
92
93 /*!
94 * \brief Compute the isoparametric interpolation coefficients for a 3D quadrilateral element.
95 * \param[in] X - Coordinate matrix defining the quadrilateral.
96 * \param[in] xj - Coordinates of the target point.
97 * \param[out] isoparams - Isoparametric coefficients.
98 * \return 0 on success, 1 if xj is too far outside element bounds.
99 */
100 static int QuadrilateralIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams);
101};
Base class for multiphysics interpolation.
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for defining the interpolator, it requires a child class for each particular interpolation...
Definition CInterpolator.hpp:47
Isoparametric interpolation.
Definition CIsoparametric.hpp:35
void PrintStatistics(void) const override
Print information about the interpolation.
Definition CIsoparametric.cpp:43
void SetTransferCoeff(CGeometry ****geometry, const CConfig *const *config) override
Set up transfer matrix defining relation between two meshes.
Definition CIsoparametric.cpp:49
passivedouble su2double
Definition code_config.hpp:181