Skip to content

Commit 3808ca5

Browse files
authored
Merge pull request #1061 from su2code/feature_aero_thermo_elasticity
Fix multi-physics simulations with "many-to-many" interfaces between markers and improve associated communications.
2 parents b1dcaf2 + 91dd8a0 commit 3808ca5

52 files changed

Lines changed: 509 additions & 936 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/include/CConfig.hpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,7 @@ class CConfig {
10061006
long ParMETIS_pointWgt; /*!< \brief Load balancing weight given to points. */
10071007
long ParMETIS_edgeWgt; /*!< \brief Load balancing weight given to edges. */
10081008
unsigned short DirectDiff; /*!< \brief Direct Differentation mode. */
1009-
bool DiscreteAdjoint, /*!< \brief AD-based discrete adjoint mode. */
1010-
FullTape; /*!< \brief Full tape mode for coupled discrete adjoints. */
1009+
bool DiscreteAdjoint; /*!< \brief AD-based discrete adjoint mode. */
10111010
unsigned long Wrt_Surf_Freq_DualTime; /*!< \brief Writing surface solution frequency for Dual Time. */
10121011
su2double Const_DES; /*!< \brief Detached Eddy Simulation Constant. */
10131012
unsigned short Kind_WindowFct; /*!< \brief Type of window (weight) function for objective functional. */
@@ -1845,6 +1844,7 @@ class CConfig {
18451844
* \return Dimensionalized freestream velocity vector.
18461845
*/
18471846
su2double* GetVelocity_FreeStream(void) { return Velocity_FreeStream; }
1847+
const su2double* GetVelocity_FreeStream(void) const { return Velocity_FreeStream; }
18481848

18491849
/*!
18501850
* \brief Get the value of the non-dimensionalized freestream temperature.
@@ -1869,6 +1869,7 @@ class CConfig {
18691869
* \return Non-dimensionalized freestream velocity vector.
18701870
*/
18711871
su2double* GetVelocity_FreeStreamND(void) { return Velocity_FreeStreamND; }
1872+
const su2double* GetVelocity_FreeStreamND(void) const { return Velocity_FreeStreamND; }
18721873

18731874
/*!
18741875
* \brief Get the value of the non-dimensionalized freestream energy.
@@ -8405,12 +8406,6 @@ class CConfig {
84058406
*/
84068407
bool GetDiscrete_Adjoint(void) const { return DiscreteAdjoint; }
84078408

8408-
/*!
8409-
* \brief Get the indicator whether we want to use full (coupled) tapes.
8410-
* \return the full tape indicator.
8411-
*/
8412-
bool GetFull_Tape(void) const { return FullTape; }
8413-
84148409
/*!
84158410
* \brief Get the number of subiterations while a ramp is applied.
84168411
* \return Number of FSI subiters.

Common/include/geometry/dual_grid/CVertex.hpp

Lines changed: 10 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,16 @@
3737
*/
3838
class CVertex : public CDualGrid {
3939
protected:
40-
unsigned long Nodes[1]; /*!< \brief Vector to store the global nodes of an element. */
41-
su2double Normal[3]; /*!< \brief Normal coordinates of the element and its center of gravity. */
42-
su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */
43-
su2double CartCoord[3]; /*!< \brief Vertex cartesians coordinates. */
44-
su2double VarCoord[3]; /*!< \brief Used for storing the coordinate variation due to a surface modification. */
45-
su2double *VarRot; /*!< \brief Used for storing the rotation variation due to a surface modification. */
46-
long PeriodicPoint[5]; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */
47-
bool ActDisk_Perimeter; /*!< \brief Identify nodes at the perimeter of the actuator disk */
48-
short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */
49-
unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */
50-
unsigned long *Donor_Points; /*!< \brief indices of donor points for interpolation across zones */
51-
unsigned long *Donor_Proc; /*!< \brief indices of donor processor for interpolation across zones in parallel */
52-
su2double Basis_Function[3]; /*!< \brief Basis function values for interpolation across zones. */
53-
su2double *Donor_Coeff; /*!< \brief Store a list of coefficients corresponding to the donor points. */
54-
unsigned short nDonor_Points; /*!< \brief Number of points in Donor_Coeff. */
40+
unsigned long Nodes[1]; /*!< \brief Vector to store the global nodes of an element. */
41+
su2double Normal[3] = {0.0}; /*!< \brief Normal coordinates of the element and its center of gravity. */
42+
su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */
43+
su2double CartCoord[3] = {0.0}; /*!< \brief Vertex cartesians coordinates. */
44+
su2double VarCoord[3] = {0.0}; /*!< \brief Used for storing the coordinate variation due to a surface modification. */
45+
long PeriodicPoint[5] = {-1}; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */
46+
bool ActDisk_Perimeter = false; /*!< \brief Identify nodes at the perimeter of the actuator disk */
47+
short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */
48+
unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */
49+
su2double Basis_Function[3] = {0.0}; /*!< \brief Basis function values for interpolation across zones. */
5550

5651
public:
5752
/*!
@@ -61,11 +56,6 @@ class CVertex : public CDualGrid {
6156
*/
6257
CVertex(unsigned long val_point, unsigned short val_nDim);
6358

64-
/*!
65-
* \brief Destructor of the class.
66-
*/
67-
~CVertex(void) override;
68-
6959
/*!
7060
* \brief Get the number of nodes of a vertex.
7161
* \return Number of nodes that set a vertex (1).
@@ -336,72 +326,4 @@ class CVertex : public CDualGrid {
336326
*/
337327
inline unsigned long GetNormal_Neighbor(void) const { return Normal_Neighbor; }
338328

339-
/*!
340-
* \brief Return the value of nDonor_Points
341-
* \return nDonor - the number of donor points
342-
*/
343-
inline unsigned short GetnDonorPoints(void) const { return nDonor_Points;}
344-
345-
/*!
346-
* \brief Set the coefficient value of a donor point.
347-
* \param[in] iDonor - Index of the donor point.
348-
* \param[in] val - Value of the coefficent for point iDonor.
349-
*/
350-
inline void SetDonorCoeff(unsigned short iDonor, su2double val) const { Donor_Coeff[iDonor] = val; }
351-
352-
/*!
353-
* \brief Get the coefficient value of a donor point.
354-
* \param[in] iDonor - Index of the donor point.
355-
* \return - Value of the coefficent for point iDonor.
356-
*/
357-
inline su2double GetDonorCoeff(unsigned short iDonor) const { return Donor_Coeff[iDonor];}
358-
359-
/*!
360-
* \brief Set the donor point of a vertex for interpolation across zones.
361-
* \param[in] val_donorpoint- donor face index (w/in donor elem).
362-
*/
363-
inline void SetInterpDonorPoint(unsigned short val_donorindex, long val_donorpoint) {
364-
Donor_Points[val_donorindex] = val_donorpoint;
365-
}
366-
367-
/*!
368-
* \brief Get the value of the donor point of a vertex (for interpolation).
369-
* \return Value of the donor point of a vertex.
370-
*/
371-
inline long GetInterpDonorPoint(unsigned short val_donorindex) const { return Donor_Points[val_donorindex]; }
372-
373-
/*!
374-
* \brief Set the donor point of a vertex for interpolation across zones.
375-
* \param[in] val_donorpoint- donor face index (w/in donor elem).
376-
*/
377-
inline void SetInterpDonorProcessor(unsigned short val_donorindex, long val_donorpoint) {
378-
Donor_Proc[val_donorindex] = val_donorpoint;
379-
}
380-
381-
/*!
382-
* \brief Get the value of the donor point of a vertex (for interpolation).
383-
* \return Value of the donor point of a vertex.
384-
*/
385-
inline long GetInterpDonorProcessor(unsigned short val_donorindex) const { return Donor_Proc[val_donorindex]; }
386-
387-
/*!
388-
* \brief Allocate memory based on how many donor points need to be stored.
389-
* \param[in] nDonor - the number of donor points
390-
*/
391-
void Allocate_DonorInfo(unsigned short nDonor);
392-
393-
/*!
394-
* \brief Get the rotation variation
395-
* \return - pointer to the vector defining the rotation
396-
*/
397-
inline su2double *GetVarRot(void) { return VarRot;}
398-
399-
/*!
400-
* \brief Set the rotation variation
401-
* \return - pointer to the vector defining the rotation
402-
*/
403-
inline void SetVarRot(const su2double* val) {
404-
for (unsigned short iDim = 0; iDim < nDim; iDim++)
405-
VarRot[iDim] = val[iDim];
406-
}
407329
};

Common/include/interface_interpolation/CInterpolator.hpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,30 @@ class CInterpolator {
7878
CGeometry* const target_geometry; /*! \brief Target geometry. */
7979

8080
public:
81+
struct CDonorInfo {
82+
vector<int> processor;
83+
vector<unsigned long> globalPoint;
84+
vector<su2double> coefficient;
85+
86+
unsigned long nDonor() const { return processor.size(); }
87+
88+
void resize(size_t nDonor) {
89+
processor.resize(nDonor);
90+
globalPoint.resize(nDonor);
91+
coefficient.resize(nDonor);
92+
}
93+
};
94+
vector<vector<CDonorInfo> > targetVertices; /*! \brief Donor information per marker per vertex of the target. */
95+
8196
/*!
8297
* \brief Constructor of the class.
83-
* \param[in] geometry - Geometrical definition of the problem.
98+
* \param[in] geometry_container - Geometrical definition of the problem.
8499
* \param[in] config - Definition of the particular problem.
85-
* \param[in] iZone - index of the donor zone
86-
* \param[in] jZone - index of the target zone
100+
* \param[in] iZone - index of the donor zone.
101+
* \param[in] jZone - index of the target zone.
87102
*/
88-
CInterpolator(CGeometry ****geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone);
103+
CInterpolator(CGeometry ****geometry_container, const CConfig* const* config,
104+
unsigned int iZone, unsigned int jZone);
89105

90106
/*!
91107
* \brief No default construction allowed to force zones and geometry to always be set.

Common/include/interface_interpolation/CInterpolatorFactory.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ namespace CInterpolatorFactory {
3939
* \brief The factory method.
4040
* \param[in] geometry_container - Geometrical definition of the problem.
4141
* \param[in] config - Definition of the particular problem.
42+
* \param[in] transpInterpolator - Transpose interpolator.
4243
* \param[in] iZone - Index of the donor zone.
4344
* \param[in] jZone - Index of the target zone.
4445
* \param[in] verbose - If true, print information to screen.
4546
* \return Pointer to interpolator on the heap, caller is responsible for deletion.
4647
*/
4748
CInterpolator* CreateInterpolator(CGeometry ****geometry_container,
4849
const CConfig* const* config,
50+
const CInterpolator* transpInterpolator,
4951
unsigned iZone, unsigned jZone,
5052
bool verbose = true);
5153

Common/include/interface_interpolation/CIsoparametric.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ 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] iZone - index of the donor zone
46-
* \param[in] jZone - index of the target zone
45+
* \param[in] iZone - index of the donor zone.
46+
* \param[in] jZone - index of the target zone.
4747
*/
4848
CIsoparametric(CGeometry ****geometry_container, const CConfig* const* config,
4949
unsigned int iZone, unsigned int jZone);

Common/include/interface_interpolation/CMirror.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,16 +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
45+
* \param[in] interpolator - Transpose interpolator
4246
* \param[in] iZone - First zone
4347
* \param[in] jZone - Second zone
4448
*/
45-
CMirror(CGeometry ****geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone);
49+
CMirror(CGeometry ****geometry_container, const CConfig* const* config,
50+
const CInterpolator* interpolator, unsigned int iZone, unsigned int jZone);
4651

4752
/*!
4853
* \brief Set up transfer matrix defining relation between two meshes

Common/include/interface_interpolation/CNearestNeighbor.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ 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] iZone - index of the donor zone
47-
* \param[in] jZone - index of the target zone
46+
* \param[in] iZone - index of the donor zone.
47+
* \param[in] jZone - index of the target zone.
4848
*/
49-
CNearestNeighbor(CGeometry ****geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone);
49+
CNearestNeighbor(CGeometry ****geometry_container, const CConfig* const* config,
50+
unsigned int iZone, unsigned int jZone);
5051

5152
/*!
5253
* \brief Set up transfer matrix defining relation between two meshes.

Common/include/interface_interpolation/CRadialBasisFunction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ 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] iZone - index of the donor zone
49-
* \param[in] jZone - index of the target zone
48+
* \param[in] iZone - index of the donor zone.
49+
* \param[in] jZone - index of the target zone.
5050
*/
5151
CRadialBasisFunction(CGeometry ****geometry_container, const CConfig* const* config,
5252
unsigned int iZone, unsigned int jZone);

Common/include/interface_interpolation/CSlidingMesh.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ 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] iZone - index of the donor zone
43-
* \param[in] jZone - index of the target zone
42+
* \param[in] iZone - index of the donor zone.
43+
* \param[in] jZone - index of the target zone.
4444
*/
4545
CSlidingMesh(CGeometry ****geometry_container, const CConfig* const* config,
4646
unsigned int iZone, unsigned int jZone);

Common/src/CConfig.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,8 +1089,6 @@ void CConfig::SetConfig_Options() {
10891089
addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, MZ_BLOCK_GAUSS_SEIDEL);
10901090
/*!\brief MATH_PROBLEM \n DESCRIPTION: Mathematical problem \n Options: DIRECT, ADJOINT \ingroup Config*/
10911091
addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, false, Restart_Flow, false);
1092-
/*!\brief FULL_TAPE \n DESCRIPTION: Use full (coupled) tapes for multiphysics discrete adjoint. \ingroup Config*/
1093-
addBoolOption("FULL_TAPE", FullTape, YES);
10941092
/*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n DEFAULT: NO_TURB_MODEL \ingroup Config*/
10951093
addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, NO_TURB_MODEL);
10961094
/*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NO_TRANS_MODEL \ingroup Config*/

0 commit comments

Comments
 (0)