@@ -53,6 +53,8 @@ class CVariable {
5353 using MatrixType = C2DContainer<unsigned long , su2double, StorageType::RowMajor, 64 , DynamicSize, DynamicSize>;
5454
5555 MatrixType Solution; /* !< \brief Solution of the problem. */
56+ // necessary?
57+ VectorType Density; /* !< \brief Solution of the problem. */
5658 MatrixType Solution_Old; /* !< \brief Old solution of the problem R-K. */
5759
5860 MatrixType External; /* !< \brief External (outer) contribution in discrete adjoint multizone problems. */
@@ -67,7 +69,9 @@ class CVariable {
6769
6870 MatrixType Solution_time_n; /* !< \brief Solution of the problem at time n for dual-time stepping technique. */
6971 MatrixType Solution_time_n1; /* !< \brief Solution of the problem at time n-1 for dual-time stepping technique. */
72+ VectorType Density_time_n; /* !< \brief Solution of the problem at time n-1 for dual-time stepping technique. */
7073 VectorType Delta_Time; /* !< \brief Time step. */
74+ VectorType Cp_time_n; /* !< \brief Solution of the problem at time n-1 for dual-time stepping technique. */
7175
7276 CVectorOfMatrix Gradient; /* !< \brief Gradient of the solution of the problem. */
7377 C3DDoubleMatrix Rmatrix; /* !< \brief Geometry-based matrix for weighted least squares gradient calculations. */
@@ -270,6 +274,11 @@ class CVariable {
270274 */
271275 void Set_Solution_time_n ();
272276
277+ /* !
278+ * \brief Set the variable solution at time n.
279+ */
280+ void Set_Density_time_n ();
281+
273282 /* !
274283 * \brief Set the variable solution at time n-1.
275284 */
@@ -280,6 +289,7 @@ class CVariable {
280289 * \param[in] iPoint - Point index.
281290 */
282291 inline void Set_Solution_time_n (unsigned long iPoint, const su2double* val_sol) {
292+ cout <<" cvariable: set_solution_time_n" << endl;
283293 for (unsigned long iVar = 0 ; iVar < nVar; iVar++) Solution_time_n (iPoint,iVar) = val_sol[iVar];
284294 }
285295
@@ -297,8 +307,27 @@ class CVariable {
297307 * \param[in] iPoint - Point index.
298308 */
299309 inline void Set_Solution_time_n (unsigned long iPoint, unsigned long iVar, su2double val_sol) {
310+ cout <<" cvariable: set_solution_time_n 111" << endl;
300311 Solution_time_n (iPoint,iVar) = val_sol;
301312 }
313+ /* !
314+ * \brief Set the variable solution at time n.
315+ * \param[in] iPoint - Point index.
316+ */
317+
318+ inline void Set_Density_time_n (unsigned long iPoint, su2double val_sol) {
319+ Density_time_n (iPoint) = val_sol;
320+ }
321+
322+ /* !
323+ * \brief Add density.
324+ * \param[in] iPoint - Point index.
325+ * \param[in] iVar - Number of the variable.
326+ * \param[in] solution - Value that we want to add to the solution.
327+ */
328+ inline void AddDensity (unsigned long iPoint, unsigned long iVar, su2double solution) {
329+ Density (iPoint) = solution;
330+ }
302331
303332 /* !
304333 * \brief Set the variable solution at time n-1.
@@ -462,14 +491,18 @@ class CVariable {
462491 * \return Reference to the solution matrix.
463492 */
464493 inline const MatrixType& GetSolution () const { return Solution; }
465- inline MatrixType& GetSolution () { return Solution; }
494+ inline MatrixType& GetSolution () {
495+ return Solution;
496+ }
466497
467498 /* !
468499 * \brief Get the solution of the problem.
469500 * \param[in] iPoint - Point index.
470501 * \return Pointer to the solution vector.
471502 */
472- inline su2double *GetSolution (unsigned long iPoint) { return Solution[iPoint]; }
503+ inline su2double *GetSolution (unsigned long iPoint) {
504+ return Solution[iPoint];
505+ }
473506
474507 /* !
475508 * \brief Get the old solution of the problem (Runge-Kutta method)
@@ -491,8 +524,23 @@ class CVariable {
491524 * \param[in] iPoint - Point index.
492525 * \return Pointer to the solution (at time n) vector.
493526 */
494- inline su2double *GetSolution_time_n (unsigned long iPoint) { return Solution_time_n[iPoint]; }
495- inline MatrixType& GetSolution_time_n () { return Solution_time_n; }
527+ inline su2double *GetSolution_time_n (unsigned long iPoint) {
528+ return Solution_time_n[iPoint]; }
529+ inline MatrixType& GetSolution_time_n () {
530+ cout << " getsolution" <<endl;
531+ return Solution_time_n; }
532+
533+ /* !
534+ * \brief Get the solution at time n.
535+ * \param[in] iPoint - Point index.
536+ * \return Pointer to the solution (at time n) vector.
537+ */
538+ // we do not use this, we use the one in cinceulervariable
539+ // inline su2double GetDensity_time_n(unsigned long iPoint) {
540+ // return Density_time_n[iPoint]; }
541+ // inline VectorType& GetDensity_time_n() {
542+ // cout << "getsolution"<<endl;
543+ // return Density_time_n; }
496544
497545 /* !
498546 * \brief Get the solution at time n-1.
@@ -2154,6 +2202,17 @@ class CVariable {
21542202 */
21552203 void RegisterSolution_time_n1 ();
21562204
2205+ /* !
2206+ * \brief Register the Density_time_n array as input/output variable.
2207+ */
2208+ // void RegisterDensity_time_n();
2209+
2210+
2211+ /* !
2212+ * \brief Register the variables in the solution_time_n1 array as input/output variable.
2213+ */
2214+ // void RegisterDensity_time_n1();
2215+
21572216 /* !
21582217 * \brief Set the adjoint values of the solution.
21592218 * \param[in] adj_sol - The adjoint values of the solution.
0 commit comments