@@ -67,6 +67,8 @@ class CElement {
6767 su2activematrix NodalExtrap; /* !< \brief Coordinates of the nodal points for Gaussian extrapolation. */
6868 su2activematrix NodalStress; /* !< \brief Stress at the nodes. */
6969
70+ su2activevector NodalTemperature; /* !< \brief Temperature at the nodes. */
71+
7072 /* --- Stiffness and load matrices. ---*/
7173 std::vector<su2activematrix> Kab; /* !< \brief Structure for the constitutive component of the tangent matrix. */
7274 su2activematrix Mab; /* !< \brief Structure for the nodal components of the mass matrix. */
@@ -151,7 +153,7 @@ class CElement {
151153 * \param[in] iDim - Dimension.
152154 * \param[in] val_CoordRef - Value of the coordinate.
153155 */
154- inline void SetRef_Coord (unsigned short iNode, unsigned short iDim, su2double val_CoordRef) {
156+ inline void SetRef_Coord (unsigned short iNode, unsigned short iDim, const su2double& val_CoordRef) {
155157 RefCoord (iNode, iDim) = val_CoordRef;
156158 }
157159
@@ -161,10 +163,22 @@ class CElement {
161163 * \param[in] iDim - Dimension.
162164 * \param[in] val_CoordRef - Value of the coordinate.
163165 */
164- inline void SetCurr_Coord (unsigned short iNode, unsigned short iDim, su2double val_CoordCurr) {
166+ inline void SetCurr_Coord (unsigned short iNode, unsigned short iDim, const su2double& val_CoordCurr) {
165167 CurrentCoord (iNode, iDim) = val_CoordCurr;
166168 }
167169
170+ /* !
171+ * \brief Set the value of the temperature of a node.
172+ */
173+ inline void SetTemperature (unsigned short iNode, const su2double& val_Temperature) {
174+ NodalTemperature[iNode] = val_Temperature;
175+ }
176+
177+ /* !
178+ * \brief Set the value of the temperature of all nodes.
179+ */
180+ inline void SetTemperature (const su2double& val_Temperature) { NodalTemperature = val_Temperature; }
181+
168182 /* !
169183 * \brief Get the value of the coordinate of the nodes in the reference configuration.
170184 * \param[in] iNode - Index of node.
@@ -181,6 +195,17 @@ class CElement {
181195 */
182196 inline su2double GetCurr_Coord (unsigned short iNode, unsigned short iDim) const { return CurrentCoord (iNode, iDim); }
183197
198+ /* !
199+ * \brief Get the value of the temperature at a Gaussian integration point.
200+ */
201+ inline su2double GetTemperature (unsigned short iGauss) const {
202+ su2double Temperature = 0 ;
203+ for (auto iNode = 0u ; iNode < nNodes; ++iNode) {
204+ Temperature += GetNi (iNode, iGauss) * NodalTemperature[iNode];
205+ }
206+ return Temperature;
207+ }
208+
184209 /* !
185210 * \brief Get the weight of the corresponding Gaussian Point.
186211 * \param[in] iGauss - index of the Gaussian point.
@@ -214,7 +239,9 @@ class CElement {
214239 * \param[in] nodeB - index of Node b.
215240 * \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution.
216241 */
217- inline void Add_Mab (unsigned short nodeA, unsigned short nodeB, su2double val_Mab) { Mab (nodeA, nodeB) += val_Mab; }
242+ inline void Add_Mab (unsigned short nodeA, unsigned short nodeB, const su2double& val_Mab) {
243+ Mab (nodeA, nodeB) += val_Mab;
244+ }
218245
219246 /* !
220247 * \brief Add the value of a submatrix K relating nodes a and b, for the constitutive term.
@@ -243,7 +270,7 @@ class CElement {
243270 * \param[in] nodeB - index of Node b.
244271 * \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution.
245272 */
246- inline void Add_Ks_ab (unsigned short nodeA, unsigned short nodeB, su2double val_Ks_ab) {
273+ inline void Add_Ks_ab (unsigned short nodeA, unsigned short nodeB, const su2double& val_Ks_ab) {
247274 Ks_ab (nodeA, nodeB) += val_Ks_ab;
248275 }
249276
@@ -354,7 +381,7 @@ class CElement {
354381 * \param[in] iVar - Variable index.
355382 * \param[in] val_Stress - Value of the stress added.
356383 */
357- inline void Add_NodalStress (unsigned short iNode, unsigned short iVar, su2double val_Stress) {
384+ inline void Add_NodalStress (unsigned short iNode, unsigned short iVar, const su2double& val_Stress) {
358385 NodalStress (iNode, iVar) += val_Stress;
359386 }
360387
@@ -789,7 +816,7 @@ class CQUAD4 final : public CElementWithKnownSizes<4, 4, 2> {
789816 /* !
790817 * \brief Shape functions (Ni) evaluated at point Xi,Eta.
791818 */
792- inline static void ShapeFunctions (su2double Xi, su2double Eta, su2double* Ni) {
819+ inline static void ShapeFunctions (const su2double& Xi, const su2double& Eta, su2double* Ni) {
793820 Ni[0 ] = 0.25 * (1.0 - Xi) * (1.0 - Eta);
794821 Ni[1 ] = 0.25 * (1.0 + Xi) * (1.0 - Eta);
795822 Ni[2 ] = 0.25 * (1.0 + Xi) * (1.0 + Eta);
@@ -799,7 +826,7 @@ class CQUAD4 final : public CElementWithKnownSizes<4, 4, 2> {
799826 /* !
800827 * \brief Shape function Jacobian (dNi) evaluated at point Xi,Eta.
801828 */
802- inline static void ShapeFunctionJacobian (su2double Xi, su2double Eta, su2double dNi[][2 ]) {
829+ inline static void ShapeFunctionJacobian (const su2double& Xi, const su2double& Eta, su2double dNi[][2 ]) {
803830 dNi[0 ][0 ] = -0.25 * (1.0 - Eta);
804831 dNi[0 ][1 ] = -0.25 * (1.0 - Xi);
805832 dNi[1 ][0 ] = 0.25 * (1.0 - Eta);
0 commit comments