Skip to content

Commit efa20ba

Browse files
committed
not all interpolators need their transpose
1 parent 2537382 commit efa20ba

16 files changed

Lines changed: 25 additions & 40 deletions

Common/include/interface_interpolation/CInterpolator.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "../../include/basic_types/datatype_structure.hpp"
3030
#include "../../include/toolboxes/C2DContainer.hpp"
3131
#include <vector>
32-
#include <memory>
3332

3433
class CConfig;
3534
class CGeometry;
@@ -77,7 +76,6 @@ class CInterpolator {
7776
CGeometry**** const Geometry; /*! \brief Vector which stores n zones of geometry. */
7877
CGeometry* const donor_geometry; /*! \brief Donor geometry. */
7978
CGeometry* const target_geometry; /*! \brief Target geometry. */
80-
const vector<vector<unique_ptr<CInterpolator> > >& interpolators; /*! \brief All the interpolators. */
8179

8280
public:
8381
struct CDonorInfo {
@@ -99,12 +97,10 @@ class CInterpolator {
9997
* \brief Constructor of the class.
10098
* \param[in] geometry_container - Geometrical definition of the problem.
10199
* \param[in] config - Definition of the particular problem.
102-
* \param[in] interpolator - Container of all interpolators.
103100
* \param[in] iZone - index of the donor zone.
104101
* \param[in] jZone - index of the target zone.
105102
*/
106103
CInterpolator(CGeometry ****geometry_container, const CConfig* const* config,
107-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
108104
unsigned int iZone, unsigned int jZone);
109105

110106
/*!

Common/include/interface_interpolation/CInterpolatorFactory.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ namespace CInterpolatorFactory {
4141
* \brief The factory method.
4242
* \param[in] geometry_container - Geometrical definition of the problem.
4343
* \param[in] config - Definition of the particular problem.
44-
* \param[in] interp_container - Container of all interpolators.
44+
* \param[in] transpInterpolator - Transpose interpolator.
4545
* \param[in] iZone - Index of the donor zone.
4646
* \param[in] jZone - Index of the target zone.
4747
* \param[in] verbose - If true, print information to screen.
4848
* \return Pointer to interpolator on the heap, caller is responsible for deletion.
4949
*/
5050
CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
5151
const CConfig* const* config,
52-
const vector<vector<std::unique_ptr<CInterpolator> > >& interp_container,
52+
const CInterpolator* transpInterpolator,
5353
unsigned iZone, unsigned jZone,
5454
bool verbose = true);
5555

Common/include/interface_interpolation/CIsoparametric.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ class CIsoparametric final : public CInterpolator {
4242
* \brief Constructor of the class.
4343
* \param[in] geometry - Geometrical definition of the problem.
4444
* \param[in] config - Definition of the particular problem.
45-
* \param[in] interpolator - Container of all interpolators.
4645
* \param[in] iZone - index of the donor zone.
4746
* \param[in] jZone - index of the target zone.
4847
*/
4948
CIsoparametric(CGeometry ****geometry_container, const CConfig* const* config,
50-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
5149
unsigned int iZone, unsigned int jZone);
5250

5351
/*!

Common/include/interface_interpolation/CMirror.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,21 @@
3333
* \note Requires that the opposing mesh has already run interpolation (jZone > iZone), otherwise throws.
3434
*/
3535
class CMirror final : public CInterpolator {
36+
private:
37+
const CInterpolator* const transpInterpolator; /*! \brief The transpose interpolator (from j to i). */
38+
3639
public:
3740
/*!
3841
* \brief Constructor of the class.
3942
* \note Data is set in geometry[targetZone].
4043
* \param[in] geometry_container
4144
* \param[in] config - config container
42-
* \param[in] interpolator - Container of all interpolators
45+
* \param[in] interpolator - Transpose interpolator
4346
* \param[in] iZone - First zone
4447
* \param[in] jZone - Second zone
4548
*/
4649
CMirror(CGeometry ****geometry_container, const CConfig* const* config,
47-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
48-
unsigned int iZone, unsigned int jZone);
50+
const CInterpolator* interpolator, unsigned int iZone, unsigned int jZone);
4951

5052
/*!
5153
* \brief Set up transfer matrix defining relation between two meshes

Common/include/interface_interpolation/CNearestNeighbor.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@ class CNearestNeighbor final : public CInterpolator {
4343
* \brief Constructor of the class.
4444
* \param[in] geometry - Geometrical definition of the problem.
4545
* \param[in] config - Definition of the particular problem.
46-
* \param[in] interpolator - Container of all interpolators.
4746
* \param[in] iZone - index of the donor zone.
4847
* \param[in] jZone - index of the target zone.
4948
*/
5049
CNearestNeighbor(CGeometry ****geometry_container, const CConfig* const* config,
51-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
5250
unsigned int iZone, unsigned int jZone);
5351

5452
/*!

Common/include/interface_interpolation/CRadialBasisFunction.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ class CRadialBasisFunction final : public CInterpolator {
4545
* \brief Constructor of the class.
4646
* \param[in] geometry - Geometrical definition of the problem.
4747
* \param[in] config - Definition of the particular problem.
48-
* \param[in] interpolator - Container of all interpolators.
4948
* \param[in] iZone - index of the donor zone.
5049
* \param[in] jZone - index of the target zone.
5150
*/
5251
CRadialBasisFunction(CGeometry ****geometry_container, const CConfig* const* config,
53-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
5452
unsigned int iZone, unsigned int jZone);
5553

5654
/*!

Common/include/interface_interpolation/CSlidingMesh.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ class CSlidingMesh final : public CInterpolator {
3939
* \brief Constructor of the class.
4040
* \param[in] geometry - Geometrical definition of the problem.
4141
* \param[in] config - Definition of the particular problem.
42-
* \param[in] interpolator - Container of all interpolators.
4342
* \param[in] iZone - index of the donor zone.
4443
* \param[in] jZone - index of the target zone.
4544
*/
4645
CSlidingMesh(CGeometry ****geometry_container, const CConfig* const* config,
47-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
4846
unsigned int iZone, unsigned int jZone);
4947

5048
/*!

Common/src/interface_interpolation/CInterpolator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@
3131

3232

3333
CInterpolator::CInterpolator(CGeometry ****geometry_container, const CConfig* const* config,
34-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
3534
unsigned int iZone, unsigned int jZone) :
3635
rank(SU2_MPI::GetRank()),
3736
size(SU2_MPI::GetSize()),
3837
donorZone(iZone),
3938
targetZone(jZone),
4039
Geometry(geometry_container),
4140
donor_geometry(geometry_container[iZone][INST_0][MESH_0]),
42-
target_geometry(geometry_container[jZone][INST_0][MESH_0]),
43-
interpolators(interpolator) {
41+
target_geometry(geometry_container[jZone][INST_0][MESH_0]) {
4442
}
4543

4644
bool CInterpolator::CheckInterfaceBoundary(int markDonor, int markTarget) {

Common/src/interface_interpolation/CInterpolatorFactory.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
namespace CInterpolatorFactory {
3737
CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
3838
const CConfig* const* config,
39-
const vector<vector<unique_ptr<CInterpolator> > >& interp_container,
39+
const CInterpolator* transpInterpolator,
4040
unsigned iZone, unsigned jZone, bool verbose) {
4141

4242
CInterpolator* interpolator = nullptr;
@@ -56,27 +56,27 @@ CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
5656

5757
if (type == WEIGHTED_AVERAGE) {
5858
if (verbose) cout << "using a sliding mesh approach." << endl;
59-
interpolator = new CSlidingMesh(geometry_container, config, interp_container, iZone, jZone);
59+
interpolator = new CSlidingMesh(geometry_container, config, iZone, jZone);
6060
}
6161
else if (config[jZone]->GetConservativeInterpolation()) {
6262
if (verbose) cout << "using the mirror approach, \"transposing\" coefficients from opposite mesh." << endl;
63-
interpolator = new CMirror(geometry_container, config, interp_container, iZone, jZone);
63+
interpolator = new CMirror(geometry_container, config, transpInterpolator, iZone, jZone);
6464
}
6565
else {
6666
switch(type) {
6767
case ISOPARAMETRIC:
6868
if (verbose) cout << "using the isoparametric approach." << endl;
69-
interpolator = new CIsoparametric(geometry_container, config, interp_container, iZone, jZone);
69+
interpolator = new CIsoparametric(geometry_container, config, iZone, jZone);
7070
break;
7171

7272
case NEAREST_NEIGHBOR:
7373
if (verbose) cout << "using a nearest neighbor approach." << endl;
74-
interpolator = new CNearestNeighbor(geometry_container, config, interp_container, iZone, jZone);
74+
interpolator = new CNearestNeighbor(geometry_container, config, iZone, jZone);
7575
break;
7676

7777
case RADIAL_BASIS_FUNCTION:
7878
if (verbose) cout << "using a radial basis function approach." << endl;
79-
interpolator = new CRadialBasisFunction(geometry_container, config, interp_container, iZone, jZone);
79+
interpolator = new CRadialBasisFunction(geometry_container, config, iZone, jZone);
8080
break;
8181

8282
default:

Common/src/interface_interpolation/CIsoparametric.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ struct DonorInfo {
4747
};
4848

4949
CIsoparametric::CIsoparametric(CGeometry ****geometry_container, const CConfig* const* config,
50-
const vector<vector<unique_ptr<CInterpolator> > >& interpolator,
5150
unsigned int iZone, unsigned int jZone) :
52-
CInterpolator(geometry_container, config, interpolator, iZone, jZone) {
51+
CInterpolator(geometry_container, config, iZone, jZone) {
5352
SetTransferCoeff(config);
5453
}
5554

0 commit comments

Comments
 (0)