diff --git a/Common/include/dual_grid_structure.hpp b/Common/include/dual_grid_structure.hpp
index 1fc2a7d3c5e..0cf13bbcc00 100644
--- a/Common/include/dual_grid_structure.hpp
+++ b/Common/include/dual_grid_structure.hpp
@@ -1,1088 +1,1088 @@
-/*!
- * \file dual_grid_structure.hpp
- * \brief Headers of the main subroutines for doing the complete dual grid structure.
- * The subroutines and functions are in the dual_grid_structure.cpp file.
- * \author F. Palacios, T. Economon
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-#include "./mpi_structure.hpp"
-
-#include
-#include
-#include
-#include
-
-#include "config_structure.hpp"
-
-using namespace std;
-
-/*!
- * \class CDualGrid
- * \brief Class for controlling the dual volume definition. The dual volume is compose by
- * three main elements: points, edges, and vertices.
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CDualGrid{
-protected:
- static unsigned short nDim; /*!< \brief Number of dimensions of the problem. */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- * \param[in] val_nDim - Number of dimensions of the problem.
- */
- CDualGrid(unsigned short val_nDim);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CDualGrid(void);
-
- /*!
- * \brief A pure virtual member.
- */
- virtual su2double *GetCoord(void) = 0;
-
- /*!
- * \brief A pure virtual member.
- * \param[in] val_coord - Coordinate of the point.
- */
- virtual void SetCoord(su2double *val_coord) = 0;
-
- /*!
- * \brief A pure virtual member.
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] config - Definition of the particular problem.
- */
- virtual void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG) = 0;
-
- /*!
- * \overload
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] config - Definition of the particular problem.
- */
- virtual void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG) = 0;
-
- /*!
- * \brief A pure virtual member.
- * \param[in] val_normal - Coordinates of the normal.
- */
- virtual void GetNormal(su2double *val_normal) = 0;
-
- /*!
- * \brief A pure virtual member.
- */
- virtual su2double *GetNormal(void) = 0;
-
- /*!
- * \brief A pure virtual member.
- * \param[in] val_face_normal - Coordinates of the normal.
- */
- virtual void SetNormal(su2double *val_face_normal) = 0;
-
- /*!
- * \brief A pure virtual member.
- */
- virtual unsigned short GetnNodes(void) = 0;
-
- /*!
- * \brief A pure virtual member.
- */
- virtual void SetZeroValues(void) = 0;
-
- /*!
- * \brief A pure virtual member.
- * \param[in] val_face_normal - Normal vector to be added.
- */
- virtual void AddNormal(su2double *val_face_normal) = 0;
-};
-
-/*!
- * \class CPoint
- * \brief Class for point definition (including control volume definition).
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CPoint : public CDualGrid {
-private:
- unsigned short nElem, /*!< \brief Number of elements that set up the control volume. */
- nPoint; /*!< \brief Number of points that set up the control volume */
- vector Elem; /*!< \brief Elements that set up a control volume around a node. */
- vector Point; /*!< \brief Points surrounding the central node of the control volume. */
- vector Edge; /*!< \brief Edges that set up a control volume. */
- su2double *Volume; /*!< \brief Volume or Area of the control volume in 3D and 2D. */
- bool Domain, /*!< \brief Indicates if a point must be computed or belong to another boundary */
- Boundary, /*!< \brief To see if a point belong to the boundary (including MPI). */
- PhysicalBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */
- SolidBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */
- long *Vertex; /*!< \brief Index of the vertex that correspond which the control volume (we need one for each marker in the same node). */
- su2double *Coord, /*!< \brief vector with the coordinates of the node. */
- *Coord_Old, /*!< \brief Old coordinates vector for geometry smoothing. */
- *Coord_Sum, /*!< \brief Sum of coordinates vector for geometry smoothing. */
- *Coord_n, /*!< \brief Coordinates at time n for use with dynamic meshes. */
- *Coord_n1, /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */
- *Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */
- su2double *GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */
- su2double **GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */
- unsigned long Parent_CV; /*!< \brief Index of the parent control volume in the agglomeration process. */
- unsigned short nChildren_CV; /*!< \brief Number of children in the agglomeration process. */
- vector Children_CV; /*!< \brief Index of the children control volumes in the agglomeration process. */
- bool Agglomerate_Indirect, /*!< \brief This flag indicates if the indirect points can be agglomerated. */
- Agglomerate; /*!< \brief This flag indicates if the element has been agglomerated. */
- bool Move; /*!< \brief This flag indicates if the point is going to be move in the grid deformation process. */
- unsigned short color; /*!< \brief Color of the point in the partitioning strategy. */
- su2double Wall_Distance; /*!< \brief Distance to the nearest wall. */
- su2double SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
- su2double Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
- unsigned long GlobalIndex; /*!< \brief Global index in the parallel simulation. */
- unsigned short nNeighbor; /*!< \brief Number of neighbors. */
- bool Flip_Orientation; /*!< \brief Flip the orientation of the normal. */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- * \param[in] val_nDim - Number of dimensions of the problem.
- * \param[in] val_globalindex Global index in the parallel simulation.
- * \param[in] config - Definition of the particular problem.
- */
- CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig *config);
-
- /*!
- * \overload
- * \param[in] val_coord_0 First coordinate of the point.
- * \param[in] val_coord_1 Second coordinate of the point.
- * \param[in] val_globalindex Global index in the parallel simulation.
- * \param[in] config - Definition of the particular problem.
- */
- CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_globalindex, CConfig *config);
-
- /*!
- * \overload
- * \param[in] val_coord_0 First coordinate of the point.
- * \param[in] val_coord_1 Second coordinate of the point.
- * \param[in] val_coord_2 Third coordinate of the point.
- * \param[in] val_globalindex Global index in the parallel simulation.
- * \param[in] config - Definition of the particular problem.
- */
- CPoint(su2double val_coord_0, su2double val_coord_1, su2double val_coord_2, unsigned long val_globalindex, CConfig *config);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CPoint(void);
-
- /*!
- * \brief For parallel computation, its indicates if a point must be computed or not.
- * \param[in] val_domain - TRUE
if the point belong to the domain; otherwise FALSE
.
- */
- void SetDomain(bool val_domain);
-
- /*!
- * \brief For parallel computation, its indicates if a point must be computed or not.
- * \return TRUE
if the node belong to the physical domain; otherwise FALSE
.
- */
- bool GetDomain(void);
-
- /*!
- * \brief Set the value of the distance to the nearest wall.
- * \param[in] val_distance - Value of the distance.
- */
- void SetWall_Distance(su2double val_distance);
-
- /*!
- * \brief Set the value of the distance to a sharp edge.
- * \param[in] val_distance - Value of the distance.
- */
- void SetSharpEdge_Distance(su2double val_distance);
-
- /*!
- * \brief Get the value of the distance to the nearest wall.
- * \return Value of the distance to the nearest wall.
- */
- su2double GetWall_Distance(void);
-
- /*!
- * \brief Set the value of the curvature at a surface node.
- * \param[in] val_curvature - Value of the curvature.
- */
- void SetCurvature(su2double val_curvature);
-
- /*!
- * \brief Get the value of the curvature at a surface node.
- * \return Value of the curvature.
- */
- su2double GetCurvature(void);
-
- /*!
- * \brief Get the value of the distance to a sharp edge
- * \return Value of the distance to the nearest wall.
- */
- su2double GetSharpEdge_Distance(void);
-
- /*!
- * \brief Set the number of elements that compose the control volume.
- * \param[in] val_nElem - Number of elements that make the control volume around a node.
- */
- void SetnElem(unsigned short val_nElem);
-
- /*!
- * \brief Set the number of points that compose the control volume.
- * \param[in] val_nPoint - Number of points that compose the control volume (points surrounding points).
- */
- void SetnPoint(unsigned short val_nPoint);
-
- /*!
- * \brief Get the coordinates dor the control volume.
- * \param[in] val_dim - Number of dimensions of the problem.
- * \return Coordinate that correspond with val_dim.
- */
- su2double GetCoord(unsigned short val_dim);
-
- /*!
- * \brief Get the coordinates of the control volume.
- * \return pointer to the coordinate of the point.
- */
- su2double *GetCoord(void);
-
- /*!
- * \brief Set the coordinates for the control volume.
- * \param[in] val_dim - Position to store the coordinate.
- * \param[in] val_coord - Coordinate for val_dim.
- */
- void SetCoord(unsigned short val_dim, su2double val_coord);
-
- /*!
- * \brief Get the coordinates of the control volume.
- * \return pointer to the coordinate of the point.
- */
- bool GetFlip_Orientation(void);
-
- /*!
- * \brief Set the coordinates for the control volume.
- * \param[in] val_dim - Position to store the coordinate.
- * \param[in] val_coord - Coordinate for val_dim.
- */
- void SetFlip_Orientation(void);
-
- /*!
- * \brief Set the coordinates for the control volume.
- * \param[in] val_dim - Position to store the coordinate.
- * \param[in] val_coord - Coordinate for val_dim.
- */
- void AddCoord(unsigned short val_dim, su2double val_coord);
-
- /*!
- * \overload
- * \param[in] val_coord - Coordinate of the point.
- */
- void SetCoord(su2double *val_coord);
-
- /*!
- * \brief Get the number of elements that compose the control volume.
- * \return Number of elements that compose the control volume.
- */
- unsigned short GetnElem(void);
-
- /*!
- * \brief Get the number of points that compose the control volume.
- * \return Number of points that compose the control volume.
- */
- unsigned short GetnPoint(void);
-
- /*!
- * \brief Set the elements that set the control volume.
- * \param[in] val_elem - Element to be added.
- */
- void SetElem(unsigned long val_elem);
-
- /*!
- * \brief Reset the elements of a control volume.
- */
- void ResetElem(void);
-
- /*!
- * \brief Reset the points that compose the control volume.
- */
- void ResetPoint(void);
-
- /*!
- * \brief Set the points that compose the control volume.
- * \param[in] val_point - Point to be added.
- */
- void SetPoint(unsigned long val_point);
-
- /*!
- * \brief Set the edges that compose the control volume.
- * \param[in] val_edge - Edge to be added.
- * \param[in] val_nEdge - Position in which is going to be stored the edge for each control volume.
- */
- void SetEdge(long val_edge, unsigned short val_nEdge);
-
- /*!
- * \brief Set the boundary vertex that compose the control volume.
- * \param[in] val_vertex - Vertex to be added.
- * \param[in] val_nMarker - Marker of the vertex to be added (position where is going to be stored).
- */
- void SetVertex(long val_vertex, unsigned short val_nMarker);
-
- /*!
- * \brief Get all the elements that compose the control volume.
- * \param[in] val_elem - Position where the element is stored.
- * \return Index of the element.
- */
- unsigned long GetElem(unsigned short val_elem);
-
- /*!
- * \brief Get all the points that compose the control volume.
- * \param[in] val_point - Position where the point is stored.
- * \return Index of the point.
- */
- unsigned long GetPoint(unsigned short val_point);
-
- /*!
- * \brief Get all the edges that compose the control volume.
- * \param[in] val_edge - Position where the edge is stored.
- * \return Index of the edge.
- */
- long GetEdge(unsigned short val_edge);
-
- /*!
- * \brief Get the vertex that compose the control volume for a marker.
- * \param[in] val_marker - Position where the vertex is stored.
- * \return Index of the vertex.
- */
- long GetVertex(unsigned short val_marker);
-
- /*!
- * \brief Adds some area or volume of the CV.
- * \param[in] val_Volume - Local volume to be added to the total one.
- */
- void AddVolume(su2double val_Volume);
-
- /*!
- * \brief Get area or volume of the control volume.
- * \return Area or volume of the control volume.
- */
- su2double GetVolume(void);
-
- /*!
- * \brief Get information about the movement of the node.
- * \return TRUE
if the point is going to be moved; otherwise FALSE
.
- */
- bool GetMove(void);
-
- /*!
- * \brief Set if a point belong to the boundary.
- * \note It also create the structure to store the vertex.
- * \param[in] val_nmarker - Max number of marker.
- */
- void SetBoundary(unsigned short val_nmarker);
-
- /*!
- * \brief Reset the boundary of a control volume.
- */
- void ResetBoundary(void);
-
- /*!
- * \overload
- * \param[in] val_boundary - TRUE
if the point belong to the boundary; otherwise FALSE
.
- */
- void SetBoundary(bool val_boundary);
-
- /*!
- * \brief Provides information about if a point belong to the boundaries.
- * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
- */
- bool GetBoundary(void);
-
- /*!
- * \brief Set if a point belong to the boundary.
- * \param[in] val_boundary - TRUE
if the point belong to the physical boundary; otherwise FALSE
.
- */
- void SetPhysicalBoundary(bool val_boundary);
-
- /*!
- * \brief Set if a point belong to the boundary.
- * \param[in] val_boundary - TRUE
if the point belong to the physical boundary; otherwise FALSE
.
- */
- void SetSolidBoundary(bool val_boundary);
-
- /*!
- * \brief Provides information about if a point belong to the physical boundaries (without MPI).
- * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
- */
- bool GetPhysicalBoundary(void);
-
- /*!
- * \brief Provides information about if a point belong to the physical boundaries (without MPI).
- * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
- */
- bool GetSolidBoundary(void);
-
- /*!
- * \brief Set a color to the point that comes from the grid partitioning.
- * \note Each domain has a different color.
- * \param[in] val_color - Color of the point.
- */
- void SetColor(unsigned short val_color);
-
- /*!
- * \brief Set the number of neighbor (artificial dissipation).
- * \param[in] val_nneighbor - Number of neighbors.
- */
- void SetnNeighbor(unsigned short val_nneighbor);
-
- /*!
- * \brief Get the number of neighbor of a point.
- * \return Number of neighbors.
- */
- unsigned short GetnNeighbor(void);
-
- /*!
- * \brief Get the color of a point, the color indicates to which subdomain the point belong to.
- * \return Color of the point.
- */
- unsigned short GetColor(void);
-
- /*!
- * \brief Get the global index in a parallel computation.
- * \return Global index in a parallel computation.
- */
- unsigned long GetGlobalIndex(void);
-
- /*!
- * \brief Set the global index in a parallel computation.
- * \return Global index in a parallel computation.
- */
- void SetGlobalIndex(unsigned long val_globalindex);
-
- /*!
- * \brief Get the volume of the control volume at time n.
- * \return Volume of the control volume at time n
- */
- su2double GetVolume_n(void);
-
- /*!
- * \brief Get the volume of the control volume at time n+1.
- * \return Volume of the control volume at time n+1
- */
- su2double GetVolume_nM1(void);
-
- /*!
- * \brief Set the volume of the control volume at time n.
- */
- void SetVolume_n(void);
-
- /*!
- * \brief Set the volume of the control volume at time n+1.
- */
- void SetVolume_nM1(void);
-
- /*!
- * \brief Get the coordinates of the control volume at time n.
- * \return Coordinates of the control volume at time n.
- */
- su2double* GetCoord_n(void);
-
- /*!
- * \brief Get the coordinates of the control volume at time n-1.
- * \return Volume of the control volume at time n-1
- */
- su2double* GetCoord_n1(void);
-
- /*!
- * \brief Get the coordinates of the control volume at time n+1.
- * \return Volume of the control volume at time n+1
- */
- su2double* GetCoord_p1(void);
-
- /*!
- * \brief Set the coordinates of the control volume at time n.
- */
- void SetCoord_n(void);
-
- /*!
- * \brief Set the coordinates of the control volume at time n-1.
- */
- void SetCoord_n1(void);
-
- /*!
- * \brief Set the coordinates of the control volume at time n+1.
- * \param[in] val_coord - Value of the grid coordinates at time n+1.
- */
- void SetCoord_p1(su2double *val_coord);
-
- /*!
- * \brief Set the volume of the control volume.
- * \param[in] val_Volume - Value of the volume.
- */
- void SetVolume(su2double val_Volume);
-
- /*!
- * \brief Set if a element is going to be moved on the deformation process.
- * \param[in] val_move - true or false depending if the point will be moved.
- */
- void SetMove(bool val_move);
-
- /*!
- * \brief Set the parent control volume of an agglomerated control volume.
- * \param[in] val_parent_CV - Index of the parent control volume.
- */
- void SetParent_CV(unsigned long val_parent_CV);
-
- /*!
- * \brief Set the children control volumes of an agglomerated control volume.
- * \param[in] val_nchildren_CV - Number of children.
- * \param[in] val_children_CV - Index of the children control volume.
- */
- void SetChildren_CV(unsigned short val_nchildren_CV, unsigned long val_children_CV);
-
- /*!
- * \brief Get the parent control volume of an agglomerated control volume.
- * \return Index of the parent control volume.
- */
- unsigned long GetParent_CV(void);
-
- /*!
- * \brief Get the children control volume of an agglomerated control volume.
- * \param[in] val_nchildren_CV - Number of the children.
- * \return Index of the parent control volume.
- */
- unsigned long GetChildren_CV(unsigned short val_nchildren_CV);
-
- /*!
- * \brief Get information about if a control volume has been agglomerated.
- * \return TRUE
if the point has been agglomerated; otherwise FALSE
.
- */
- bool GetAgglomerate(void);
-
- /*!
- * \brief Get information about if the indirect neighbors can be agglomerated.
- * \return TRUE
if the indirect neigbors can be agglomerated; otherwise FALSE
.
- */
- bool GetAgglomerate_Indirect(void);
-
- /*!
- * \brief Set information about if the indirect neighbors can be agglomerated.
- * \param[in] val_agglomerate - The indirect neigbors can be agglomerated.
- */
- void SetAgglomerate_Indirect(bool val_agglomerate);
-
- /*!
- * \brief Get the number of children of an agglomerated control volume.
- * \return Number of children control volume.
- */
- unsigned short GetnChildren_CV(void);
-
- /*!
- * \brief Set the number of children of an agglomerated control volume.
- * \param[in] val_nchildren_CV - Number of children of the control volume.
- */
- void SetnChildren_CV(unsigned short val_nchildren_CV);
-
- /*!
- * \brief Get the value of the summed coordinates for implicit smoothing.
- * \return Sum of coordinates at a point.
- */
- su2double *GetCoord_Sum(void);
-
- /*!
- * \brief Get the value of the old coordinates for implicit smoothing.
- * \return Old coordinates at a point.
- */
- su2double *GetCoord_Old(void);
-
- /*!
- * \brief Get the value of the grid velocity at the point.
- * \return Grid velocity at the point.
- */
- su2double *GetGridVel(void);
-
- /*!
- * \brief Get the value of the grid velocity gradient at the point.
- * \return Grid velocity gradient at the point.
- */
- su2double **GetGridVel_Grad(void);
-
- /*!
- * \brief Add the value of the coordinates to the Coord_Sum vector for implicit smoothing.
- * \param[in] val_coord_sum - Value of the coordinates to add.
- */
- void AddCoord_Sum(su2double *val_coord_sum);
-
- /*!
- * \brief Initialize the vector Coord_Sum.
- */
- void SetCoord_SumZero(void);
-
- /*!
- * \brief Set the value of the vector Coord_Old for implicit smoothing.
- * \param[in] val_coord_old - Value of the coordinates.
- */
- void SetCoord_Old(su2double *val_coord_old);
-
- /*!
- * \brief Set the value of the grid velocity at the point.
- * \param[in] val_dim - Index of the coordinate.
- * \param[in] val_gridvel - Value of the grid velocity.
- */
- void SetGridVel(unsigned short val_dim, su2double val_gridvel);
-
- /*!
- * \overload
- * \param[in] val_gridvel - Value of the grid velocity.
- */
- void SetGridVel(su2double *val_gridvel);
-
- /*!
- * \brief Set the gradient of the grid velocity.
- * \param[in] val_var - Index of the variable.
- * \param[in] val_dim - Index of the dimension.
- * \param[in] val_value - Value of the gradient.
- */
- void SetGridVel_Grad(unsigned short val_var, unsigned short val_dim, su2double val_value);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void GetNormal(su2double *val_normal);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- su2double *GetNormal(void);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void SetNormal(su2double *val_face_normal);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- unsigned short GetnNodes(void);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void SetZeroValues(void);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void AddNormal(su2double *val_face_normal);
-};
-
-/*!
- * \class CEdge
- * \brief Class for defining an edge.
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CEdge : public CDualGrid {
-private:
- su2double *Coord_CG; /*!< \brief Center-of-gravity of the element. */
- unsigned long *Nodes; /*!< \brief Vector to store the global nodes of an element. */
- su2double *Normal; /*!< \brief Normal al elemento y coordenadas de su centro de gravedad. */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- * \param[in] val_iPoint - First node of the edge.
- * \param[in] val_jPoint - Second node of the edge.
- * \param[in] val_nDim - Number of dimensions of the problem.
- */
- CEdge(unsigned long val_iPoint, unsigned long val_jPoint, unsigned short val_nDim);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CEdge(void);
-
- /*!
- * \brief Set the center of gravity of the edge.
- * \param[in] val_coord - Coordinates of all the nodes needed for computing the centre of gravity of an edge.
- */
- void SetCoord_CG(su2double **val_coord);
-
- /*!
- * \brief Obtain the centre of gravity of the edge.
- * \param[in] val_dim - Position to read the coordinate.
- * \return Coordinate val_dim of the centre of gravity.
- */
- su2double GetCG(unsigned short val_dim);
-
- /*!
- * \brief Get the nodes of the edge.
- * \param[in] val_node - Position of the node that makes the edge.
- * \return Index of the node that compose the edge.
- */
-
- unsigned long GetNode(unsigned short val_node);
-
- /*!
- * \brief Get the number of nodes of an element.
- * \return Number of nodes that set an edge (2).
- */
- unsigned short GetnNodes(void);
-
- /*!
- * \brief Compute Volume associated to each edge.
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] val_coord_Point - Coordinates of the point that form the control volume.
- * \return Local volume associated to the edge.
- */
- su2double GetVolume(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG, su2double *val_coord_Point);
-
- /*!
- * \overload
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] val_coord_Point - Coordinates of the point that form the control volume.
- * \return Local volume associated to the edge.
- */
- su2double GetVolume(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG, su2double *val_coord_Point);
-
- /*!
- * \brief Set the face that correspond to an edge.
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] config - Definition of the particular problem.
- * \return Compute the normal (dimensional) to the face that makes the control volume boundaries.
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \overload
- * \brief Set the face that correspond to an edge.
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \param[in] config - Definition of the particular problem.
- * \return Compute the normal (dimensional) to the face that makes the contorl volume boundaries.
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \brief Copy the the normal vector of a face.
- * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensional).
- */
- void GetNormal(su2double *val_normal);
-
- /*!
- * \brief Get the normal to a face of the control volume asociated with an edge.
- * \return Dimensional normal vector, the modulus is the area of the face.
- */
- su2double *GetNormal(void);
-
- /*!
- * \brief Initialize normal vector.
- */
- void SetZeroValues(void);
-
- /*!
- * \brief Set the normal vector.
- * \param[in] val_face_normal - Vector to initialize the normal vector.
- * \return Value of the normal vector.
- */
- void SetNormal(su2double *val_face_normal);
-
- /*!
- * \brief Add a vector to the normal vector.
- * \param[in] val_face_normal - Vector to add to the normal vector.
- */
- void AddNormal(su2double *val_face_normal);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- su2double *GetCoord(void);
-
- /*!
- * \brief This function does nothing (it comes from a pure virtual function, that implies the
- * definition of the function in all the derived classes).
- */
- void SetCoord(su2double *val_coord);
-
-};
-
-/*!
- * \class CVertex
- * \brief Class for vertex definition (equivalent to edges, but for the boundaries).
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CVertex : public CDualGrid {
-private:
- unsigned long *Nodes; /*!< \brief Vector to store the global nodes of an element. */
- su2double *Normal; /*!< \brief Normal coordinates of the element and its center of gravity. */
- su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */
- su2double CartCoord[3]; /*!< \brief Vertex cartesians coordinates. */
- su2double VarCoord[3]; /*!< \brief Used for storing the coordinate variation due to a surface modification. */
- long PeriodicPoint[2]; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */
- short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */
- unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */
- unsigned long Donor_Elem; /*!< \brief Store the donor element for interpolation across zones/ */
- su2double Basis_Function[3]; /*!< \brief Basis function values for interpolation across zones. */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- * \param[in] val_point - Node of the vertex.
- * \param[in] val_nDim - Number of dimensions of the problem.
- */
- CVertex(unsigned long val_point, unsigned short val_nDim);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CVertex(void);
-
- /*!
- * \brief Get the number of nodes of a vertex.
- * \return Number of nodes that set a vertex (1).
- */
- unsigned short GetnNodes(void);
-
- /*!
- * \brief Get the node of the vertex.
- * \return Index of the node that compose the vertex.
- */
- unsigned long GetNode(void);
-
- /*!
- * \brief Set the face that correspond to a vertex.
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \return Compute the normal (dimensional) to the face that makes the vertex.
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \overload
- * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
- * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
- * \return Compute the normal (dimensional) to the face that makes the vertex.
- */
- void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
-
- /*!
- * \brief Copy the the normal vector of a face.
- * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensional).
- */
- void GetNormal(su2double *val_normal);
-
- /*!
- * \brief Get the normal to a face of the control volume asociated with a vertex.
- * \return Dimensional normal vector, the modulus is the area of the face.
- */
- su2double *GetNormal(void);
-
- /*!
- * \brief Initialize normal vector.
- */
- void SetZeroValues(void);
-
- /*!
- * \brief Set the value of an auxiliary variable for gradient computation.
- * \param[in] val_auxvar - Value of the auxiliar variable.
- */
- void SetAuxVar(su2double val_auxvar);
-
- /*!
- * \brief Get the value of an auxiliary variable for gradient computation.
- * \return Value of the auxiliar variable.
- */
- su2double GetAuxVar(void);
-
- /*!
- * \brief Add the value of an auxiliary variable for gradient computation.
- * \param[in] val_auxvar - Value of the auxiliar variable.
- */
- void AddAuxVar(su2double val_auxvar);
-
- /*!
- * \brief Set the normal vector.
- * \param[in] val_face_normal - Vector to initialize the normal vector.
- * \return Value of the normal vector.
- */
- void SetNormal(su2double *val_face_normal);
-
- /*!
- * \brief Add a vector to the normal vector.
- * \param[in] val_face_normal - Vector to add to the normal vector.
- */
- void AddNormal(su2double *val_face_normal);
-
- /*!
- * \brief Set the value of the coordinate variation due to a surface modification.
- * \param[in] val_varcoord - Variation of the coordinate.
- */
- void SetVarCoord(su2double *val_varcoord);
-
- /*!
- * \brief Add the value of the coordinate variation due to a surface modification.
- * \param[in] val_varcoord - Variation of the coordinate.
- */
- void AddVarCoord(su2double *val_varcoord);
-
- /*!
- * \brief Get the value of the coordinate variation due to a surface modification.
- * \return Variation of the coordinate.
- */
- su2double *GetVarCoord(void);
-
- /*!
- * \brief Set the value of the cartesian coordinate for the vertex.
- * \param[in] val_coord - Value of the cartesian coordinate.
- */
- void SetCoord(su2double *val_coord);
-
- /*!
- * \brief Get the value of the cartesian coordinate for the vertex.
- * \return Value of the cartesian coordinate of the vertex.
- */
- su2double *GetCoord(void);
-
- /*!
- * \brief Get the value of the cartesian coordinate for the vertex.
- * \param[in] val_dim - Variable of the dimension.
- * \return Value of the cartesian coordinate of the vertex.
- */
- su2double GetCoord(unsigned short val_dim);
-
- /*!
- * \brief Set the type of rotation associated to the vertex.
- * \param[in] val_rotation_type - Value of the rotation that will be applied to the solution at the vertex
- */
- void SetRotation_Type(short val_rotation_type);
-
- /*!
- * \brief Get the type of rotation associated to the vertex.
- * \return Value of the rotation that must be applied to the solution of the vertex
- */
- short GetRotation_Type(void);
-
- /*!
- * \overload
- * \param[in] val_periodicpoint - Value of periodic point of the vertex.
- * \param[in] val_processor - Processor where the point belong.
- */
- void SetDonorPoint(long val_periodicpoint, long val_processor);
-
- /*!
- * \brief Get the value of the periodic point of a vertex.
- * \return Value of the periodic point of a vertex.
- */
- long GetDonorPoint(void);
-
- /*!
- * \brief Get the value of the periodic point of a vertex.
- * \return Value of the periodic point of a vertex.
- */
- long GetDonorProcessor(void);
-
- /*!
- * \brief Get the value of the periodic point of a vertex, and its somain
- * \return Value of the periodic point of a vertex, and the domain.
- */
- long *GetPeriodicPointDomain(void);
-
- /*!
- * \brief Set the donor element of a vertex for interpolation across zones.
- * \param[in] val_donorelem - donor element index.
- */
- void SetDonorElem(long val_donorelem);
-
- /*!
- * \brief Get the donor element of a vertex for interpolation across zones.
- * \return Value of the donor element of a vertex.
- */
- long GetDonorElem(void);
-
- /*!
- * \brief Set the finite element basis functions needed for interpolation.
- * \param[in] val_node - a node index of the owner element.
- * \param[in] val_basis - basis function value for the node.
- */
- void SetBasisFunction(unsigned short val_node, su2double val_basis);
-
- /*!
- * \brief Get the finite element basis functions needed for interpolation.
- * \param[in] val_node - a node index of the owner element.
- * \return Value of the basis function for this node.
- */
- su2double GetBasisFunction(unsigned short val_node);
-
- /*!
- * \brief Set the index of the closest neighbor to a point on the boundaries.
- * \param[in] val_Normal_Neighbor - Index of the closest neighbor.
- */
- void SetNormal_Neighbor(unsigned long val_Normal_Neighbor);
-
- /*!
- * \brief Get the value of the closest neighbor.
- * \return Index of the closest neighbor.
- */
- unsigned long GetNormal_Neighbor(void);
-
-};
-
-#include "dual_grid_structure.inl"
+/*!
+ * \file dual_grid_structure.hpp
+ * \brief Headers of the main subroutines for doing the complete dual grid structure.
+ * The subroutines and functions are in the dual_grid_structure.cpp file.
+ * \author F. Palacios, T. Economon
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+#include "./mpi_structure.hpp"
+
+#include
+#include
+#include
+#include
+
+#include "config_structure.hpp"
+
+using namespace std;
+
+/*!
+ * \class CDualGrid
+ * \brief Class for controlling the dual volume definition. The dual volume is compose by
+ * three main elements: points, edges, and vertices.
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CDualGrid{
+protected:
+ static unsigned short nDim; /*!< \brief Number of dimensions of the problem. */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ * \param[in] val_nDim - Number of dimensions of the problem.
+ */
+ CDualGrid(unsigned short val_nDim);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CDualGrid(void);
+
+ /*!
+ * \brief A pure virtual member.
+ */
+ virtual su2double *GetCoord(void) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] val_coord - Coordinate of the point.
+ */
+ virtual void SetCoord(su2double *val_coord) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] config - Definition of the particular problem.
+ */
+ virtual void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG) = 0;
+
+ /*!
+ * \overload
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] config - Definition of the particular problem.
+ */
+ virtual void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] val_normal - Coordinates of the normal.
+ */
+ virtual void GetNormal(su2double *val_normal) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ */
+ virtual su2double *GetNormal(void) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] val_face_normal - Coordinates of the normal.
+ */
+ virtual void SetNormal(su2double *val_face_normal) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ */
+ virtual unsigned short GetnNodes(void) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ */
+ virtual void SetZeroValues(void) = 0;
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] val_face_normal - Normal vector to be added.
+ */
+ virtual void AddNormal(su2double *val_face_normal) = 0;
+};
+
+/*!
+ * \class CPoint
+ * \brief Class for point definition (including control volume definition).
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CPoint : public CDualGrid {
+private:
+ unsigned short nElem, /*!< \brief Number of elements that set up the control volume. */
+ nPoint; /*!< \brief Number of points that set up the control volume */
+ vector Elem; /*!< \brief Elements that set up a control volume around a node. */
+ vector Point; /*!< \brief Points surrounding the central node of the control volume. */
+ vector Edge; /*!< \brief Edges that set up a control volume. */
+ su2double *Volume; /*!< \brief Volume or Area of the control volume in 3D and 2D. */
+ bool Domain, /*!< \brief Indicates if a point must be computed or belong to another boundary */
+ Boundary, /*!< \brief To see if a point belong to the boundary (including MPI). */
+ PhysicalBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */
+ SolidBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */
+ long *Vertex; /*!< \brief Index of the vertex that correspond which the control volume (we need one for each marker in the same node). */
+ su2double *Coord, /*!< \brief vector with the coordinates of the node. */
+ *Coord_Old, /*!< \brief Old coordinates vector for geometry smoothing. */
+ *Coord_Sum, /*!< \brief Sum of coordinates vector for geometry smoothing. */
+ *Coord_n, /*!< \brief Coordinates at time n for use with dynamic meshes. */
+ *Coord_n1, /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */
+ *Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */
+ su2double *GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */
+ su2double **GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */
+ unsigned long Parent_CV; /*!< \brief Index of the parent control volume in the agglomeration process. */
+ unsigned short nChildren_CV; /*!< \brief Number of children in the agglomeration process. */
+ vector Children_CV; /*!< \brief Index of the children control volumes in the agglomeration process. */
+ bool Agglomerate_Indirect, /*!< \brief This flag indicates if the indirect points can be agglomerated. */
+ Agglomerate; /*!< \brief This flag indicates if the element has been agglomerated. */
+ bool Move; /*!< \brief This flag indicates if the point is going to be move in the grid deformation process. */
+ unsigned short color; /*!< \brief Color of the point in the partitioning strategy. */
+ su2double Wall_Distance; /*!< \brief Distance to the nearest wall. */
+ su2double SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
+ su2double Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
+ unsigned long GlobalIndex; /*!< \brief Global index in the parallel simulation. */
+ unsigned short nNeighbor; /*!< \brief Number of neighbors. */
+ bool Flip_Orientation; /*!< \brief Flip the orientation of the normal. */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ * \param[in] val_nDim - Number of dimensions of the problem.
+ * \param[in] val_globalindex Global index in the parallel simulation.
+ * \param[in] config - Definition of the particular problem.
+ */
+ CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig *config);
+
+ /*!
+ * \overload
+ * \param[in] val_coord_0 First coordinate of the point.
+ * \param[in] val_coord_1 Second coordinate of the point.
+ * \param[in] val_globalindex Global index in the parallel simulation.
+ * \param[in] config - Definition of the particular problem.
+ */
+ CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_globalindex, CConfig *config);
+
+ /*!
+ * \overload
+ * \param[in] val_coord_0 First coordinate of the point.
+ * \param[in] val_coord_1 Second coordinate of the point.
+ * \param[in] val_coord_2 Third coordinate of the point.
+ * \param[in] val_globalindex Global index in the parallel simulation.
+ * \param[in] config - Definition of the particular problem.
+ */
+ CPoint(su2double val_coord_0, su2double val_coord_1, su2double val_coord_2, unsigned long val_globalindex, CConfig *config);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CPoint(void);
+
+ /*!
+ * \brief For parallel computation, its indicates if a point must be computed or not.
+ * \param[in] val_domain - TRUE
if the point belong to the domain; otherwise FALSE
.
+ */
+ void SetDomain(bool val_domain);
+
+ /*!
+ * \brief For parallel computation, its indicates if a point must be computed or not.
+ * \return TRUE
if the node belong to the physical domain; otherwise FALSE
.
+ */
+ bool GetDomain(void);
+
+ /*!
+ * \brief Set the value of the distance to the nearest wall.
+ * \param[in] val_distance - Value of the distance.
+ */
+ void SetWall_Distance(su2double val_distance);
+
+ /*!
+ * \brief Set the value of the distance to a sharp edge.
+ * \param[in] val_distance - Value of the distance.
+ */
+ void SetSharpEdge_Distance(su2double val_distance);
+
+ /*!
+ * \brief Get the value of the distance to the nearest wall.
+ * \return Value of the distance to the nearest wall.
+ */
+ su2double GetWall_Distance(void);
+
+ /*!
+ * \brief Set the value of the curvature at a surface node.
+ * \param[in] val_curvature - Value of the curvature.
+ */
+ void SetCurvature(su2double val_curvature);
+
+ /*!
+ * \brief Get the value of the curvature at a surface node.
+ * \return Value of the curvature.
+ */
+ su2double GetCurvature(void);
+
+ /*!
+ * \brief Get the value of the distance to a sharp edge
+ * \return Value of the distance to the nearest wall.
+ */
+ su2double GetSharpEdge_Distance(void);
+
+ /*!
+ * \brief Set the number of elements that compose the control volume.
+ * \param[in] val_nElem - Number of elements that make the control volume around a node.
+ */
+ void SetnElem(unsigned short val_nElem);
+
+ /*!
+ * \brief Set the number of points that compose the control volume.
+ * \param[in] val_nPoint - Number of points that compose the control volume (points surrounding points).
+ */
+ void SetnPoint(unsigned short val_nPoint);
+
+ /*!
+ * \brief Get the coordinates dor the control volume.
+ * \param[in] val_dim - Number of dimensions of the problem.
+ * \return Coordinate that correspond with val_dim.
+ */
+ su2double GetCoord(unsigned short val_dim);
+
+ /*!
+ * \brief Get the coordinates of the control volume.
+ * \return pointer to the coordinate of the point.
+ */
+ su2double *GetCoord(void);
+
+ /*!
+ * \brief Set the coordinates for the control volume.
+ * \param[in] val_dim - Position to store the coordinate.
+ * \param[in] val_coord - Coordinate for val_dim.
+ */
+ void SetCoord(unsigned short val_dim, su2double val_coord);
+
+ /*!
+ * \brief Get the coordinates of the control volume.
+ * \return pointer to the coordinate of the point.
+ */
+ bool GetFlip_Orientation(void);
+
+ /*!
+ * \brief Set the coordinates for the control volume.
+ * \param[in] val_dim - Position to store the coordinate.
+ * \param[in] val_coord - Coordinate for val_dim.
+ */
+ void SetFlip_Orientation(void);
+
+ /*!
+ * \brief Set the coordinates for the control volume.
+ * \param[in] val_dim - Position to store the coordinate.
+ * \param[in] val_coord - Coordinate for val_dim.
+ */
+ void AddCoord(unsigned short val_dim, su2double val_coord);
+
+ /*!
+ * \overload
+ * \param[in] val_coord - Coordinate of the point.
+ */
+ void SetCoord(su2double *val_coord);
+
+ /*!
+ * \brief Get the number of elements that compose the control volume.
+ * \return Number of elements that compose the control volume.
+ */
+ unsigned short GetnElem(void);
+
+ /*!
+ * \brief Get the number of points that compose the control volume.
+ * \return Number of points that compose the control volume.
+ */
+ unsigned short GetnPoint(void);
+
+ /*!
+ * \brief Set the elements that set the control volume.
+ * \param[in] val_elem - Element to be added.
+ */
+ void SetElem(unsigned long val_elem);
+
+ /*!
+ * \brief Reset the elements of a control volume.
+ */
+ void ResetElem(void);
+
+ /*!
+ * \brief Reset the points that compose the control volume.
+ */
+ void ResetPoint(void);
+
+ /*!
+ * \brief Set the points that compose the control volume.
+ * \param[in] val_point - Point to be added.
+ */
+ void SetPoint(unsigned long val_point);
+
+ /*!
+ * \brief Set the edges that compose the control volume.
+ * \param[in] val_edge - Edge to be added.
+ * \param[in] val_nEdge - Position in which is going to be stored the edge for each control volume.
+ */
+ void SetEdge(long val_edge, unsigned short val_nEdge);
+
+ /*!
+ * \brief Set the boundary vertex that compose the control volume.
+ * \param[in] val_vertex - Vertex to be added.
+ * \param[in] val_nMarker - Marker of the vertex to be added (position where is going to be stored).
+ */
+ void SetVertex(long val_vertex, unsigned short val_nMarker);
+
+ /*!
+ * \brief Get all the elements that compose the control volume.
+ * \param[in] val_elem - Position where the element is stored.
+ * \return Index of the element.
+ */
+ unsigned long GetElem(unsigned short val_elem);
+
+ /*!
+ * \brief Get all the points that compose the control volume.
+ * \param[in] val_point - Position where the point is stored.
+ * \return Index of the point.
+ */
+ unsigned long GetPoint(unsigned short val_point);
+
+ /*!
+ * \brief Get all the edges that compose the control volume.
+ * \param[in] val_edge - Position where the edge is stored.
+ * \return Index of the edge.
+ */
+ long GetEdge(unsigned short val_edge);
+
+ /*!
+ * \brief Get the vertex that compose the control volume for a marker.
+ * \param[in] val_marker - Position where the vertex is stored.
+ * \return Index of the vertex.
+ */
+ long GetVertex(unsigned short val_marker);
+
+ /*!
+ * \brief Adds some area or volume of the CV.
+ * \param[in] val_Volume - Local volume to be added to the total one.
+ */
+ void AddVolume(su2double val_Volume);
+
+ /*!
+ * \brief Get area or volume of the control volume.
+ * \return Area or volume of the control volume.
+ */
+ su2double GetVolume(void);
+
+ /*!
+ * \brief Get information about the movement of the node.
+ * \return TRUE
if the point is going to be moved; otherwise FALSE
.
+ */
+ bool GetMove(void);
+
+ /*!
+ * \brief Set if a point belong to the boundary.
+ * \note It also create the structure to store the vertex.
+ * \param[in] val_nmarker - Max number of marker.
+ */
+ void SetBoundary(unsigned short val_nmarker);
+
+ /*!
+ * \brief Reset the boundary of a control volume.
+ */
+ void ResetBoundary(void);
+
+ /*!
+ * \overload
+ * \param[in] val_boundary - TRUE
if the point belong to the boundary; otherwise FALSE
.
+ */
+ void SetBoundary(bool val_boundary);
+
+ /*!
+ * \brief Provides information about if a point belong to the boundaries.
+ * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
+ */
+ bool GetBoundary(void);
+
+ /*!
+ * \brief Set if a point belong to the boundary.
+ * \param[in] val_boundary - TRUE
if the point belong to the physical boundary; otherwise FALSE
.
+ */
+ void SetPhysicalBoundary(bool val_boundary);
+
+ /*!
+ * \brief Set if a point belong to the boundary.
+ * \param[in] val_boundary - TRUE
if the point belong to the physical boundary; otherwise FALSE
.
+ */
+ void SetSolidBoundary(bool val_boundary);
+
+ /*!
+ * \brief Provides information about if a point belong to the physical boundaries (without MPI).
+ * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
+ */
+ bool GetPhysicalBoundary(void);
+
+ /*!
+ * \brief Provides information about if a point belong to the physical boundaries (without MPI).
+ * \return TRUE
if the point belong to the boundary; otherwise FALSE
.
+ */
+ bool GetSolidBoundary(void);
+
+ /*!
+ * \brief Set a color to the point that comes from the grid partitioning.
+ * \note Each domain has a different color.
+ * \param[in] val_color - Color of the point.
+ */
+ void SetColor(unsigned short val_color);
+
+ /*!
+ * \brief Set the number of neighbor (artificial dissipation).
+ * \param[in] val_nneighbor - Number of neighbors.
+ */
+ void SetnNeighbor(unsigned short val_nneighbor);
+
+ /*!
+ * \brief Get the number of neighbor of a point.
+ * \return Number of neighbors.
+ */
+ unsigned short GetnNeighbor(void);
+
+ /*!
+ * \brief Get the color of a point, the color indicates to which subdomain the point belong to.
+ * \return Color of the point.
+ */
+ unsigned short GetColor(void);
+
+ /*!
+ * \brief Get the global index in a parallel computation.
+ * \return Global index in a parallel computation.
+ */
+ unsigned long GetGlobalIndex(void);
+
+ /*!
+ * \brief Set the global index in a parallel computation.
+ * \return Global index in a parallel computation.
+ */
+ void SetGlobalIndex(unsigned long val_globalindex);
+
+ /*!
+ * \brief Get the volume of the control volume at time n.
+ * \return Volume of the control volume at time n
+ */
+ su2double GetVolume_n(void);
+
+ /*!
+ * \brief Get the volume of the control volume at time n+1.
+ * \return Volume of the control volume at time n+1
+ */
+ su2double GetVolume_nM1(void);
+
+ /*!
+ * \brief Set the volume of the control volume at time n.
+ */
+ void SetVolume_n(void);
+
+ /*!
+ * \brief Set the volume of the control volume at time n+1.
+ */
+ void SetVolume_nM1(void);
+
+ /*!
+ * \brief Get the coordinates of the control volume at time n.
+ * \return Coordinates of the control volume at time n.
+ */
+ su2double* GetCoord_n(void);
+
+ /*!
+ * \brief Get the coordinates of the control volume at time n-1.
+ * \return Volume of the control volume at time n-1
+ */
+ su2double* GetCoord_n1(void);
+
+ /*!
+ * \brief Get the coordinates of the control volume at time n+1.
+ * \return Volume of the control volume at time n+1
+ */
+ su2double* GetCoord_p1(void);
+
+ /*!
+ * \brief Set the coordinates of the control volume at time n.
+ */
+ void SetCoord_n(void);
+
+ /*!
+ * \brief Set the coordinates of the control volume at time n-1.
+ */
+ void SetCoord_n1(void);
+
+ /*!
+ * \brief Set the coordinates of the control volume at time n+1.
+ * \param[in] val_coord - Value of the grid coordinates at time n+1.
+ */
+ void SetCoord_p1(su2double *val_coord);
+
+ /*!
+ * \brief Set the volume of the control volume.
+ * \param[in] val_Volume - Value of the volume.
+ */
+ void SetVolume(su2double val_Volume);
+
+ /*!
+ * \brief Set if a element is going to be moved on the deformation process.
+ * \param[in] val_move - true or false depending if the point will be moved.
+ */
+ void SetMove(bool val_move);
+
+ /*!
+ * \brief Set the parent control volume of an agglomerated control volume.
+ * \param[in] val_parent_CV - Index of the parent control volume.
+ */
+ void SetParent_CV(unsigned long val_parent_CV);
+
+ /*!
+ * \brief Set the children control volumes of an agglomerated control volume.
+ * \param[in] val_nchildren_CV - Number of children.
+ * \param[in] val_children_CV - Index of the children control volume.
+ */
+ void SetChildren_CV(unsigned short val_nchildren_CV, unsigned long val_children_CV);
+
+ /*!
+ * \brief Get the parent control volume of an agglomerated control volume.
+ * \return Index of the parent control volume.
+ */
+ unsigned long GetParent_CV(void);
+
+ /*!
+ * \brief Get the children control volume of an agglomerated control volume.
+ * \param[in] val_nchildren_CV - Number of the children.
+ * \return Index of the parent control volume.
+ */
+ unsigned long GetChildren_CV(unsigned short val_nchildren_CV);
+
+ /*!
+ * \brief Get information about if a control volume has been agglomerated.
+ * \return TRUE
if the point has been agglomerated; otherwise FALSE
.
+ */
+ bool GetAgglomerate(void);
+
+ /*!
+ * \brief Get information about if the indirect neighbors can be agglomerated.
+ * \return TRUE
if the indirect neigbors can be agglomerated; otherwise FALSE
.
+ */
+ bool GetAgglomerate_Indirect(void);
+
+ /*!
+ * \brief Set information about if the indirect neighbors can be agglomerated.
+ * \param[in] val_agglomerate - The indirect neigbors can be agglomerated.
+ */
+ void SetAgglomerate_Indirect(bool val_agglomerate);
+
+ /*!
+ * \brief Get the number of children of an agglomerated control volume.
+ * \return Number of children control volume.
+ */
+ unsigned short GetnChildren_CV(void);
+
+ /*!
+ * \brief Set the number of children of an agglomerated control volume.
+ * \param[in] val_nchildren_CV - Number of children of the control volume.
+ */
+ void SetnChildren_CV(unsigned short val_nchildren_CV);
+
+ /*!
+ * \brief Get the value of the summed coordinates for implicit smoothing.
+ * \return Sum of coordinates at a point.
+ */
+ su2double *GetCoord_Sum(void);
+
+ /*!
+ * \brief Get the value of the old coordinates for implicit smoothing.
+ * \return Old coordinates at a point.
+ */
+ su2double *GetCoord_Old(void);
+
+ /*!
+ * \brief Get the value of the grid velocity at the point.
+ * \return Grid velocity at the point.
+ */
+ su2double *GetGridVel(void);
+
+ /*!
+ * \brief Get the value of the grid velocity gradient at the point.
+ * \return Grid velocity gradient at the point.
+ */
+ su2double **GetGridVel_Grad(void);
+
+ /*!
+ * \brief Add the value of the coordinates to the Coord_Sum vector for implicit smoothing.
+ * \param[in] val_coord_sum - Value of the coordinates to add.
+ */
+ void AddCoord_Sum(su2double *val_coord_sum);
+
+ /*!
+ * \brief Initialize the vector Coord_Sum.
+ */
+ void SetCoord_SumZero(void);
+
+ /*!
+ * \brief Set the value of the vector Coord_Old for implicit smoothing.
+ * \param[in] val_coord_old - Value of the coordinates.
+ */
+ void SetCoord_Old(su2double *val_coord_old);
+
+ /*!
+ * \brief Set the value of the grid velocity at the point.
+ * \param[in] val_dim - Index of the coordinate.
+ * \param[in] val_gridvel - Value of the grid velocity.
+ */
+ void SetGridVel(unsigned short val_dim, su2double val_gridvel);
+
+ /*!
+ * \overload
+ * \param[in] val_gridvel - Value of the grid velocity.
+ */
+ void SetGridVel(su2double *val_gridvel);
+
+ /*!
+ * \brief Set the gradient of the grid velocity.
+ * \param[in] val_var - Index of the variable.
+ * \param[in] val_dim - Index of the dimension.
+ * \param[in] val_value - Value of the gradient.
+ */
+ void SetGridVel_Grad(unsigned short val_var, unsigned short val_dim, su2double val_value);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void GetNormal(su2double *val_normal);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ su2double *GetNormal(void);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void SetNormal(su2double *val_face_normal);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ unsigned short GetnNodes(void);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void SetZeroValues(void);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void AddNormal(su2double *val_face_normal);
+};
+
+/*!
+ * \class CEdge
+ * \brief Class for defining an edge.
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CEdge : public CDualGrid {
+private:
+ su2double *Coord_CG; /*!< \brief Center-of-gravity of the element. */
+ unsigned long *Nodes; /*!< \brief Vector to store the global nodes of an element. */
+ su2double *Normal; /*!< \brief Normal al elemento y coordenadas de su centro de gravedad. */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ * \param[in] val_iPoint - First node of the edge.
+ * \param[in] val_jPoint - Second node of the edge.
+ * \param[in] val_nDim - Number of dimensions of the problem.
+ */
+ CEdge(unsigned long val_iPoint, unsigned long val_jPoint, unsigned short val_nDim);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CEdge(void);
+
+ /*!
+ * \brief Set the center of gravity of the edge.
+ * \param[in] val_coord - Coordinates of all the nodes needed for computing the centre of gravity of an edge.
+ */
+ void SetCoord_CG(su2double **val_coord);
+
+ /*!
+ * \brief Obtain the centre of gravity of the edge.
+ * \param[in] val_dim - Position to read the coordinate.
+ * \return Coordinate val_dim of the centre of gravity.
+ */
+ su2double GetCG(unsigned short val_dim);
+
+ /*!
+ * \brief Get the nodes of the edge.
+ * \param[in] val_node - Position of the node that makes the edge.
+ * \return Index of the node that compose the edge.
+ */
+
+ unsigned long GetNode(unsigned short val_node);
+
+ /*!
+ * \brief Get the number of nodes of an element.
+ * \return Number of nodes that set an edge (2).
+ */
+ unsigned short GetnNodes(void);
+
+ /*!
+ * \brief Compute Volume associated to each edge.
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] val_coord_Point - Coordinates of the point that form the control volume.
+ * \return Local volume associated to the edge.
+ */
+ su2double GetVolume(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG, su2double *val_coord_Point);
+
+ /*!
+ * \overload
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] val_coord_Point - Coordinates of the point that form the control volume.
+ * \return Local volume associated to the edge.
+ */
+ su2double GetVolume(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG, su2double *val_coord_Point);
+
+ /*!
+ * \brief Set the face that correspond to an edge.
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] config - Definition of the particular problem.
+ * \return Compute the normal (dimensional) to the face that makes the control volume boundaries.
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \overload
+ * \brief Set the face that correspond to an edge.
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \param[in] config - Definition of the particular problem.
+ * \return Compute the normal (dimensional) to the face that makes the contorl volume boundaries.
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \brief Copy the the normal vector of a face.
+ * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensional).
+ */
+ void GetNormal(su2double *val_normal);
+
+ /*!
+ * \brief Get the normal to a face of the control volume asociated with an edge.
+ * \return Dimensional normal vector, the modulus is the area of the face.
+ */
+ su2double *GetNormal(void);
+
+ /*!
+ * \brief Initialize normal vector.
+ */
+ void SetZeroValues(void);
+
+ /*!
+ * \brief Set the normal vector.
+ * \param[in] val_face_normal - Vector to initialize the normal vector.
+ * \return Value of the normal vector.
+ */
+ void SetNormal(su2double *val_face_normal);
+
+ /*!
+ * \brief Add a vector to the normal vector.
+ * \param[in] val_face_normal - Vector to add to the normal vector.
+ */
+ void AddNormal(su2double *val_face_normal);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ su2double *GetCoord(void);
+
+ /*!
+ * \brief This function does nothing (it comes from a pure virtual function, that implies the
+ * definition of the function in all the derived classes).
+ */
+ void SetCoord(su2double *val_coord);
+
+};
+
+/*!
+ * \class CVertex
+ * \brief Class for vertex definition (equivalent to edges, but for the boundaries).
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CVertex : public CDualGrid {
+private:
+ unsigned long *Nodes; /*!< \brief Vector to store the global nodes of an element. */
+ su2double *Normal; /*!< \brief Normal coordinates of the element and its center of gravity. */
+ su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */
+ su2double CartCoord[3]; /*!< \brief Vertex cartesians coordinates. */
+ su2double VarCoord[3]; /*!< \brief Used for storing the coordinate variation due to a surface modification. */
+ long PeriodicPoint[2]; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */
+ short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */
+ unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */
+ unsigned long Donor_Elem; /*!< \brief Store the donor element for interpolation across zones/ */
+ su2double Basis_Function[3]; /*!< \brief Basis function values for interpolation across zones. */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ * \param[in] val_point - Node of the vertex.
+ * \param[in] val_nDim - Number of dimensions of the problem.
+ */
+ CVertex(unsigned long val_point, unsigned short val_nDim);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CVertex(void);
+
+ /*!
+ * \brief Get the number of nodes of a vertex.
+ * \return Number of nodes that set a vertex (1).
+ */
+ unsigned short GetnNodes(void);
+
+ /*!
+ * \brief Get the node of the vertex.
+ * \return Index of the node that compose the vertex.
+ */
+ unsigned long GetNode(void);
+
+ /*!
+ * \brief Set the face that correspond to a vertex.
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \return Compute the normal (dimensional) to the face that makes the vertex.
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \overload
+ * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge.
+ * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element.
+ * \return Compute the normal (dimensional) to the face that makes the vertex.
+ */
+ void SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG);
+
+ /*!
+ * \brief Copy the the normal vector of a face.
+ * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensional).
+ */
+ void GetNormal(su2double *val_normal);
+
+ /*!
+ * \brief Get the normal to a face of the control volume asociated with a vertex.
+ * \return Dimensional normal vector, the modulus is the area of the face.
+ */
+ su2double *GetNormal(void);
+
+ /*!
+ * \brief Initialize normal vector.
+ */
+ void SetZeroValues(void);
+
+ /*!
+ * \brief Set the value of an auxiliary variable for gradient computation.
+ * \param[in] val_auxvar - Value of the auxiliar variable.
+ */
+ void SetAuxVar(su2double val_auxvar);
+
+ /*!
+ * \brief Get the value of an auxiliary variable for gradient computation.
+ * \return Value of the auxiliar variable.
+ */
+ su2double GetAuxVar(void);
+
+ /*!
+ * \brief Add the value of an auxiliary variable for gradient computation.
+ * \param[in] val_auxvar - Value of the auxiliar variable.
+ */
+ void AddAuxVar(su2double val_auxvar);
+
+ /*!
+ * \brief Set the normal vector.
+ * \param[in] val_face_normal - Vector to initialize the normal vector.
+ * \return Value of the normal vector.
+ */
+ void SetNormal(su2double *val_face_normal);
+
+ /*!
+ * \brief Add a vector to the normal vector.
+ * \param[in] val_face_normal - Vector to add to the normal vector.
+ */
+ void AddNormal(su2double *val_face_normal);
+
+ /*!
+ * \brief Set the value of the coordinate variation due to a surface modification.
+ * \param[in] val_varcoord - Variation of the coordinate.
+ */
+ void SetVarCoord(su2double *val_varcoord);
+
+ /*!
+ * \brief Add the value of the coordinate variation due to a surface modification.
+ * \param[in] val_varcoord - Variation of the coordinate.
+ */
+ void AddVarCoord(su2double *val_varcoord);
+
+ /*!
+ * \brief Get the value of the coordinate variation due to a surface modification.
+ * \return Variation of the coordinate.
+ */
+ su2double *GetVarCoord(void);
+
+ /*!
+ * \brief Set the value of the cartesian coordinate for the vertex.
+ * \param[in] val_coord - Value of the cartesian coordinate.
+ */
+ void SetCoord(su2double *val_coord);
+
+ /*!
+ * \brief Get the value of the cartesian coordinate for the vertex.
+ * \return Value of the cartesian coordinate of the vertex.
+ */
+ su2double *GetCoord(void);
+
+ /*!
+ * \brief Get the value of the cartesian coordinate for the vertex.
+ * \param[in] val_dim - Variable of the dimension.
+ * \return Value of the cartesian coordinate of the vertex.
+ */
+ su2double GetCoord(unsigned short val_dim);
+
+ /*!
+ * \brief Set the type of rotation associated to the vertex.
+ * \param[in] val_rotation_type - Value of the rotation that will be applied to the solution at the vertex
+ */
+ void SetRotation_Type(short val_rotation_type);
+
+ /*!
+ * \brief Get the type of rotation associated to the vertex.
+ * \return Value of the rotation that must be applied to the solution of the vertex
+ */
+ short GetRotation_Type(void);
+
+ /*!
+ * \overload
+ * \param[in] val_periodicpoint - Value of periodic point of the vertex.
+ * \param[in] val_processor - Processor where the point belong.
+ */
+ void SetDonorPoint(long val_periodicpoint, long val_processor);
+
+ /*!
+ * \brief Get the value of the periodic point of a vertex.
+ * \return Value of the periodic point of a vertex.
+ */
+ long GetDonorPoint(void);
+
+ /*!
+ * \brief Get the value of the periodic point of a vertex.
+ * \return Value of the periodic point of a vertex.
+ */
+ long GetDonorProcessor(void);
+
+ /*!
+ * \brief Get the value of the periodic point of a vertex, and its somain
+ * \return Value of the periodic point of a vertex, and the domain.
+ */
+ long *GetPeriodicPointDomain(void);
+
+ /*!
+ * \brief Set the donor element of a vertex for interpolation across zones.
+ * \param[in] val_donorelem - donor element index.
+ */
+ void SetDonorElem(long val_donorelem);
+
+ /*!
+ * \brief Get the donor element of a vertex for interpolation across zones.
+ * \return Value of the donor element of a vertex.
+ */
+ long GetDonorElem(void);
+
+ /*!
+ * \brief Set the finite element basis functions needed for interpolation.
+ * \param[in] val_node - a node index of the owner element.
+ * \param[in] val_basis - basis function value for the node.
+ */
+ void SetBasisFunction(unsigned short val_node, su2double val_basis);
+
+ /*!
+ * \brief Get the finite element basis functions needed for interpolation.
+ * \param[in] val_node - a node index of the owner element.
+ * \return Value of the basis function for this node.
+ */
+ su2double GetBasisFunction(unsigned short val_node);
+
+ /*!
+ * \brief Set the index of the closest neighbor to a point on the boundaries.
+ * \param[in] val_Normal_Neighbor - Index of the closest neighbor.
+ */
+ void SetNormal_Neighbor(unsigned long val_Normal_Neighbor);
+
+ /*!
+ * \brief Get the value of the closest neighbor.
+ * \return Index of the closest neighbor.
+ */
+ unsigned long GetNormal_Neighbor(void);
+
+};
+
+#include "dual_grid_structure.inl"
diff --git a/Common/include/dual_grid_structure.inl b/Common/include/dual_grid_structure.inl
index c1d7786edbe..86f1e1c50af 100644
--- a/Common/include/dual_grid_structure.inl
+++ b/Common/include/dual_grid_structure.inl
@@ -1,339 +1,339 @@
-/*!
- * \file dual_grid_structure.inl
- * \brief In-Line subroutines of the dual_grid_structure.hpp file.
- * \author F. Palacios, T. Economon
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-inline void CPoint::SetElem(unsigned long val_elem) { Elem.push_back(val_elem); nElem = Elem.size(); }
-
-inline void CPoint::ResetBoundary(void) { if (Vertex != NULL) delete [] Vertex; Boundary = false; }
-
-inline void CPoint::ResetElem(void) { Elem.clear(); nElem = 0; }
-
-inline void CPoint::ResetPoint(void) { Point.clear(); Edge.clear(); nPoint = 0; }
-
-inline su2double CPoint::GetCoord(unsigned short val_dim) { return Coord[val_dim]; }
-
-inline su2double *CPoint::GetCoord(void) { return Coord; }
-
-inline bool CPoint::GetFlip_Orientation(void) { return Flip_Orientation; }
-
-inline void CPoint::SetCoord(unsigned short val_dim, su2double val_coord) { Coord[val_dim] = val_coord; }
-
-inline void CPoint::SetFlip_Orientation(void) { Flip_Orientation = true; }
-
-inline void CPoint::AddCoord(unsigned short val_dim, su2double val_coord) { Coord[val_dim] += val_coord; }
-
-inline void CPoint::SetCoord(su2double *val_coord) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord[iDim]=val_coord[iDim];
-}
-
-inline void CPoint::SetnElem(unsigned short val_nElem) { nElem = val_nElem; }
-
-inline unsigned short CPoint::GetnElem(void) { return nElem; }
-
-inline void CPoint::SetEdge(long val_edge, unsigned short val_nedge) { Edge[val_nedge] = val_edge; }
-
-inline unsigned long CPoint::GetElem(unsigned short val_elem) { return Elem[val_elem]; }
-
-inline long CPoint::GetEdge(unsigned short val_edge) { return Edge[val_edge]; }
-
-inline void CPoint::SetnPoint(unsigned short val_nPoint) { nPoint = val_nPoint; }
-
-inline unsigned short CPoint::GetnPoint(void) { return nPoint; }
-
-inline unsigned long CPoint::GetPoint(unsigned short val_point) { return Point[val_point]; }
-
-inline su2double CPoint::GetVolume (void) { return Volume[0]; }
-
-inline bool CPoint::GetMove (void) { return Move; }
-
-inline bool CPoint::GetBoundary(void) { return Boundary; }
-
-inline void CPoint::SetBoundary(bool val_boundary) { Boundary = val_boundary; }
-
-inline void CPoint::SetPhysicalBoundary(bool val_boundary) { PhysicalBoundary = val_boundary; }
-
-inline bool CPoint::GetPhysicalBoundary(void) { return PhysicalBoundary; }
-
-inline void CPoint::SetSolidBoundary(bool val_boundary) { SolidBoundary = val_boundary; }
-
-inline bool CPoint::GetSolidBoundary(void) { return SolidBoundary; }
-
-inline void CPoint::AddVolume (su2double val_Volume) { Volume[0] += val_Volume; }
-
-inline void CPoint::SetVolume (su2double val_Volume) { Volume[0] = val_Volume; }
-
-inline void CPoint::SetMove(bool val_move) { Move = val_move; }
-
-inline su2double *CPoint::GetCoord_Old(void) { return Coord_Old; }
-
-inline su2double *CPoint::GetCoord_Sum(void) { return Coord_Sum; }
-
-inline su2double *CPoint::GetGridVel(void) { return GridVel; }
-
-inline su2double **CPoint::GetGridVel_Grad(void) { return GridVel_Grad; }
-
-inline void CPoint::SetCoord_Old(su2double *val_coord_old) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Old[iDim] = val_coord_old[iDim];
-}
-
-inline void CPoint::SetCoord_SumZero(void) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Sum[iDim] = 0.0;
-}
-
-inline void CPoint::AddCoord_Sum(su2double *val_coord_sum) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Sum[iDim] += val_coord_sum[iDim];
-}
-
-inline void CPoint::SetGridVel(unsigned short val_dim, su2double val_gridvel) { GridVel[val_dim] = val_gridvel; }
-
-inline void CPoint::SetGridVel_Grad(unsigned short val_var, unsigned short val_dim, su2double val_value) { GridVel_Grad[val_var][val_dim] = val_value; }
-
-inline void CPoint::SetChildren_CV (unsigned short val_nchildren_CV, unsigned long val_children_CV) {
- if (Children_CV.size() <= val_nchildren_CV) Children_CV.resize(val_nchildren_CV+1);
- Children_CV[val_nchildren_CV] = val_children_CV;
-}
-
-inline unsigned short CPoint::GetnNodes() { return 0; }
-
-inline unsigned long CPoint::GetParent_CV (void) { return Parent_CV; }
-
-inline unsigned long CPoint::GetChildren_CV (unsigned short val_nchildren_CV) { return Children_CV[val_nchildren_CV]; }
-
-inline bool CPoint::GetAgglomerate (void) { return Agglomerate; }
-
-inline bool CPoint::GetAgglomerate_Indirect (void) { return Agglomerate_Indirect; }
-
-inline void CPoint::SetAgglomerate_Indirect(bool val_agglomerate) { Agglomerate_Indirect = val_agglomerate; };
-
-inline void CPoint::SetVertex(long val_vertex, unsigned short val_nmarker) {
- if (Boundary) Vertex[val_nmarker] = val_vertex;
-}
-
-inline unsigned short CPoint::GetnChildren_CV (void) { return nChildren_CV; }
-
-inline long CPoint::GetVertex(unsigned short val_marker) {
- if (Boundary) return Vertex[val_marker];
- else return -1;
-}
-
-inline void CPoint::SetnChildren_CV (unsigned short val_nchildren_CV) { nChildren_CV = val_nchildren_CV; }
-
-inline void CPoint::SetParent_CV (unsigned long val_parent_CV) { Parent_CV = val_parent_CV; Agglomerate = true; }
-
-inline void CPoint::SetGridVel(su2double *val_gridvel) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- GridVel[iDim] = val_gridvel[iDim];
-}
-
-inline void CPoint::SetVolume_n (void) { Volume[1] = Volume[0]; }
-
-inline void CPoint::SetVolume_nM1 (void) { Volume[2] = Volume[1]; }
-
-inline su2double CPoint::GetVolume_n (void) { return Volume[1]; }
-
-inline su2double CPoint::GetVolume_nM1 (void) { return Volume[2]; }
-
-inline void CPoint::SetCoord_n (void) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_n[iDim] = Coord[iDim];
-}
-
-inline void CPoint::SetCoord_n1 (void) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_n1[iDim] = Coord_n[iDim];
-}
-
-inline void CPoint::SetCoord_p1(su2double *val_coord) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_p1[iDim] = val_coord[iDim];
-}
-
-inline su2double *CPoint::GetCoord_n (void) { return Coord_n; }
-
-inline su2double *CPoint::GetCoord_n1 (void) { return Coord_n1; }
-
-inline su2double *CPoint::GetCoord_p1 (void) { return Coord_p1; }
-
-inline void CPoint::SetColor(unsigned short val_color) { color = val_color; }
-
-inline void CPoint::SetnNeighbor(unsigned short val_nneighbor) { nNeighbor = val_nneighbor; }
-
-inline unsigned short CPoint::GetnNeighbor(void) { return nNeighbor; }
-
-inline unsigned short CPoint::GetColor(void) { return color; }
-
-inline unsigned long CPoint::GetGlobalIndex(void) { return GlobalIndex; }
-
-inline void CPoint::SetGlobalIndex(unsigned long val_globalindex) { GlobalIndex = val_globalindex; }
-
-inline void CPoint::SetDomain(bool val_domain) { Domain = val_domain; }
-
-inline bool CPoint::GetDomain(void) { return Domain; }
-
-inline void CPoint::SetWall_Distance(su2double val_distance) { Wall_Distance = val_distance; }
-
-inline void CPoint::SetCurvature(su2double val_curvature) { Curvature = val_curvature; }
-
-inline void CPoint::SetSharpEdge_Distance(su2double val_distance) { SharpEdge_Distance = val_distance; }
-
-inline su2double CPoint::GetWall_Distance(void) { return Wall_Distance; }
-
-inline su2double CPoint::GetCurvature(void) { return Curvature; }
-
-inline su2double CPoint::GetSharpEdge_Distance(void) { return SharpEdge_Distance; }
-
-inline void CPoint::SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG) { }
-
-inline void CPoint::SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG) { }
-
-inline void CPoint::GetNormal(su2double *val_normal) { }
-
-inline su2double *CPoint::GetNormal(void) { return 0; }
-
-inline void CPoint::SetNormal(su2double *val_face_normal) { }
-
-inline void CPoint::SetZeroValues(void) { }
-
-inline void CPoint::AddNormal(su2double *val_face_normal) { }
-
-inline unsigned short CEdge::GetnNodes() { return 2; }
-
-inline unsigned long CEdge::GetNode(unsigned short val_node) { return Nodes[val_node]; }
-
-inline su2double CEdge::GetCG(unsigned short val_dim) { return Coord_CG[val_dim]; }
-
-inline su2double *CEdge::GetNormal(void) { return Normal; }
-
-inline void CEdge::GetNormal(su2double *val_normal) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- val_normal[iDim] = Normal[iDim];
-}
-
-inline void CEdge::SetNormal(su2double *val_face_normal) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Normal[iDim]=val_face_normal[iDim];
-}
-
-inline void CEdge::AddNormal(su2double *val_face_normal) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Normal[iDim] += val_face_normal[iDim];
-}
-
-inline void CEdge::SetZeroValues(void) {
- for (unsigned short iDim = 0; iDim < nDim; iDim ++)
- Normal[iDim] = 0.0;
-}
-
-inline su2double *CEdge::GetCoord(void) { return NULL; }
-
-inline void CEdge::SetCoord(su2double *val_coord) { }
-
-inline unsigned short CVertex::GetnNodes() { return 1; }
-
-inline unsigned long CVertex::GetNode() { return Nodes[0]; }
-
-inline su2double *CVertex::GetNormal(void) { return Normal; }
-
-inline su2double *CVertex::GetVarCoord(void) { return VarCoord; }
-
-inline su2double *CVertex::GetCoord(void) { return CartCoord; }
-
-inline su2double CVertex::GetCoord(unsigned short val_dim) { return CartCoord[val_dim]; }
-
-inline void CVertex::SetAuxVar(su2double val_auxvar) { Aux_Var = val_auxvar; }
-
-inline void CVertex::AddAuxVar(su2double val_auxvar) { Aux_Var += val_auxvar; }
-
-inline su2double CVertex::GetAuxVar(void) { return Aux_Var; }
-
-inline void CVertex::GetNormal(su2double *val_normal) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- val_normal[iDim] = Normal[iDim];
-}
-
-inline void CVertex::SetNormal(su2double *val_face_normal) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Normal[iDim]=val_face_normal[iDim];
-}
-
-inline void CVertex::SetVarCoord(su2double *val_varcoord) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- VarCoord[iDim] = val_varcoord[iDim];
-}
-
-inline void CVertex::AddVarCoord(su2double *val_varcoord) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- VarCoord[iDim] += val_varcoord[iDim];
-}
-
-inline void CVertex::SetCoord(su2double *val_coord) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- CartCoord[iDim] = val_coord[iDim];
-}
-
-inline void CVertex::SetRotation_Type(short val_rotation_type) { Rotation_Type = val_rotation_type; }
-
-inline short CVertex::GetRotation_Type(void) { return Rotation_Type; }
-
-inline void CVertex::SetDonorPoint(long val_periodicpoint, long val_processor) {
- PeriodicPoint[0] = val_periodicpoint;
- PeriodicPoint[1] = val_processor;
-}
-
-inline void CVertex::SetDonorElem(long val_donorelem) { Donor_Elem = val_donorelem; }
-
-inline long CVertex::GetDonorElem(void) { return Donor_Elem; }
-
-inline long CVertex::GetDonorPoint(void) { return PeriodicPoint[0]; }
-
-inline long CVertex::GetDonorProcessor(void) { return PeriodicPoint[1]; }
-
-inline void CVertex::SetBasisFunction(unsigned short val_node, su2double val_basis) { Basis_Function[val_node] = val_basis; }
-
-inline su2double CVertex::GetBasisFunction(unsigned short val_node) { return Basis_Function[val_node]; }
-
-inline long *CVertex::GetPeriodicPointDomain(void) { return PeriodicPoint; }
-
-inline void CVertex::SetZeroValues(void) {
- for (unsigned short iDim = 0; iDim < nDim; iDim ++)
- Normal[iDim] = 0.0;
-}
-
-inline unsigned long CVertex::GetNormal_Neighbor(void) { return Normal_Neighbor; }
-
-inline void CVertex::SetNormal_Neighbor(unsigned long val_Normal_Neighbor) { Normal_Neighbor = val_Normal_Neighbor; }
-
-
+/*!
+ * \file dual_grid_structure.inl
+ * \brief In-Line subroutines of the dual_grid_structure.hpp file.
+ * \author F. Palacios, T. Economon
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+inline void CPoint::SetElem(unsigned long val_elem) { Elem.push_back(val_elem); nElem = Elem.size(); }
+
+inline void CPoint::ResetBoundary(void) { if (Vertex != NULL) delete [] Vertex; Boundary = false; }
+
+inline void CPoint::ResetElem(void) { Elem.clear(); nElem = 0; }
+
+inline void CPoint::ResetPoint(void) { Point.clear(); Edge.clear(); nPoint = 0; }
+
+inline su2double CPoint::GetCoord(unsigned short val_dim) { return Coord[val_dim]; }
+
+inline su2double *CPoint::GetCoord(void) { return Coord; }
+
+inline bool CPoint::GetFlip_Orientation(void) { return Flip_Orientation; }
+
+inline void CPoint::SetCoord(unsigned short val_dim, su2double val_coord) { Coord[val_dim] = val_coord; }
+
+inline void CPoint::SetFlip_Orientation(void) { Flip_Orientation = true; }
+
+inline void CPoint::AddCoord(unsigned short val_dim, su2double val_coord) { Coord[val_dim] += val_coord; }
+
+inline void CPoint::SetCoord(su2double *val_coord) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord[iDim]=val_coord[iDim];
+}
+
+inline void CPoint::SetnElem(unsigned short val_nElem) { nElem = val_nElem; }
+
+inline unsigned short CPoint::GetnElem(void) { return nElem; }
+
+inline void CPoint::SetEdge(long val_edge, unsigned short val_nedge) { Edge[val_nedge] = val_edge; }
+
+inline unsigned long CPoint::GetElem(unsigned short val_elem) { return Elem[val_elem]; }
+
+inline long CPoint::GetEdge(unsigned short val_edge) { return Edge[val_edge]; }
+
+inline void CPoint::SetnPoint(unsigned short val_nPoint) { nPoint = val_nPoint; }
+
+inline unsigned short CPoint::GetnPoint(void) { return nPoint; }
+
+inline unsigned long CPoint::GetPoint(unsigned short val_point) { return Point[val_point]; }
+
+inline su2double CPoint::GetVolume (void) { return Volume[0]; }
+
+inline bool CPoint::GetMove (void) { return Move; }
+
+inline bool CPoint::GetBoundary(void) { return Boundary; }
+
+inline void CPoint::SetBoundary(bool val_boundary) { Boundary = val_boundary; }
+
+inline void CPoint::SetPhysicalBoundary(bool val_boundary) { PhysicalBoundary = val_boundary; }
+
+inline bool CPoint::GetPhysicalBoundary(void) { return PhysicalBoundary; }
+
+inline void CPoint::SetSolidBoundary(bool val_boundary) { SolidBoundary = val_boundary; }
+
+inline bool CPoint::GetSolidBoundary(void) { return SolidBoundary; }
+
+inline void CPoint::AddVolume (su2double val_Volume) { Volume[0] += val_Volume; }
+
+inline void CPoint::SetVolume (su2double val_Volume) { Volume[0] = val_Volume; }
+
+inline void CPoint::SetMove(bool val_move) { Move = val_move; }
+
+inline su2double *CPoint::GetCoord_Old(void) { return Coord_Old; }
+
+inline su2double *CPoint::GetCoord_Sum(void) { return Coord_Sum; }
+
+inline su2double *CPoint::GetGridVel(void) { return GridVel; }
+
+inline su2double **CPoint::GetGridVel_Grad(void) { return GridVel_Grad; }
+
+inline void CPoint::SetCoord_Old(su2double *val_coord_old) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Old[iDim] = val_coord_old[iDim];
+}
+
+inline void CPoint::SetCoord_SumZero(void) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Sum[iDim] = 0.0;
+}
+
+inline void CPoint::AddCoord_Sum(su2double *val_coord_sum) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Sum[iDim] += val_coord_sum[iDim];
+}
+
+inline void CPoint::SetGridVel(unsigned short val_dim, su2double val_gridvel) { GridVel[val_dim] = val_gridvel; }
+
+inline void CPoint::SetGridVel_Grad(unsigned short val_var, unsigned short val_dim, su2double val_value) { GridVel_Grad[val_var][val_dim] = val_value; }
+
+inline void CPoint::SetChildren_CV (unsigned short val_nchildren_CV, unsigned long val_children_CV) {
+ if (Children_CV.size() <= val_nchildren_CV) Children_CV.resize(val_nchildren_CV+1);
+ Children_CV[val_nchildren_CV] = val_children_CV;
+}
+
+inline unsigned short CPoint::GetnNodes() { return 0; }
+
+inline unsigned long CPoint::GetParent_CV (void) { return Parent_CV; }
+
+inline unsigned long CPoint::GetChildren_CV (unsigned short val_nchildren_CV) { return Children_CV[val_nchildren_CV]; }
+
+inline bool CPoint::GetAgglomerate (void) { return Agglomerate; }
+
+inline bool CPoint::GetAgglomerate_Indirect (void) { return Agglomerate_Indirect; }
+
+inline void CPoint::SetAgglomerate_Indirect(bool val_agglomerate) { Agglomerate_Indirect = val_agglomerate; };
+
+inline void CPoint::SetVertex(long val_vertex, unsigned short val_nmarker) {
+ if (Boundary) Vertex[val_nmarker] = val_vertex;
+}
+
+inline unsigned short CPoint::GetnChildren_CV (void) { return nChildren_CV; }
+
+inline long CPoint::GetVertex(unsigned short val_marker) {
+ if (Boundary) return Vertex[val_marker];
+ else return -1;
+}
+
+inline void CPoint::SetnChildren_CV (unsigned short val_nchildren_CV) { nChildren_CV = val_nchildren_CV; }
+
+inline void CPoint::SetParent_CV (unsigned long val_parent_CV) { Parent_CV = val_parent_CV; Agglomerate = true; }
+
+inline void CPoint::SetGridVel(su2double *val_gridvel) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ GridVel[iDim] = val_gridvel[iDim];
+}
+
+inline void CPoint::SetVolume_n (void) { Volume[1] = Volume[0]; }
+
+inline void CPoint::SetVolume_nM1 (void) { Volume[2] = Volume[1]; }
+
+inline su2double CPoint::GetVolume_n (void) { return Volume[1]; }
+
+inline su2double CPoint::GetVolume_nM1 (void) { return Volume[2]; }
+
+inline void CPoint::SetCoord_n (void) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_n[iDim] = Coord[iDim];
+}
+
+inline void CPoint::SetCoord_n1 (void) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_n1[iDim] = Coord_n[iDim];
+}
+
+inline void CPoint::SetCoord_p1(su2double *val_coord) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_p1[iDim] = val_coord[iDim];
+}
+
+inline su2double *CPoint::GetCoord_n (void) { return Coord_n; }
+
+inline su2double *CPoint::GetCoord_n1 (void) { return Coord_n1; }
+
+inline su2double *CPoint::GetCoord_p1 (void) { return Coord_p1; }
+
+inline void CPoint::SetColor(unsigned short val_color) { color = val_color; }
+
+inline void CPoint::SetnNeighbor(unsigned short val_nneighbor) { nNeighbor = val_nneighbor; }
+
+inline unsigned short CPoint::GetnNeighbor(void) { return nNeighbor; }
+
+inline unsigned short CPoint::GetColor(void) { return color; }
+
+inline unsigned long CPoint::GetGlobalIndex(void) { return GlobalIndex; }
+
+inline void CPoint::SetGlobalIndex(unsigned long val_globalindex) { GlobalIndex = val_globalindex; }
+
+inline void CPoint::SetDomain(bool val_domain) { Domain = val_domain; }
+
+inline bool CPoint::GetDomain(void) { return Domain; }
+
+inline void CPoint::SetWall_Distance(su2double val_distance) { Wall_Distance = val_distance; }
+
+inline void CPoint::SetCurvature(su2double val_curvature) { Curvature = val_curvature; }
+
+inline void CPoint::SetSharpEdge_Distance(su2double val_distance) { SharpEdge_Distance = val_distance; }
+
+inline su2double CPoint::GetWall_Distance(void) { return Wall_Distance; }
+
+inline su2double CPoint::GetCurvature(void) { return Curvature; }
+
+inline su2double CPoint::GetSharpEdge_Distance(void) { return SharpEdge_Distance; }
+
+inline void CPoint::SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_FaceElem_CG, su2double *val_coord_Elem_CG) { }
+
+inline void CPoint::SetNodes_Coord(su2double *val_coord_Edge_CG, su2double *val_coord_Elem_CG) { }
+
+inline void CPoint::GetNormal(su2double *val_normal) { }
+
+inline su2double *CPoint::GetNormal(void) { return 0; }
+
+inline void CPoint::SetNormal(su2double *val_face_normal) { }
+
+inline void CPoint::SetZeroValues(void) { }
+
+inline void CPoint::AddNormal(su2double *val_face_normal) { }
+
+inline unsigned short CEdge::GetnNodes() { return 2; }
+
+inline unsigned long CEdge::GetNode(unsigned short val_node) { return Nodes[val_node]; }
+
+inline su2double CEdge::GetCG(unsigned short val_dim) { return Coord_CG[val_dim]; }
+
+inline su2double *CEdge::GetNormal(void) { return Normal; }
+
+inline void CEdge::GetNormal(su2double *val_normal) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ val_normal[iDim] = Normal[iDim];
+}
+
+inline void CEdge::SetNormal(su2double *val_face_normal) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Normal[iDim]=val_face_normal[iDim];
+}
+
+inline void CEdge::AddNormal(su2double *val_face_normal) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Normal[iDim] += val_face_normal[iDim];
+}
+
+inline void CEdge::SetZeroValues(void) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim ++)
+ Normal[iDim] = 0.0;
+}
+
+inline su2double *CEdge::GetCoord(void) { return NULL; }
+
+inline void CEdge::SetCoord(su2double *val_coord) { }
+
+inline unsigned short CVertex::GetnNodes() { return 1; }
+
+inline unsigned long CVertex::GetNode() { return Nodes[0]; }
+
+inline su2double *CVertex::GetNormal(void) { return Normal; }
+
+inline su2double *CVertex::GetVarCoord(void) { return VarCoord; }
+
+inline su2double *CVertex::GetCoord(void) { return CartCoord; }
+
+inline su2double CVertex::GetCoord(unsigned short val_dim) { return CartCoord[val_dim]; }
+
+inline void CVertex::SetAuxVar(su2double val_auxvar) { Aux_Var = val_auxvar; }
+
+inline void CVertex::AddAuxVar(su2double val_auxvar) { Aux_Var += val_auxvar; }
+
+inline su2double CVertex::GetAuxVar(void) { return Aux_Var; }
+
+inline void CVertex::GetNormal(su2double *val_normal) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ val_normal[iDim] = Normal[iDim];
+}
+
+inline void CVertex::SetNormal(su2double *val_face_normal) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Normal[iDim]=val_face_normal[iDim];
+}
+
+inline void CVertex::SetVarCoord(su2double *val_varcoord) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ VarCoord[iDim] = val_varcoord[iDim];
+}
+
+inline void CVertex::AddVarCoord(su2double *val_varcoord) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ VarCoord[iDim] += val_varcoord[iDim];
+}
+
+inline void CVertex::SetCoord(su2double *val_coord) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ CartCoord[iDim] = val_coord[iDim];
+}
+
+inline void CVertex::SetRotation_Type(short val_rotation_type) { Rotation_Type = val_rotation_type; }
+
+inline short CVertex::GetRotation_Type(void) { return Rotation_Type; }
+
+inline void CVertex::SetDonorPoint(long val_periodicpoint, long val_processor) {
+ PeriodicPoint[0] = val_periodicpoint;
+ PeriodicPoint[1] = val_processor;
+}
+
+inline void CVertex::SetDonorElem(long val_donorelem) { Donor_Elem = val_donorelem; }
+
+inline long CVertex::GetDonorElem(void) { return Donor_Elem; }
+
+inline long CVertex::GetDonorPoint(void) { return PeriodicPoint[0]; }
+
+inline long CVertex::GetDonorProcessor(void) { return PeriodicPoint[1]; }
+
+inline void CVertex::SetBasisFunction(unsigned short val_node, su2double val_basis) { Basis_Function[val_node] = val_basis; }
+
+inline su2double CVertex::GetBasisFunction(unsigned short val_node) { return Basis_Function[val_node]; }
+
+inline long *CVertex::GetPeriodicPointDomain(void) { return PeriodicPoint; }
+
+inline void CVertex::SetZeroValues(void) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim ++)
+ Normal[iDim] = 0.0;
+}
+
+inline unsigned long CVertex::GetNormal_Neighbor(void) { return Normal_Neighbor; }
+
+inline void CVertex::SetNormal_Neighbor(unsigned long val_Normal_Neighbor) { Normal_Neighbor = val_Normal_Neighbor; }
+
+
diff --git a/Common/include/geometry_structure.inl b/Common/include/geometry_structure.inl
index 026bf638c11..b17c48e909f 100644
--- a/Common/include/geometry_structure.inl
+++ b/Common/include/geometry_structure.inl
@@ -1,293 +1,293 @@
-/*!
- * \file geometry_structure.inl
- * \brief In-Line subroutines of the geometry_structure.hpp file.
- * \author F. Palacios, T. Economon
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-inline long CGeometry::GetGlobal_to_Local_Point(long val_ipoint) { return 0; }
-
-inline unsigned short CGeometry::GetGlobal_to_Local_Marker(unsigned short val_imarker) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nPoint(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nPointDomain(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElem(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemLine(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemTria(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemQuad(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemTetr(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemHexa(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemPris(void) { return 0; }
-
-inline unsigned long CGeometry::GetGlobal_nElemPyra(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemLine(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemTria(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemQuad(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemTetr(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemHexa(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemPris(void) { return 0; }
-
-inline unsigned long CGeometry::GetnElemPyra(void) { return 0; }
-
-inline void CGeometry::Check_IntElem_Orientation(CConfig *config) { }
-
-inline void CGeometry::Check_BoundElem_Orientation(CConfig *config) { }
-
-inline void CGeometry::SetColorGrid(CConfig *config) { }
-
-inline void CGeometry::SetColorGrid_Parallel(CConfig *config) { }
-
-inline void CGeometry::DivideConnectivity(CConfig *config, unsigned short Elem_Type) { }
-
-inline void CGeometry::SetRotationalVelocity(CConfig *config, unsigned short val_iZone) { }
-
-inline void CGeometry::SetTranslationalVelocity(CConfig *config) { }
-
-inline void CGeometry::SetGridVelocity(CConfig *config, unsigned long iter) { }
-
-inline void CGeometry::SetRestricted_GridVelocity(CGeometry *fine_mesh, CConfig *config) { }
-
-inline void CGeometry::Set_MPI_Coord(CConfig *config) { }
-
-inline void CGeometry::Set_MPI_GridVel(CConfig *config) { }
-
-inline void CGeometry::SetPeriodicBoundary(CConfig *config) { }
-
-inline void CGeometry::SetPeriodicBoundary(CGeometry *geometry, CConfig *config) { }
-
-inline void CGeometry::SetSendReceive(CConfig *config) { }
-
-inline void CGeometry::SetBoundaries(CConfig *config) { }
-
-inline void CGeometry::ComputeWall_Distance(CConfig *config) { }
-
-inline void CGeometry::SetPositive_ZArea(CConfig *config) { }
-
-inline void CGeometry::SetPoint_Connectivity(void) { }
-
-inline void CGeometry::SetRCM_Ordering(CConfig *config) { }
-
-inline void CGeometry::SetCoord_Smoothing (unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig *config) { }
-
-inline void CGeometry::SetCoord(CGeometry *geometry) { }
-
-inline void CGeometry::SetPoint_Connectivity(CGeometry *fine_grid) { }
-
-inline void CGeometry::SetElement_Connectivity(void) { }
-
-inline unsigned long CGeometry::GetnPoint(void) { return nPoint; }
-
-inline unsigned long CGeometry::GetnPointDomain(void) { return nPointDomain; }
-
-inline unsigned long CGeometry::GetnElem(void) { return nElem; }
-
-inline unsigned short CGeometry::GetnDim(void) { return nDim; }
-
-inline unsigned short CGeometry::GetnZone(void) { return nZone; }
-
-inline unsigned short CGeometry::GetnMarker(void) { return nMarker; }
-
-inline string CGeometry::GetMarker_Tag(unsigned short val_marker) { return Tag_to_Marker[val_marker]; }
-
-inline unsigned long CGeometry::GetMax_GlobalPoint(void) { return Max_GlobalPoint; }
-
-inline void CGeometry::SetnMarker(unsigned short val_nmarker) { nMarker = val_nmarker; }
-
-inline void CGeometry::SetnElem_Bound(unsigned short val_marker, unsigned long val_nelem_bound) { nElem_Bound[val_marker]= val_nelem_bound; }
-
-inline unsigned long CGeometry::GetnElem_Bound(unsigned short val_marker) { return nElem_Bound[val_marker]; }
-
-inline void CGeometry::SetMarker_Tag(unsigned short val_marker, string val_index) { Tag_to_Marker[val_marker] = val_index; }
-
-inline void CGeometry::SetnPoint(unsigned long val_npoint) { nPoint = val_npoint; }
-
-inline void CGeometry::SetnPointDomain(unsigned long val_npoint) { nPointDomain = val_npoint; }
-
-inline void CGeometry::SetnElem(unsigned long val_nelem) { nElem = val_nelem; }
-
-inline void CGeometry::SetnDim(unsigned short val_nDim) { nDim = val_nDim; }
-
-inline unsigned long CGeometry::GetnVertex(unsigned short val_marker) { return nVertex[val_marker]; }
-
-inline unsigned long CGeometry::GetnEdge(void) { return nEdge; }
-
-inline bool CGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short &face_first_elem, unsigned short &face_second_elem) {return 0;}
-
-inline void CGeometry::SetBoundVolume(void) { }
-
-inline void CGeometry::SetVertex(void) { }
-
-inline void CGeometry::SetVertex(CConfig *config) { }
-
-inline void CGeometry::SetVertex(CGeometry *fine_grid, CConfig *config) { }
-
-inline void CGeometry::SetCoord_CG(void) { }
-
-inline void CGeometry::SetControlVolume(CConfig *config, unsigned short action) { }
-
-inline void CGeometry::SetControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) { }
-
-inline void CGeometry::VisualizeControlVolume(CConfig *config, unsigned short action) { }
-
-inline void CGeometry::MatchNearField(CConfig *config) { }
-
-inline void CGeometry::MatchActuator_Disk(CConfig *config) { }
-
-inline void CGeometry::MatchInterface(CConfig *config) { }
-
-inline void CGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, unsigned short val_iZone, unsigned short val_nZone) { }
-
-inline void CGeometry::SetBoundControlVolume(CConfig *config, unsigned short action) { }
-
-inline void CGeometry::SetBoundControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) { }
-
-inline void CGeometry::SetTecPlot(char config_filename[MAX_STRING_SIZE], bool new_file) { }
-
-inline void CGeometry::SetMeshFile(CConfig *config, string val_mesh_out_filename) { }
-
-inline void CGeometry::SetMeshFile(CGeometry *geometry, CConfig *config, string val_mesh_out_filename) { }
-
-inline void CGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) { }
-
-inline void CGeometry::SetBoundSTL(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) { }
-
-inline su2double CGeometry::Compute_MaxThickness(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
-
-inline su2double CGeometry::Compute_AoA(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
-
-inline su2double CGeometry::Compute_Chord(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
-
-inline su2double CGeometry::Compute_Thickness(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, su2double Location, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
-
-inline su2double CGeometry::Compute_Area(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
-
-inline su2double CGeometry::Compute_Volume(CConfig *config, bool original_surface) { return 0; }
-
-inline void CGeometry::FindNormal_Neighbor(CConfig *config) { }
-
-inline void CGeometry::SetBoundSensitivity(CConfig *config) { }
-
-inline void CPhysicalGeometry::SetPoint_Connectivity(CGeometry *geometry) { CGeometry::SetPoint_Connectivity(geometry); }
-
-inline void CMultiGridGeometry::SetPoint_Connectivity(void) { CGeometry::SetPoint_Connectivity(); }
-
-inline long CPhysicalGeometry::GetGlobal_to_Local_Point(long val_ipoint) { return Global_to_Local_Point[val_ipoint]; }
-
-inline unsigned short CPhysicalGeometry::GetGlobal_to_Local_Marker(unsigned short val_imarker) { return Global_to_Local_Marker[val_imarker]; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nPoint(void) { return Global_nPoint; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nPointDomain(void) { return Global_nPointDomain; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElem(void) { return Global_nElem; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemLine(void) { return Global_nelem_edge; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemTria(void) { return Global_nelem_triangle; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemQuad(void) { return Global_nelem_quad; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemTetr(void) { return Global_nelem_tetra; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemHexa(void) { return Global_nelem_hexa; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemPris(void) { return Global_nelem_prism; }
-
-inline unsigned long CPhysicalGeometry::GetGlobal_nElemPyra(void) { return Global_nelem_pyramid; }
-
-inline unsigned long CPhysicalGeometry::GetnElemLine(void) { return nelem_edge; }
-
-inline unsigned long CPhysicalGeometry::GetnElemTria(void) { return nelem_triangle; }
-
-inline unsigned long CPhysicalGeometry::GetnElemQuad(void) { return nelem_quad; }
-
-inline unsigned long CPhysicalGeometry::GetnElemTetr(void) { return nelem_tetra; }
-
-inline unsigned long CPhysicalGeometry::GetnElemHexa(void) { return nelem_hexa; }
-
-inline unsigned long CPhysicalGeometry::GetnElemPris(void) { return nelem_prism; }
-
-inline unsigned long CPhysicalGeometry::GetnElemPyra(void) { return nelem_pyramid; }
-
-inline void CGeometry::SetGeometryPlanes(CConfig *config) {}
-
-inline vector CGeometry::GetGeometryPlanes() { return XCoordList; }
-
-inline vector CPhysicalGeometry::GetGeometryPlanes() { return XCoordList; }
-
-inline vector CMultiGridGeometry::GetGeometryPlanes() { return XCoordList; }
-
-inline vector > CGeometry::GetXCoord() { return Xcoord_plane; }
-
-inline vector > CPhysicalGeometry::GetXCoord() { return Xcoord_plane; }
-
-inline vector > CMultiGridGeometry::GetXCoord() { return Xcoord_plane; }
-
-inline vector > CGeometry::GetYCoord() { return Ycoord_plane; }
-
-inline vector > CPhysicalGeometry::GetYCoord() { return Ycoord_plane; }
-
-inline vector > CMultiGridGeometry::GetYCoord() { return Ycoord_plane; }
-
-inline vector > CGeometry::GetZCoord() { return Zcoord_plane; }
-
-inline vector > CPhysicalGeometry::GetZCoord() { return Zcoord_plane; }
-
-inline vector > CMultiGridGeometry::GetZCoord() { return Zcoord_plane; }
-
-
-inline vector > CGeometry::GetPlanarPoints() { return Plane_points; }
-
-inline vector > CPhysicalGeometry::GetPlanarPoints() { return Plane_points; }
-
-inline vector > CMultiGridGeometry::GetPlanarPoints() { return Plane_points; }
-
-inline void CGeometry::SetSensitivity(CConfig* config){}
-
-inline su2double CGeometry::GetSensitivity(unsigned long iPoint, unsigned short iDim){return 0.0;}
-
-inline su2double CPhysicalGeometry::GetSensitivity(unsigned long iPoint, unsigned short iDim){return Sensitivity[iPoint*nDim+iDim];}
-
-inline void CGeometry::SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val){}
-
-inline void CPhysicalGeometry::SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val){Sensitivity[iPoint*nDim+iDim] = val;}
+/*!
+ * \file geometry_structure.inl
+ * \brief In-Line subroutines of the geometry_structure.hpp file.
+ * \author F. Palacios, T. Economon
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+inline long CGeometry::GetGlobal_to_Local_Point(long val_ipoint) { return 0; }
+
+inline unsigned short CGeometry::GetGlobal_to_Local_Marker(unsigned short val_imarker) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nPoint(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nPointDomain(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElem(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemLine(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemTria(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemQuad(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemTetr(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemHexa(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemPris(void) { return 0; }
+
+inline unsigned long CGeometry::GetGlobal_nElemPyra(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemLine(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemTria(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemQuad(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemTetr(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemHexa(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemPris(void) { return 0; }
+
+inline unsigned long CGeometry::GetnElemPyra(void) { return 0; }
+
+inline void CGeometry::Check_IntElem_Orientation(CConfig *config) { }
+
+inline void CGeometry::Check_BoundElem_Orientation(CConfig *config) { }
+
+inline void CGeometry::SetColorGrid(CConfig *config) { }
+
+inline void CGeometry::SetColorGrid_Parallel(CConfig *config) { }
+
+inline void CGeometry::DivideConnectivity(CConfig *config, unsigned short Elem_Type) { }
+
+inline void CGeometry::SetRotationalVelocity(CConfig *config, unsigned short val_iZone) { }
+
+inline void CGeometry::SetTranslationalVelocity(CConfig *config) { }
+
+inline void CGeometry::SetGridVelocity(CConfig *config, unsigned long iter) { }
+
+inline void CGeometry::SetRestricted_GridVelocity(CGeometry *fine_mesh, CConfig *config) { }
+
+inline void CGeometry::Set_MPI_Coord(CConfig *config) { }
+
+inline void CGeometry::Set_MPI_GridVel(CConfig *config) { }
+
+inline void CGeometry::SetPeriodicBoundary(CConfig *config) { }
+
+inline void CGeometry::SetPeriodicBoundary(CGeometry *geometry, CConfig *config) { }
+
+inline void CGeometry::SetSendReceive(CConfig *config) { }
+
+inline void CGeometry::SetBoundaries(CConfig *config) { }
+
+inline void CGeometry::ComputeWall_Distance(CConfig *config) { }
+
+inline void CGeometry::SetPositive_ZArea(CConfig *config) { }
+
+inline void CGeometry::SetPoint_Connectivity(void) { }
+
+inline void CGeometry::SetRCM_Ordering(CConfig *config) { }
+
+inline void CGeometry::SetCoord_Smoothing (unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig *config) { }
+
+inline void CGeometry::SetCoord(CGeometry *geometry) { }
+
+inline void CGeometry::SetPoint_Connectivity(CGeometry *fine_grid) { }
+
+inline void CGeometry::SetElement_Connectivity(void) { }
+
+inline unsigned long CGeometry::GetnPoint(void) { return nPoint; }
+
+inline unsigned long CGeometry::GetnPointDomain(void) { return nPointDomain; }
+
+inline unsigned long CGeometry::GetnElem(void) { return nElem; }
+
+inline unsigned short CGeometry::GetnDim(void) { return nDim; }
+
+inline unsigned short CGeometry::GetnZone(void) { return nZone; }
+
+inline unsigned short CGeometry::GetnMarker(void) { return nMarker; }
+
+inline string CGeometry::GetMarker_Tag(unsigned short val_marker) { return Tag_to_Marker[val_marker]; }
+
+inline unsigned long CGeometry::GetMax_GlobalPoint(void) { return Max_GlobalPoint; }
+
+inline void CGeometry::SetnMarker(unsigned short val_nmarker) { nMarker = val_nmarker; }
+
+inline void CGeometry::SetnElem_Bound(unsigned short val_marker, unsigned long val_nelem_bound) { nElem_Bound[val_marker]= val_nelem_bound; }
+
+inline unsigned long CGeometry::GetnElem_Bound(unsigned short val_marker) { return nElem_Bound[val_marker]; }
+
+inline void CGeometry::SetMarker_Tag(unsigned short val_marker, string val_index) { Tag_to_Marker[val_marker] = val_index; }
+
+inline void CGeometry::SetnPoint(unsigned long val_npoint) { nPoint = val_npoint; }
+
+inline void CGeometry::SetnPointDomain(unsigned long val_npoint) { nPointDomain = val_npoint; }
+
+inline void CGeometry::SetnElem(unsigned long val_nelem) { nElem = val_nelem; }
+
+inline void CGeometry::SetnDim(unsigned short val_nDim) { nDim = val_nDim; }
+
+inline unsigned long CGeometry::GetnVertex(unsigned short val_marker) { return nVertex[val_marker]; }
+
+inline unsigned long CGeometry::GetnEdge(void) { return nEdge; }
+
+inline bool CGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short &face_first_elem, unsigned short &face_second_elem) {return 0;}
+
+inline void CGeometry::SetBoundVolume(void) { }
+
+inline void CGeometry::SetVertex(void) { }
+
+inline void CGeometry::SetVertex(CConfig *config) { }
+
+inline void CGeometry::SetVertex(CGeometry *fine_grid, CConfig *config) { }
+
+inline void CGeometry::SetCoord_CG(void) { }
+
+inline void CGeometry::SetControlVolume(CConfig *config, unsigned short action) { }
+
+inline void CGeometry::SetControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) { }
+
+inline void CGeometry::VisualizeControlVolume(CConfig *config, unsigned short action) { }
+
+inline void CGeometry::MatchNearField(CConfig *config) { }
+
+inline void CGeometry::MatchActuator_Disk(CConfig *config) { }
+
+inline void CGeometry::MatchInterface(CConfig *config) { }
+
+inline void CGeometry::MatchZone(CConfig *config, CGeometry *geometry_donor, CConfig *config_donor, unsigned short val_iZone, unsigned short val_nZone) { }
+
+inline void CGeometry::SetBoundControlVolume(CConfig *config, unsigned short action) { }
+
+inline void CGeometry::SetBoundControlVolume(CConfig *config, CGeometry *geometry, unsigned short action) { }
+
+inline void CGeometry::SetTecPlot(char config_filename[MAX_STRING_SIZE], bool new_file) { }
+
+inline void CGeometry::SetMeshFile(CConfig *config, string val_mesh_out_filename) { }
+
+inline void CGeometry::SetMeshFile(CGeometry *geometry, CConfig *config, string val_mesh_out_filename) { }
+
+inline void CGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) { }
+
+inline void CGeometry::SetBoundSTL(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) { }
+
+inline su2double CGeometry::Compute_MaxThickness(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
+
+inline su2double CGeometry::Compute_AoA(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
+
+inline su2double CGeometry::Compute_Chord(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
+
+inline su2double CGeometry::Compute_Thickness(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, su2double Location, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
+
+inline su2double CGeometry::Compute_Area(su2double *Plane_P0, su2double *Plane_Normal, unsigned short iSection, CConfig *config, vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, bool original_surface) { return 0; }
+
+inline su2double CGeometry::Compute_Volume(CConfig *config, bool original_surface) { return 0; }
+
+inline void CGeometry::FindNormal_Neighbor(CConfig *config) { }
+
+inline void CGeometry::SetBoundSensitivity(CConfig *config) { }
+
+inline void CPhysicalGeometry::SetPoint_Connectivity(CGeometry *geometry) { CGeometry::SetPoint_Connectivity(geometry); }
+
+inline void CMultiGridGeometry::SetPoint_Connectivity(void) { CGeometry::SetPoint_Connectivity(); }
+
+inline long CPhysicalGeometry::GetGlobal_to_Local_Point(long val_ipoint) { return Global_to_Local_Point[val_ipoint]; }
+
+inline unsigned short CPhysicalGeometry::GetGlobal_to_Local_Marker(unsigned short val_imarker) { return Global_to_Local_Marker[val_imarker]; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nPoint(void) { return Global_nPoint; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nPointDomain(void) { return Global_nPointDomain; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElem(void) { return Global_nElem; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemLine(void) { return Global_nelem_edge; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemTria(void) { return Global_nelem_triangle; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemQuad(void) { return Global_nelem_quad; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemTetr(void) { return Global_nelem_tetra; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemHexa(void) { return Global_nelem_hexa; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemPris(void) { return Global_nelem_prism; }
+
+inline unsigned long CPhysicalGeometry::GetGlobal_nElemPyra(void) { return Global_nelem_pyramid; }
+
+inline unsigned long CPhysicalGeometry::GetnElemLine(void) { return nelem_edge; }
+
+inline unsigned long CPhysicalGeometry::GetnElemTria(void) { return nelem_triangle; }
+
+inline unsigned long CPhysicalGeometry::GetnElemQuad(void) { return nelem_quad; }
+
+inline unsigned long CPhysicalGeometry::GetnElemTetr(void) { return nelem_tetra; }
+
+inline unsigned long CPhysicalGeometry::GetnElemHexa(void) { return nelem_hexa; }
+
+inline unsigned long CPhysicalGeometry::GetnElemPris(void) { return nelem_prism; }
+
+inline unsigned long CPhysicalGeometry::GetnElemPyra(void) { return nelem_pyramid; }
+
+inline void CGeometry::SetGeometryPlanes(CConfig *config) {}
+
+inline vector CGeometry::GetGeometryPlanes() { return XCoordList; }
+
+inline vector CPhysicalGeometry::GetGeometryPlanes() { return XCoordList; }
+
+inline vector CMultiGridGeometry::GetGeometryPlanes() { return XCoordList; }
+
+inline vector > CGeometry::GetXCoord() { return Xcoord_plane; }
+
+inline vector > CPhysicalGeometry::GetXCoord() { return Xcoord_plane; }
+
+inline vector > CMultiGridGeometry::GetXCoord() { return Xcoord_plane; }
+
+inline vector > CGeometry::GetYCoord() { return Ycoord_plane; }
+
+inline vector > CPhysicalGeometry::GetYCoord() { return Ycoord_plane; }
+
+inline vector > CMultiGridGeometry::GetYCoord() { return Ycoord_plane; }
+
+inline vector > CGeometry::GetZCoord() { return Zcoord_plane; }
+
+inline vector > CPhysicalGeometry::GetZCoord() { return Zcoord_plane; }
+
+inline vector > CMultiGridGeometry::GetZCoord() { return Zcoord_plane; }
+
+
+inline vector > CGeometry::GetPlanarPoints() { return Plane_points; }
+
+inline vector > CPhysicalGeometry::GetPlanarPoints() { return Plane_points; }
+
+inline vector > CMultiGridGeometry::GetPlanarPoints() { return Plane_points; }
+
+inline void CGeometry::SetSensitivity(CConfig* config){}
+
+inline su2double CGeometry::GetSensitivity(unsigned long iPoint, unsigned short iDim){return 0.0;}
+
+inline su2double CPhysicalGeometry::GetSensitivity(unsigned long iPoint, unsigned short iDim){return Sensitivity[iPoint*nDim+iDim];}
+
+inline void CGeometry::SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val){}
+
+inline void CPhysicalGeometry::SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val){Sensitivity[iPoint*nDim+iDim] = val;}
diff --git a/Common/include/grid_adaptation_structure.hpp b/Common/include/grid_adaptation_structure.hpp
index 25eb788f4f5..aa91192ea38 100644
--- a/Common/include/grid_adaptation_structure.hpp
+++ b/Common/include/grid_adaptation_structure.hpp
@@ -1,345 +1,345 @@
-/*!
- * \file grid_adaptation_structure.hpp
- * \brief Headers of the main subroutines for doing the numerical grid
- * adaptation.
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-#include "./mpi_structure.hpp"
-
-#include
-#include
-#include
-#include
-
-#include "geometry_structure.hpp"
-#include "config_structure.hpp"
-
-using namespace std;
-
-/*!
- * \class CGridAdaptation
- * \brief Parent class for defining the grid adaptation.
- * \author F. Palacios
- * \version 2.0.7
- */
-class CGridAdaptation {
-protected:
- unsigned long nPoint_new, /*!< \brief Number of new points. */
- nElem_new; /*!< \brief Number of new elements. */
- unsigned short nDim, /*!< \brief Number of dimensions of the problem. */
- nVar; /*!< \brief Number of variables in the problem. */
- su2double **ConsVar_Sol, /*!< \brief Conservative variables (original solution). */
- **ConsVar_Res, /*!< \brief Conservative variables (residual). */
- **ConsVar_Adapt; /*!< \brief Conservative variables (adapted solution). */
- su2double **AdjVar_Sol, /*!< \brief Adjoint variables (original solution). */
- **AdjVar_Res, /*!< \brief Adjoint variables (residual). */
- **AdjVar_Adapt; /*!< \brief Adjoint variables (adapted solution). */
- su2double **LinVar_Sol, /*!< \brief Linear variables (original solution). */
- **LinVar_Res, /*!< \brief Linear variables (residual). */
- **LinVar_Adapt; /*!< \brief Linear variables (adapted solution). */
- su2double **Gradient, /*!< \brief Gradient value. */
- **Gradient_Flow, /*!< \brief Gradient of the flow variables. */
- **Gradient_Adj; /*!< \brief Fradient of the adjoint variables. */
- su2double *Index; /*!< \brief Adaptation index (indicates the value of the adaptation). */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- CGridAdaptation(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CGridAdaptation(void);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void GetFlowSolution(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void GetFlowResidual(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void GetAdjSolution(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void GetAdjResidual(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Do a complete adaptation of the computational grid.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] strength - Adaptation Strength.
- */
- void SetComplete_Refinement(CGeometry *geometry, unsigned short strength);
-
- /*!
- * \brief Do not do any kind of adaptation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] strength - Adaptation Strength.
- */
- void SetNo_Refinement(CGeometry *geometry, unsigned short strength);
-
- /*!
- * \brief Do an adaptation of the computational grid on the wake.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] strength - Adaptation Strength.
- */
- void SetWake_Refinement(CGeometry *geometry, unsigned short strength);
-
- /*!
- * \brief Do an adaptation of the computational grid on the supersonic shock region.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetSupShock_Refinement(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Do an adaptation of the computational grid on a near field boundary.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetNearField_Refinement(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Do a complete adaptation of the computational grid using a homothetic technique (2D).
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] geo_adapt - Geometrical definition of the adapted grid.
- * \param[in] config - Definition of the particular problem.
- */
- void SetHomothetic_Adaptation2D(CGeometry *geometry, CPhysicalGeometry *geo_adapt, CConfig *config);
-
- /*!
- * \brief Do a complete adaptation of the computational grid using a homothetic technique (3D).
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] geo_adapt - Geometrical definition of the adapted grid.
- * \param[in] config - Definition of the particular problem.
- */
- void SetHomothetic_Adaptation3D(CGeometry *geometry, CPhysicalGeometry *geo_adapt, CConfig *config);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckTriangleCode(bool *AdaptCode);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckRectCode(bool *AdaptCode);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckRectExtCode(bool *AdaptCode);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckTetraCode(bool *AdaptCode);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckHexaCode(bool *AdaptCode);
-
- /*!
- * \brief Find the adaptation code for each element in the fine grid.
- * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
- * \return Adaptation code for the element.
- */
- long CheckPyramCode(bool *AdaptCode);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void TriangleDivision(long code, long *nodes, long *edges, long **Division, long *nPart);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void RectDivision(long code, long *nodes, long **Division, long *nPart);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void RectExtDivision(long code, long *nodes, long **Division, long *nPart);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void TetraDivision(long code, long *nodes, long *edges, long **Division, long *nPart);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void HexaDivision(long code, long *nodes, long **Division, long *nPart);
-
- /*!
- * \brief Division pattern of the element.
- * \param[in] code - number that identify the division.
- * \param[in] nodes - Nodes that compose the element, including new nodes.
- * \param[in] edges - Edges that compose the element.
- * \param[out] Division - Division pattern.
- * \param[out] nPart - Number of new elements after the division.
- */
- void PyramDivision(long code, long *nodes, long **Division, long *nPart);
-
- /*!
- * \brief Do a complete adaptation of the computational grid.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] strength _________________________.
- */
- void SetIndicator_Flow(CGeometry *geometry, CConfig *config, unsigned short strength);
-
- /*!
- * \brief Do a complete adaptation of the computational grid.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] strength _________________________.
- */
- void SetIndicator_Adj(CGeometry *geometry, CConfig *config, unsigned short strength);
-
- /*!
- * \brief Do a complete adaptation of the computational grid.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetIndicator_FlowAdj(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetIndicator_Robust(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetIndicator_Computable(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetIndicator_Computable_Robust(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Write the restart file with the adapted grid.
- * \param[in] config - Definition of the particular problem.
- * \param[in] mesh_flowfilename - _________________________.
- */
- void SetRestart_FlowSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_flowfilename);
-
- /*!
- * \brief Write the restart file with the adapted grid.
- * \param[in] config - Definition of the particular problem.
- * \param[in] mesh_adjfilename - _________________________.
- */
- void SetRestart_AdjSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_adjfilename);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] config - Definition of the particular problem.
- * \param[in] mesh_linfilename - _________________________.
- */
- void SetRestart_LinSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_linfilename);
-
- /*!
- * \brief Read the flow solution from the restart file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] max_elem - _________________________.
- */
- void SetSensorElem(CGeometry *geometry, CConfig *config, unsigned long max_elem);
-
-};
-
-#include "grid_adaptation_structure.inl"
-
-
+/*!
+ * \file grid_adaptation_structure.hpp
+ * \brief Headers of the main subroutines for doing the numerical grid
+ * adaptation.
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+#include "./mpi_structure.hpp"
+
+#include
+#include
+#include
+#include
+
+#include "geometry_structure.hpp"
+#include "config_structure.hpp"
+
+using namespace std;
+
+/*!
+ * \class CGridAdaptation
+ * \brief Parent class for defining the grid adaptation.
+ * \author F. Palacios
+ * \version 2.0.7
+ */
+class CGridAdaptation {
+protected:
+ unsigned long nPoint_new, /*!< \brief Number of new points. */
+ nElem_new; /*!< \brief Number of new elements. */
+ unsigned short nDim, /*!< \brief Number of dimensions of the problem. */
+ nVar; /*!< \brief Number of variables in the problem. */
+ su2double **ConsVar_Sol, /*!< \brief Conservative variables (original solution). */
+ **ConsVar_Res, /*!< \brief Conservative variables (residual). */
+ **ConsVar_Adapt; /*!< \brief Conservative variables (adapted solution). */
+ su2double **AdjVar_Sol, /*!< \brief Adjoint variables (original solution). */
+ **AdjVar_Res, /*!< \brief Adjoint variables (residual). */
+ **AdjVar_Adapt; /*!< \brief Adjoint variables (adapted solution). */
+ su2double **LinVar_Sol, /*!< \brief Linear variables (original solution). */
+ **LinVar_Res, /*!< \brief Linear variables (residual). */
+ **LinVar_Adapt; /*!< \brief Linear variables (adapted solution). */
+ su2double **Gradient, /*!< \brief Gradient value. */
+ **Gradient_Flow, /*!< \brief Gradient of the flow variables. */
+ **Gradient_Adj; /*!< \brief Fradient of the adjoint variables. */
+ su2double *Index; /*!< \brief Adaptation index (indicates the value of the adaptation). */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ CGridAdaptation(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CGridAdaptation(void);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void GetFlowSolution(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void GetFlowResidual(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void GetAdjSolution(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void GetAdjResidual(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] strength - Adaptation Strength.
+ */
+ void SetComplete_Refinement(CGeometry *geometry, unsigned short strength);
+
+ /*!
+ * \brief Do not do any kind of adaptation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] strength - Adaptation Strength.
+ */
+ void SetNo_Refinement(CGeometry *geometry, unsigned short strength);
+
+ /*!
+ * \brief Do an adaptation of the computational grid on the wake.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] strength - Adaptation Strength.
+ */
+ void SetWake_Refinement(CGeometry *geometry, unsigned short strength);
+
+ /*!
+ * \brief Do an adaptation of the computational grid on the supersonic shock region.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetSupShock_Refinement(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Do an adaptation of the computational grid on a near field boundary.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetNearField_Refinement(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid using a homothetic technique (2D).
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] geo_adapt - Geometrical definition of the adapted grid.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetHomothetic_Adaptation2D(CGeometry *geometry, CPhysicalGeometry *geo_adapt, CConfig *config);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid using a homothetic technique (3D).
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] geo_adapt - Geometrical definition of the adapted grid.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetHomothetic_Adaptation3D(CGeometry *geometry, CPhysicalGeometry *geo_adapt, CConfig *config);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckTriangleCode(bool *AdaptCode);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckRectCode(bool *AdaptCode);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckRectExtCode(bool *AdaptCode);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckTetraCode(bool *AdaptCode);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckHexaCode(bool *AdaptCode);
+
+ /*!
+ * \brief Find the adaptation code for each element in the fine grid.
+ * \param[in] AdaptCode - Edge combination to stablish the right elemeent division.
+ * \return Adaptation code for the element.
+ */
+ long CheckPyramCode(bool *AdaptCode);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void TriangleDivision(long code, long *nodes, long *edges, long **Division, long *nPart);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void RectDivision(long code, long *nodes, long **Division, long *nPart);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void RectExtDivision(long code, long *nodes, long **Division, long *nPart);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void TetraDivision(long code, long *nodes, long *edges, long **Division, long *nPart);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void HexaDivision(long code, long *nodes, long **Division, long *nPart);
+
+ /*!
+ * \brief Division pattern of the element.
+ * \param[in] code - number that identify the division.
+ * \param[in] nodes - Nodes that compose the element, including new nodes.
+ * \param[in] edges - Edges that compose the element.
+ * \param[out] Division - Division pattern.
+ * \param[out] nPart - Number of new elements after the division.
+ */
+ void PyramDivision(long code, long *nodes, long **Division, long *nPart);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] strength _________________________.
+ */
+ void SetIndicator_Flow(CGeometry *geometry, CConfig *config, unsigned short strength);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] strength _________________________.
+ */
+ void SetIndicator_Adj(CGeometry *geometry, CConfig *config, unsigned short strength);
+
+ /*!
+ * \brief Do a complete adaptation of the computational grid.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetIndicator_FlowAdj(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetIndicator_Robust(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetIndicator_Computable(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetIndicator_Computable_Robust(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Write the restart file with the adapted grid.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] mesh_flowfilename - _________________________.
+ */
+ void SetRestart_FlowSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_flowfilename);
+
+ /*!
+ * \brief Write the restart file with the adapted grid.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] mesh_adjfilename - _________________________.
+ */
+ void SetRestart_AdjSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_adjfilename);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] mesh_linfilename - _________________________.
+ */
+ void SetRestart_LinSolution(CConfig *config, CPhysicalGeometry *geo_adapt, string mesh_linfilename);
+
+ /*!
+ * \brief Read the flow solution from the restart file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] max_elem - _________________________.
+ */
+ void SetSensorElem(CGeometry *geometry, CConfig *config, unsigned long max_elem);
+
+};
+
+#include "grid_adaptation_structure.inl"
+
+
diff --git a/Common/include/grid_adaptation_structure.inl b/Common/include/grid_adaptation_structure.inl
index bd565929885..8840d09a7f4 100644
--- a/Common/include/grid_adaptation_structure.inl
+++ b/Common/include/grid_adaptation_structure.inl
@@ -1,33 +1,33 @@
-/*!
- * \file grid_adaptation_structure.inl
- * \brief In-Line subroutines of the grid_adaptation_structure.hpp file.
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
+/*!
+ * \file grid_adaptation_structure.inl
+ * \brief In-Line subroutines of the grid_adaptation_structure.hpp file.
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
diff --git a/Common/include/grid_movement_structure.hpp b/Common/include/grid_movement_structure.hpp
index 1bdce81ee1f..8f3774dc35c 100644
--- a/Common/include/grid_movement_structure.hpp
+++ b/Common/include/grid_movement_structure.hpp
@@ -1,1448 +1,1448 @@
-/*!
- * \file grid_movement_structure.hpp
- * \brief Headers of the main subroutines for doing the numerical grid
- * movement (including volumetric movement, surface movement and Free From
- * technique definition). The subroutines and functions are in
- * the grid_movement_structure.cpp file.
- * \author F. Palacios, T. Economon, S. Padron
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-#include "./mpi_structure.hpp"
-
-#include
-#include
-#include
-#include
-#include
-
-#include "geometry_structure.hpp"
-#include "config_structure.hpp"
-#include "matrix_structure.hpp"
-#include "vector_structure.hpp"
-#include "linear_solvers_structure.hpp"
-
-using namespace std;
-
-/*!
- * \class CGridMovement
- * \brief Class for moving the surface and volumetric
- * numerical grid (2D and 3D problems).
- * \author F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CGridMovement {
-public:
-
- /*!
- * \brief Constructor of the class.
- */
- CGridMovement(void);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CGridMovement(void);
-
- /*!
- * \brief A pure virtual member.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- virtual void SetSurface_Deformation(CGeometry *geometry, CConfig *config);
-
-};
-
-/*!
- * \class CFreeFormDefBox
- * \brief Class for defining the free form FFDBox structure.
- * \author F. Palacios & A. Galdran.
- * \version 4.0.1 "Cardinal"
- */
-class CFreeFormDefBox : public CGridMovement {
-public:
- unsigned short nDim; /*!< \brief Number of dimensions of the problem. */
- unsigned short nCornerPoints, /*!< \brief Number of corner points of the FFDBox. */
- nControlPoints, nControlPoints_Copy; /*!< \brief Number of control points of the FFDBox. */
- su2double **Coord_Corner_Points, /*!< \brief Coordinates of the corner points. */
- ****Coord_Control_Points, /*!< \brief Coordinates of the control points. */
- ****ParCoord_Control_Points, /*!< \brief Coordinates of the control points. */
- ****Coord_Control_Points_Copy, /*!< \brief Coordinates of the control points (copy). */
- ****Coord_SupportCP; /*!< \brief Coordinates of the support control points. */
- unsigned short lOrder, lOrder_Copy, /*!< \brief Order of the FFDBox in the i direction. */
- mOrder, mOrder_Copy, /*!< \brief Order of the FFDBox in the j direction. */
- nOrder, nOrder_Copy; /*!< \brief Order of the FFDBox in the k direction. */
- unsigned short lDegree, lDegree_Copy, /*!< \brief Degree of the FFDBox in the i direction. (lOrder - 1)*/
- mDegree, mDegree_Copy, /*!< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/
- nDegree, nDegree_Copy; /*!< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/
- su2double *ParamCoord, *ParamCoord_, /*!< \brief Parametric coordinates of a point. */
- *cart_coord, *cart_coord_; /*!< \brief Cartesian coordinates of a point. */
- su2double ObjFunc; /*!< \brief Objective function of the point inversion process. */
- su2double *Gradient; /*!< \brief Gradient of the point inversion process. */
- su2double **Hessian; /*!< \brief Hessian of the point inversion process. */
- su2double MaxCoord[3]; /*!< \brief Maximum coordinates of the FFDBox. */
- su2double MinCoord[3]; /*!< \brief Minimum coordinates of the FFDBox. */
- string Tag; /*!< \brief Tag to identify the FFDBox. */
- unsigned short Level; /*!< \brief Nested level of the FFD box. */
- vector CartesianCoord[3]; /*!< \brief Vector with all the cartesian coordinates in the FFD FFDBox. */
- vector ParametricCoord[3]; /*!< \brief Vector with all the parametrics coordinates in the FFD FFDBox. */
- vector MarkerIndex; /*!< \brief Vector with all markers in the FFD FFDBox. */
- vector VertexIndex; /*!< \brief Vector with all vertex index in the FFD FFDBox. */
- vector PointIndex; /*!< \brief Vector with all points index in the FFD FFDBox. */
- unsigned long nSurfacePoint; /*!< \brief Number of surfaces in the FFD FFDBox. */
- vector ParentFFDBox; /*!< \brief Vector with all the parent FFD FFDBox. */
- vector ChildFFDBox; /*!< \brief Vector with all the child FFD FFDBox. */
- vector Fix_IPlane; /*!< \brief Fix FFD I plane. */
- vector Fix_JPlane; /*!< \brief Fix FFD J plane. */
- vector Fix_KPlane; /*!< \brief Fix FFD K plane. */
-
-public:
-
- /*!
- * \brief Constructor of the class.
- */
- CFreeFormDefBox(void);
-
- /*!
- * \overload
- * \param[in] val_lDegree - Degree of the FFDBox in the i direction.
- * \param[in] val_mDegree - Degree of the FFDBox in the j direction.
- * \param[in] val_nDegree - Degree of the FFDBox in the k direction.
- */
- CFreeFormDefBox(unsigned short val_lDegree, unsigned short val_mDegree, unsigned short val_nDegree);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CFreeFormDefBox(void);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- void Set_Fix_IPlane(unsigned short val_plane);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- void Set_Fix_JPlane(unsigned short val_plane);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- void Set_Fix_KPlane(unsigned short val_plane);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_Fix_IPlane(unsigned short val_index);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_Fix_JPlane(unsigned short val_index);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_Fix_KPlane(unsigned short val_index);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_nFix_IPlane(void);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_nFix_JPlane(void);
-
- /*!
- * \brief Define the I planes to to fix in a FFD box.
- * \param[in] val_plane - Index of the plane to fix.
- */
- unsigned short Get_nFix_KPlane(void);
-
- /*!
- * \brief Add to the vector of markers a new marker.
- * \param[in] val_iMarker - New marker inside the FFD box.
- */
- void Set_MarkerIndex(unsigned short val_iMarker);
-
- /*!
- * \brief Add to the vector of vertices a new vertex.
- * \param[in] val_iVertex - New vertex inside the FFD box.
- */
- void Set_VertexIndex(unsigned long val_iVertex);
-
- /*!
- * \brief Add to the vector of points a new point.
- * \param[in] val_iPoint - New point inside the FFD box.
- */
- void Set_PointIndex(unsigned long val_iPoint);
-
- /*!
- * \brief Add to the vector of cartesian coordinates a new coordinate.
- * \param[in] val_coord - New coordinate inside the FFD box.
- */
- void Set_CartesianCoord(su2double *val_coord);
-
- /*!
- * \brief Add to the vector of parametric coordinates a new coordinate.
- * \param[in] val_coord - New coordinate inside the FFD box.
- */
- void Set_ParametricCoord(su2double *val_coord);
-
- /*!
- * \brief Add to the vector of parent FFDBoxes a new FFD FFDBox.
- * \param[in] val_iParentFFDBox - New parent FFDBox in the vector.
- */
- void SetParentFFDBox(string val_iParentFFDBox);
-
- /*!
- * \brief Add to the vector of child FFDBoxes a new FFD FFDBox.
- * \param[in] val_iChildFFDBox - New child FFDBox in the vector.
- */
- void SetChildFFDBox(string val_iChildFFDBox);
-
- /*!
- * \brief _______________.
- * \param[in] val_coord - _______________.
- * \param[in] val_iSurfacePoints - _______________.
- */
- void Set_CartesianCoord(su2double *val_coord, unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] val_coord - _______________.
- * \param[in] val_iSurfacePoints - _______________.
- */
- void Set_ParametricCoord(su2double *val_coord, unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] Get_MarkerIndex - _______________.
- * \return _______________.
- */
- unsigned short Get_MarkerIndex(unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] Get_VertexIndex - _______________.
- * \return _______________.
- */
- unsigned long Get_VertexIndex(unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] Get_PointIndex - _______________.
- * \return _______________.
- */
- unsigned long Get_PointIndex(unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] Get_CartesianCoord - _______________.
- * \return _______________.
- */
- su2double *Get_CartesianCoord(unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] Get_ParametricCoord - _______________.
- * \return _______________.
- */
- su2double *Get_ParametricCoord(unsigned long val_iSurfacePoints);
-
- /*!
- * \brief _______________.
- * \param[in] GetnSurfacePoint - _______________.
- * \return _______________.
- */
- unsigned long GetnSurfacePoint(void);
-
- /*!
- * \brief _______________.
- * \param[in] GetnParentFFDBox - _______________.
- * \return _______________.
- */
- unsigned short GetnParentFFDBox(void);
-
- /*!
- * \brief _______________.
- * \param[in] GetnChildFFDBox - _______________.
- * \return _______________.
- */
- unsigned short GetnChildFFDBox(void);
-
- /*!
- * \brief _______________.
- * \param[in] val_ParentFFDBox - _______________.
- * \return _______________.
- */
- string GetParentFFDBoxTag(unsigned short val_ParentFFDBox);
-
- /*!
- * \brief _______________.
- * \param[in] val_ChildFFDBox - _______________.
- * \return _______________.
- */
- string GetChildFFDBoxTag(unsigned short val_ChildFFDBox);
-
- /*!
- * \brief Change the the position of the corners of the unitary FFDBox,
- * and find the position of the control points for the FFDBox
- * \param[in] FFDBox - Original FFDBox where we want to compute the control points.
- */
- void SetSupportCPChange(CFreeFormDefBox *FFDBox);
-
- /*!
- * \brief Set the number of corner points.
- * \param[in] val_ncornerpoints - Number of corner points.
- */
- void SetnCornerPoints(unsigned short val_ncornerpoints);
-
- /*!
- * \brief Get the number of corner points.
- * \return Number of corner points.
- */
- unsigned short GetnCornerPoints(void);
-
- /*!
- * \brief Get the number of control points.
- * \return Number of control points.
- */
- unsigned short GetnControlPoints(void);
-
- /*!
- * \brief Get the number of control points.
- * \return Number of control points.
- */
- void SetnControlPoints(void);
-
- /*!
- * \brief Get the number of numerical points on the surface.
- * \return Number of numerical points on the surface.
- */
- unsigned long GetnSurfacePoints(void);
-
- /*!
- * \brief Set the corner point for the unitary FFDBox.
- */
- void SetUnitCornerPoints(void);
-
- /*!
- * \brief Set the coordinates of the corner points.
- * \param[in] val_coord - Coordinates of the corner point with index val_icornerpoints.
- * \param[in] val_icornerpoints - Index of the corner point.
- */
- void SetCoordCornerPoints(su2double *val_coord, unsigned short val_icornerpoints);
-
- /*!
- * \overload
- * \param[in] val_xcoord - X coordinate of the corner point with index val_icornerpoints.
- * \param[in] val_ycoord - Y coordinate of the corner point with index val_icornerpoints.
- * \param[in] val_zcoord - Z coordinate of the corner point with index val_icornerpoints.
- * \param[in] val_icornerpoints - Index of the corner point.
- */
- void SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints);
-
- /*!
- * \brief Set the coordinates of the control points.
- * \param[in] val_coord - Coordinates of the control point.
- * \param[in] iDegree - Index of the FFDBox, i direction.
- * \param[in] jDegree - Index of the FFDBox, j direction.
- * \param[in] kDegree - Index of the FFDBox, k direction.
- */
- void SetCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
-
- /*!
- * \brief Set the coordinates of the control points.
- * \param[in] val_coord - Coordinates of the control point.
- * \param[in] iDegree - Index of the FFDBox, i direction.
- * \param[in] jDegree - Index of the FFDBox, j direction.
- * \param[in] kDegree - Index of the FFDBox, k direction.
- */
- void SetCoordControlPoints_Copy(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
-
- /*!
- * \brief Set the coordinates of the control points.
- * \param[in] val_coord - Coordinates of the control point.
- * \param[in] iDegree - Index of the FFDBox, i direction.
- * \param[in] jDegree - Index of the FFDBox, j direction.
- * \param[in] kDegree - Index of the FFDBox, k direction.
- */
- void SetParCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
-
- /*!
- * \brief Get the coordinates of the corner points.
- * \param[in] val_dim - Index of the coordinate (x, y, z).
- * \param[in] val_icornerpoints - Index of the corner point.
- * \return Coordinate val_dim of the corner point val_icornerpoints.
- */
- su2double GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints);
-
- /*!
- * \brief Get the coordinates of the corner points.
- * \param[in] val_icornerpoints - Index of the corner point.
- * \return Pointer to the coordinate vector of the corner point val_icornerpoints.
- */
- su2double *GetCoordCornerPoints(unsigned short val_icornerpoints);
-
- /*!
- * \brief Get the coordinates of the control point.
- * \param[in] val_iindex - Value of the local i index of the control point.
- * \param[in] val_jindex - Value of the local j index of the control point.
- * \param[in] val_kindex - Value of the local k index of the control point.
- * \return Pointer to the coordinate vector of the control point with local index (i, j, k).
- */
- su2double *GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex);
-
- /*!
- * \brief Get the parametric coordinates of the control point.
- * \param[in] val_iindex - Value of the local i index of the control point.
- * \param[in] val_jindex - Value of the local j index of the control point.
- * \param[in] val_kindex - Value of the local k index of the control point.
- * \return Pointer to the coordinate vector of the control point with local index (i, j, k).
- */
- su2double *GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex);
-
- /*!
- * \brief Set the control points in a parallelepiped (hexahedron).
- */
- void SetControlPoints_Parallelepiped(void);
-
- /*!
- * \brief Set the control points of the final chuck in a unitary hexahedron free form.
- * \param[in] FFDBox - Original FFDBox where we want to compute the control points.
- */
- void SetSupportCP(CFreeFormDefBox *FFDBox);
-
- /*!
- * \brief Set the new value of the coordinates of the control points.
- * \param[in] val_index - Local index (i, j, k) of the control point.
- * \param[in] movement - Movement of the control point.
- */
- void SetControlPoints(unsigned short *val_index, su2double *movement);
-
- /*!
- * \brief Set the original value of the control points.
- */
- void SetOriginalControlPoints(void);
-
- /*!
- * \brief Set the tecplot file of the FFD chuck structure.
- * \param[in] iFFDBox - Index of the FFD box.
- * \param[in] original - Original box (before deformation).
- */
- void SetTecplot(CGeometry *geometry, unsigned short iFFDBox, bool original);
-
- /*!
- * \brief Set the cartesian coords of a point in R^3 and convert them to the parametric coords of
- * our parametrization of a paralellepiped.
- * \param[in] cart_coord - Cartesian coordinates of a point.
- * \return Pointer to the parametric coordinates of a point.
- */
- su2double *GetParametricCoord_Analytical(su2double *cart_coord);
-
- /*!
- * \brief Iterative strategy for computing the parametric coordinates.
- * \param[in] xyz - Cartesians coordinates of the target point.
- * \param[in] guess - Initial guess for doing the parametric coordinates search.
- * \param[in] tol - Level of convergence of the iterative method.
- * \param[in] it_max - Maximal number of iterations.
- * \return Parametric coordinates of the point.
- */
- su2double *GetParametricCoord_Iterative(unsigned long iPoint, su2double *xyz, su2double *guess, CConfig *config);
-
- /*!
- * \brief Compute the cross product.
- * \param[in] v1 - First input vector.
- * \param[in] v2 - Second input vector.
- * \param[out] v3 - Output vector wuth the cross product.
- */
- void CrossProduct(su2double *v1, su2double *v2, su2double *v3);
-
- /*!
- * \brief Compute the doc product.
- * \param[in] v1 - First input vector.
- * \param[in] v2 - Sencond input vector.
- * \return Dot product between v1, and v2.
- */
- su2double DotProduct(su2double *v1, su2double *v2);
-
- /*!
- * \brief Here we take the parametric coords of a point in the box and we convert them to the
- * physical cartesian coords by plugging the ParamCoords on the Bezier parameterization of our box.
- * \param[in] ParamCoord - Parametric coordinates of a point.
- * \return Pointer to the cartesian coordinates of a point.
- */
- su2double *EvalCartesianCoord(su2double *ParamCoord);
-
- /*!
- * \brief Set the Bernstein polynomial, defined as B_i^n(t) = Binomial(n, i)*t^i*(1-t)^(n-i).
- * \param[in] val_n - Degree of the Bernstein polynomial.
- * \param[in] val_i - Order of the Bernstein polynomial.
- * \param[in] val_t - Value of the parameter where the polynomial is evaluated.
- * \return Value of the Bernstein polynomial.
- */
- su2double GetBernstein(short val_n, short val_i, su2double val_t);
-
- /*!
- * \brief Get the binomial coefficient n over i, defined as n!/(m!(n-m)!)
- * \note If the denominator is 0, the value is 1.
- * \param[in] n - Upper coefficient.
- * \param[in] m - Lower coefficient.
- * \return Value of the binomial coefficient n over m.
- */
- unsigned long Binomial(unsigned short n, unsigned short m);
-
- /*!
- * \brief Get the order in the l direction of the FFD FFDBox.
- * \return Order in the l direction of the FFD FFDBox.
- */
- unsigned short GetlOrder(void);
-
- /*!
- * \brief Get the order in the m direction of the FFD FFDBox.
- * \return Order in the m direction of the FFD FFDBox.
- */
- unsigned short GetmOrder(void);
-
- /*!
- * \brief Get the order in the n direction of the FFD FFDBox.
- * \return Order in the n direction of the FFD FFDBox.
- */
- unsigned short GetnOrder(void);
-
- /*!
- * \brief Get the order in the l direction of the FFD FFDBox.
- * \return Order in the l direction of the FFD FFDBox.
- */
- void SetlOrder(unsigned short val_lOrder);
-
- /*!
- * \brief Get the order in the m direction of the FFD FFDBox.
- * \return Order in the m direction of the FFD FFDBox.
- */
- void SetmOrder(unsigned short val_mOrder);
-
- /*!
- * \brief Get the order in the n direction of the FFD FFDBox.
- * \return Order in the n direction of the FFD FFDBox.
- */
- void SetnOrder(unsigned short val_nOrder);
-
- /*!
- * \brief Set, at each vertex, the index of the free form FFDBox that contains the vertex.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iFFDBox - Index of the FFDBox.
- */
- bool GetPointFFD(CGeometry *geometry, CConfig *config, unsigned long iPoint);
-
- /*!
- * \brief Set the zone of the computational domain that is going to be deformed.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iFFDBox - Index of the FFDBox.
- */
- void SetDeformationZone(CGeometry *geometry, CConfig *config, unsigned short iFFDBox);
-
- /*!
- * \brief The "order" derivative of the i-th Bernstein polynomial of degree n, evaluated at t,
- * is calculated as (B_i^n(t))^{order}(t) = n*(GetBernstein(n-1, i-1, t)-GetBernstein(n-1, i, t)),
- * having in account that if i=0, GetBernstein(n-1,-1, t) = 0.
- * \param[in] val_n - Degree of the Bernstein polynomial.
- * \param[in] val_i - Order of the Bernstein polynomial.
- * \param[in] val_t - Value of the parameter where the polynomial is evaluated.
- * \param[in] val_order - Order of the derivative.
- * \return Value of the Derivative of the Bernstein polynomial.
- */
- su2double GetBernsteinDerivative(short val_n, short val_i, su2double val_t, short val_order);
-
- /*!
- * \brief The routine computes the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w).
- * \param[in] val_coord - Parametric coordiates of the target point.
- * \param[in] xyz - Cartesians coordinates of the point.
- * \param[in] analytical - Compute the analytical gradient.
- * \return Value of the analytical gradient.
- */
- su2double *GetFFDGradient(su2double *val_coord, su2double *xyz);
-
- /*!
- * \brief The routine that computes the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w)
- * Input: (u, v, w), (x, y, z)
- * Output: Hessian F (u, v, w).
- * \param[in] uvw - Current value of the parametrics coordinates.
- * \param[in] xyz - Cartesians coordinates of the target point to compose the functional.
- * \param[in] val_Hessian - Value of the hessian.
- */
- void GetFFDHessian(su2double *uvw, su2double *xyz, su2double **val_Hessian);
-
- /*!
- * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
- * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2
- * Input: val_t, val_diff (to identify the index of the Bernstein polynomail we differentiate), the i, j, k , l, m, n
- * E.G.: val_diff=2 => we differentiate w.r.t. w (val_diff=0,1, or 2) Output: d [B_i^l*B_j^m *B_k^n] / d val_diff
- * (val_u, val_v, val_w).
- * \param[in] uvw - __________.
- * \param[in] val_diff - __________.
- * \param[in] ijk - __________.
- * \param[in] lmn - Degree of the FFD box.
- * \return __________.
- */
- su2double GetDerivative1(su2double *uvw, unsigned short val_diff, unsigned short *ijk, unsigned short *lmn);
-
- /*!
- * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
- * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2
- * Input: (u, v, w), dim , xyz=(x, y, z), l, m, n E.G.: dim=2 => we use the third coordinate of the control points,
- * and the z-coordinate of xyz (0<=dim<=2) Output: 2* ( (Sum_{i, j, k}^l, m, n P_{ijk}[dim] B_i^l[u] B_j^m[v] B_k^n[w]) -
- * xyz[dim]).
- * \param[in] uvw - __________.
- * \param[in] dim - __________.
- * \param[in] xyz - __________.
- * \param[in] lmn - Degree of the FFD box.
- * \return __________.
- */
- su2double GetDerivative2(su2double *uvw, unsigned short dim, su2double *xyz, unsigned short *lmn);
-
- /*!
- * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
- * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
- * \param[in] uvw - Parametric coordiates of the point.
- * \param[in] dim - Value of the coordinate to be differentiate.
- * \param[in] diff_this - Diferentiation with respect this coordinate.
- * \param[in] lmn - Degree of the FFD box.
- * \return Sum_{i, j, k}^{l, m, n} [one of them with -1,
- * depending on diff_this=0,1 or 2] P_{ijk}[dim] * (B_i^l[u] B_j^m[v] B_k^n[w])--one of them diffrentiated;
- * which? diff_thiss will tell us ; E.G.: dim=2, diff_this=1 => we use the third coordinate of the control
- * points, and derivate de v-Bersntein polynomial (use m-1 when summing!!).
- */
- su2double GetDerivative3(su2double *uvw, unsigned short dim, unsigned short diff_this,
- unsigned short *lmn);
-
- /*!
- * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
- * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
- * Input: val_t, val_diff, val_diff2 (to identify the index of the Bernstein polynomials we differentiate), the i, j, k , l, m, n
- * E.G.: val_diff=1, val_diff2=2 => we differentiate w.r.t. v and w (val_diff=0,1, or 2)
- * E.G.: val_diff=0, val_diff2=0 => we differentiate w.r.t. u two times
- * Output: [d [B_i^l*B_j^m *B_k^n]/d val_diff *d [B_i^l*B_j^m *B_k^n]/d val_diff2] (val_u, val_v, val_w) .
- * \param[in] uvw - __________.
- * \param[in] val_diff - __________.
- * \param[in] val_diff2 - __________.
- * \param[in] ijk - __________.
- * \param[in] lmn - Degree of the FFD box.
- * \return __________.
- */
- su2double GetDerivative4(su2double *uvw, unsigned short val_diff, unsigned short val_diff2,
- unsigned short *ijk, unsigned short *lmn);
-
- /*!
- * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
- * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
- * Input: (u, v, w), dim , diff_this, diff_this_also, xyz=(x, y, z), l, m, n
- * Output:
- * Sum_{i, j, k}^{l, m, n} [two of them with -1, depending on diff_this, diff_this_also=0,1 or 2]
- * P_{ijk}[dim] * (B_i^l[u] B_j^m[v] B_k^n[w])--one of them diffrentiated; which? diff_thiss will tell us ;
- * E.G.: dim=2, diff_this=1 => we use the third coordinate of the control points, and derivate de v-Bersntein
- * polynomial (use m-1 when summing!!).
- * \param[in] uvw - __________.
- * \param[in] dim - __________.
- * \param[in] diff_this - __________.
- * \param[in] diff_this_also - __________.
- * \param[in] lmn - Degree of the FFD box.
- * \return __________.
- */
- su2double GetDerivative5(su2double *uvw, unsigned short dim, unsigned short diff_this, unsigned short diff_this_also,
- unsigned short *lmn);
-
- /*!
- * \brief Euclidean norm of a vector.
- * \param[in] a - _______.
- * \return __________.
- */
- su2double GetNorm(su2double *a);
-
- /*!
- * \brief Set the tag that identify a FFDBox.
- * \param[in] val_tag - value of the tag.
- */
- void SetTag(string val_tag);
-
- /*!
- * \brief Get the tag that identify a FFDBox.
- * \return Value of the tag that identigy the FFDBox.
- */
- string GetTag(void);
-
- /*!
- * \brief Set the nested level of the FFDBox.
- * \param[in] val_level - value of the level.
- */
- void SetLevel(unsigned short val_level);
-
- /*!
- * \brief Get the nested level of the FFDBox.
- * \return Value of the nested level of the the FFDBox.
- */
- unsigned short GetLevel(void);
-
- /*!
- * \brief Compute the determinant of a 3 by 3 matrix.
- * \param[in] val_matrix 3 by 3 matrix.
- * \result Determinant of the matrix
- */
- su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11,
- su2double A12, su2double A20, su2double A21, su2double A22);
-
-};
-
-/*!
- * \class CVolumetricMovement
- * \brief Class for moving the volumetric numerical grid.
- * \author F. Palacios, A. Bueno, T. Economon, S. Padron.
- * \version 4.0.1 "Cardinal"
- */
-class CVolumetricMovement : public CGridMovement {
-protected:
-
- unsigned short nDim; /*!< \brief Number of dimensions. */
- unsigned short nVar; /*!< \brief Number of variables. */
-
- unsigned long nPoint; /*!< \brief Number of points. */
- unsigned long nPointDomain; /*!< \brief Number of points in the domain. */
-
- CSysMatrix StiffMatrix; /*!< \brief Matrix to store the point-to-point stiffness. */
- CSysVector LinSysSol;
- CSysVector LinSysRes;
-
-public:
-
- /*!
- * \brief Constructor of the class.
- */
- CVolumetricMovement(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CVolumetricMovement(void);
-
- /*!
- * \brief Update the value of the coordinates after the grid movement.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void UpdateGridCoord(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Update the dual grid after the grid movement (edges and control volumes).
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void UpdateDualGrid(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Update the coarse multigrid levels after the grid movement.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void UpdateMultiGrid(CGeometry **geometry, CConfig *config);
-
- /*!
- * \brief Compute the stiffness matrix for grid deformation using spring analogy.
- * \param[in] geometry - Geometrical definition of the problem.
- * \return Value of the length of the smallest edge of the grid.
- */
- su2double SetFEAMethodContributions_Elem(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
- * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
- */
- void SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double scale);
-
- /*!
- * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
- * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
- */
- void SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double scale);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] Mu - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] Mu - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] Mu - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] Mu - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Shape functions and derivative of the shape functions
- * \param[in] Xi - Local coordinates.
- * \param[in] Eta - Local coordinates.
- * \param[in] CoordCorners - Coordiantes of the corners.
- * \param[in] DShapeFunction - Shape function information
- */
- su2double ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetHexa_Volume(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetTetra_Volume(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetPrism_Volume(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetPyram_Volume(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetTriangle_Area(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Compute the shape functions for hexahedron
- * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
- */
- su2double GetQuadrilateral_Area(su2double CoordCorners[8][3]);
-
- /*!
- * \brief Add the stiffness matrix for a 2-D triangular element to the global stiffness matrix for the entire mesh (node-based).
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
- * \param[in] PointCorners
- * \param[in] nNodes
- */
- void AddFEA_StiffMatrix(CGeometry *geometry, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], unsigned short nNodes);
-
- /*!
- * \brief Check for negative volumes (all elements) after performing grid deformation.
- * \param[in] geometry - Geometrical definition of the problem.
- */
- su2double Check_Grid(CGeometry *geometry);
-
- /*!
- * \brief Compute the minimum distance to the nearest deforming surface.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void ComputeDeforming_Wall_Distance(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Check the boundary vertex that are going to be moved.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetBoundaryDisplacements(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Check the domain points vertex that are going to be moved.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetDomainDisplacements(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Unsteady grid movement using rigid mesh rotation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Physical time iteration number.
- */
- void Rigid_Rotation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Unsteady pitching grid movement using rigid mesh motion.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Physical time iteration number.
- */
- void Rigid_Pitching(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Unsteady plunging grid movement using rigid mesh motion.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Physical time iteration number.
- */
- void Rigid_Plunging(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Unsteady translational grid movement using rigid mesh motion.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Physical time iteration number.
- */
- void Rigid_Translation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Scale the volume grid by a multiplicative factor.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] UpdateGeo - Update geometry.
- */
- void SetVolume_Scaling(CGeometry *geometry, CConfig *config, bool UpdateGeo);
-
- /*!
- * \brief Translate the volume grid by a specified displacement vector.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] UpdateGeo - Update geometry.
- */
- void SetVolume_Translation(CGeometry *geometry, CConfig *config, bool UpdateGeo);
-
- /*!
- * \brief Rotate the volume grid around a specified axis and angle.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] UpdateGeo - Update geometry.
- */
- void SetVolume_Rotation(CGeometry *geometry, CConfig *config, bool UpdateGeo);
-
- /*!
- * \brief Grid deformation using the spring analogy method.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] UpdateGeo - Update geometry.
- * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled.
- */
- void SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative = false);
-
- /*!
- * \brief Set the derivatives of the boundary nodes.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetBoundaryDerivatives(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Update the derivatives of the coordinates after the grid movement.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void UpdateGridCoord_Derivatives(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Compute the determinant of a 3 by 3 matrix.
- * 3 by 3 matrix elements
- * \param[in] A00
- * \param[in] A01
- * \param[in] A02
- * \param[in] A10
- * \param[in] A11
- * \param[in] A12
- * \param[in] A20
- * \param[in] A21
- * \param[in] A22
- * \result Determinant of the matrix
- */
- su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22);
-
-};
-
-/*!
- * \class CSurfaceMovement
- * \brief Class for moving the surface numerical grid.
- * \author F. Palacios, T. Economon.
- * \version 4.0.1 "Cardinal"
- */
-class CSurfaceMovement : public CGridMovement {
-protected:
- CFreeFormDefBox** FFDBox; /*!< \brief Definition of the Free Form Deformation Box. */
- unsigned short nFFDBox; /*!< \brief Number of FFD FFDBoxes. */
- unsigned short nLevel; /*!< \brief Level of the FFD FFDBoxes (parent/child). */
- bool FFDBoxDefinition; /*!< \brief If the FFD FFDBox has been defined in the input file. */
- vector GlobalCoordX[MAX_NUMBER_FFD];
- vector GlobalCoordY[MAX_NUMBER_FFD];
- vector GlobalCoordZ[MAX_NUMBER_FFD];
- vector GlobalTag[MAX_NUMBER_FFD];
- vector GlobalPoint[MAX_NUMBER_FFD];
-
-public:
-
- /*!
- * \brief Constructor of the class.
- */
- CSurfaceMovement(void);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CSurfaceMovement(void);
-
- /*!
- * \brief Set a Hicks-Henne deformation bump functions on an airfoil.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetHicksHenne(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a NACA 4 digits airfoil family for airfoil deformation.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- */
- void SetNACA_4Digits(CGeometry *boundary, CConfig *config);
-
- /*!
- * \brief Set a parabolic family for airfoil deformation.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- */
- void SetParabolic(CGeometry *boundary, CConfig *config);
-
- /*!
- * \brief Set a obstacle in a channel.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- */
- void SetAirfoil(CGeometry *boundary, CConfig *config);
-
- /*!
- * \brief Set a rotation for surface movement.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetRotation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set the translational/rotational velocity for a moving wall.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Physical time iteration number.
- */
- void Moving_Walls(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Computes the displacement of a translating surface for a dynamic mesh simulation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iter - Current physical time iteration.
- * \param[in] iZone - Zone number in the mesh.
- */
- void Surface_Translating(CGeometry *geometry, CConfig *config,
- unsigned long iter, unsigned short iZone);
-
- /*!
- * \brief Computes the displacement of a plunging surface for a dynamic mesh simulation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iter - Current physical time iteration.
- * \param[in] iZone - Zone number in the mesh.
- */
- void Surface_Plunging(CGeometry *geometry, CConfig *config,
- unsigned long iter, unsigned short iZone);
-
- /*!
- * \brief Computes the displacement of a pitching surface for a dynamic mesh simulation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iter - Current physical time iteration.
- * \param[in] iZone - Zone number in the mesh.
- */
- void Surface_Pitching(CGeometry *geometry, CConfig *config,
- unsigned long iter, unsigned short iZone);
-
- /*!
- * \brief Computes the displacement of a rotating surface for a dynamic mesh simulation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iter - Current physical time iteration.
- * \param[in] iZone - Zone number in the mesh.
- */
- void Surface_Rotating(CGeometry *geometry, CConfig *config,
- unsigned long iter, unsigned short iZone);
-
- /*!
- * \brief Unsteady aeroelastic grid movement by deforming the mesh.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] ExtIter - Physical iteration number.
- * \param[in] iMarker - Marker to deform.
- * \param[in] iMarker_Monitoring - Marker we are monitoring.
- * \param[in] displacements - solution of typical section wing model.
- */
- void AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long ExtIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements);
-
- /*!
- * \brief Deforms a 3-D flutter/pitching surface during an unsteady simulation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iter - Current physical time iteration.
- * \param[in] iZone - Zone number in the mesh.
- */
- void SetBoundary_Flutter3D(CGeometry *geometry, CConfig *config,
- CFreeFormDefBox **FFDBox, unsigned long iter, unsigned short iZone);
-
- /*!
- * \brief Set the collective pitch for a blade surface movement.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetCollective_Pitch(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Set any surface deformationsbased on an input file.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iZone - Zone number in the mesh.
- * \param[in] iter - Current physical time iteration.
- */
- void SetExternal_Deformation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
-
- /*!
- * \brief Set a displacement for surface movement.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetTranslation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a displacement for surface movement.
- * \param[in] boundary - Geometry of the boundary.
- * \param[in] config - Definition of the particular problem.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetScale(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Copy the boundary coordinates to each vertex.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void CopyBoundary(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Set the surface/boundary deformation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetSurface_Deformation(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Compute the parametric coordinates of a grid point using a point inversion strategy
- * in the free form FFDBox.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- */
- void SetParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
-
- /*!
- * \brief Update the parametric coordinates of a grid point using a point inversion strategy
- * in the free form FFDBox.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iFFDBox - _____________________.
- */
- void UpdateParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
-
- /*!
- * \brief Check the intersections of the FFD with the surface
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iFFDBox - _____________________.
- */
- void CheckFFDIntersections(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
-
- /*!
- * \brief _____________________.
- * \param[in] geometry - _____________________.
- * \param[in] config - _____________________.
- * \param[in] FFDBoxParent - _____________________.
- * \param[in] FFDBoxChild - _____________________.
- */
- void SetParametricCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild);
-
- /*!
- * \brief _____________________.
- * \param[in] geometry - _____________________.
- * \param[in] config - _____________________.
- * \param[in] FFDBoxParent - _____________________.
- * \param[in] FFDBoxChild - _____________________.
- */
- void GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild);
-
- /*!
- * \brief Recompute the cartesian coordinates using the control points position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iFFDBox - _____________________.
- */
- void SetCartesianCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
-
- /*!
- * \brief Set the deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set the deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDCPChange(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a camber deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDCamber_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a thickness deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDThickness_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a camber deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDCamber(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a thickness deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDThickness(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a dihedral angle deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDDihedralAngle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a twist angle deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDTwistAngle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a rotation angle deformation of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDRotation(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Set a rotation angle deformation in a control surface of the Free From box using the control point position.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] iDV - Index of the design variable.
- * \param[in] ResetDef - Reset the deformation before starting a new one.
- */
- void SetFFDControl_Surface(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
-
- /*!
- * \brief Read the free form information from the grid input file.
- * \note If there is no control point information, and no parametric
- * coordinates information, the code will compute that information.
- * \param[in] config - Definition of the particular problem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- * \param[in] val_mesh_filename - Name of the grid input file.
- */
- void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, string val_mesh_filename);
-
- /*!
- * \brief Read the free form information from the grid input file.
- * \note If there is no control point information, and no parametric
- * coordinates information, the code will compute that information.
- * \param[in] config - Definition of the particular problem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
- */
- void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox);
-
- /*!
- * \brief Merge the Free Form information in the SU2 file.
- * \param[in] config - Definition of the particular problem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] val_mesh_filename - Name of the grid output file.
- */
- void MergeFFDInfo(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Write the Free Form information in the SU2 file.
- * \param[in] config - Definition of the particular problem.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] val_mesh_filename - Name of the grid output file.
- */
- void WriteFFDInfo(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Get information about if there is a complete FFDBox definition, or it is necessary to
- * compute the parametric coordinates.
- * \return TRUE
if the input grid file has a complete information; otherwise FALSE
.
- */
- bool GetFFDBoxDefinition(void);
-
- /*!
- * \brief Obtain the number of FFDBoxes.
- * \return Number of FFD FFDBoxes.
- */
- unsigned short GetnFFDBox(void);
-
- /*!
- * \brief Obtain the number of levels.
- * \return Number of FFD levels.
- */
- unsigned short GetnLevel(void);
-
- /*!
- * \brief Set derivatives of the surface/boundary deformation.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SetSurface_Derivative(CGeometry *geometry, CConfig *config);
-};
-
-#include "grid_movement_structure.inl"
+/*!
+ * \file grid_movement_structure.hpp
+ * \brief Headers of the main subroutines for doing the numerical grid
+ * movement (including volumetric movement, surface movement and Free From
+ * technique definition). The subroutines and functions are in
+ * the grid_movement_structure.cpp file.
+ * \author F. Palacios, T. Economon, S. Padron
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+#include "./mpi_structure.hpp"
+
+#include
+#include
+#include
+#include
+#include
+
+#include "geometry_structure.hpp"
+#include "config_structure.hpp"
+#include "matrix_structure.hpp"
+#include "vector_structure.hpp"
+#include "linear_solvers_structure.hpp"
+
+using namespace std;
+
+/*!
+ * \class CGridMovement
+ * \brief Class for moving the surface and volumetric
+ * numerical grid (2D and 3D problems).
+ * \author F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CGridMovement {
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ */
+ CGridMovement(void);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CGridMovement(void);
+
+ /*!
+ * \brief A pure virtual member.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ virtual void SetSurface_Deformation(CGeometry *geometry, CConfig *config);
+
+};
+
+/*!
+ * \class CFreeFormDefBox
+ * \brief Class for defining the free form FFDBox structure.
+ * \author F. Palacios & A. Galdran.
+ * \version 4.0.1 "Cardinal"
+ */
+class CFreeFormDefBox : public CGridMovement {
+public:
+ unsigned short nDim; /*!< \brief Number of dimensions of the problem. */
+ unsigned short nCornerPoints, /*!< \brief Number of corner points of the FFDBox. */
+ nControlPoints, nControlPoints_Copy; /*!< \brief Number of control points of the FFDBox. */
+ su2double **Coord_Corner_Points, /*!< \brief Coordinates of the corner points. */
+ ****Coord_Control_Points, /*!< \brief Coordinates of the control points. */
+ ****ParCoord_Control_Points, /*!< \brief Coordinates of the control points. */
+ ****Coord_Control_Points_Copy, /*!< \brief Coordinates of the control points (copy). */
+ ****Coord_SupportCP; /*!< \brief Coordinates of the support control points. */
+ unsigned short lOrder, lOrder_Copy, /*!< \brief Order of the FFDBox in the i direction. */
+ mOrder, mOrder_Copy, /*!< \brief Order of the FFDBox in the j direction. */
+ nOrder, nOrder_Copy; /*!< \brief Order of the FFDBox in the k direction. */
+ unsigned short lDegree, lDegree_Copy, /*!< \brief Degree of the FFDBox in the i direction. (lOrder - 1)*/
+ mDegree, mDegree_Copy, /*!< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/
+ nDegree, nDegree_Copy; /*!< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/
+ su2double *ParamCoord, *ParamCoord_, /*!< \brief Parametric coordinates of a point. */
+ *cart_coord, *cart_coord_; /*!< \brief Cartesian coordinates of a point. */
+ su2double ObjFunc; /*!< \brief Objective function of the point inversion process. */
+ su2double *Gradient; /*!< \brief Gradient of the point inversion process. */
+ su2double **Hessian; /*!< \brief Hessian of the point inversion process. */
+ su2double MaxCoord[3]; /*!< \brief Maximum coordinates of the FFDBox. */
+ su2double MinCoord[3]; /*!< \brief Minimum coordinates of the FFDBox. */
+ string Tag; /*!< \brief Tag to identify the FFDBox. */
+ unsigned short Level; /*!< \brief Nested level of the FFD box. */
+ vector CartesianCoord[3]; /*!< \brief Vector with all the cartesian coordinates in the FFD FFDBox. */
+ vector ParametricCoord[3]; /*!< \brief Vector with all the parametrics coordinates in the FFD FFDBox. */
+ vector MarkerIndex; /*!< \brief Vector with all markers in the FFD FFDBox. */
+ vector VertexIndex; /*!< \brief Vector with all vertex index in the FFD FFDBox. */
+ vector PointIndex; /*!< \brief Vector with all points index in the FFD FFDBox. */
+ unsigned long nSurfacePoint; /*!< \brief Number of surfaces in the FFD FFDBox. */
+ vector ParentFFDBox; /*!< \brief Vector with all the parent FFD FFDBox. */
+ vector ChildFFDBox; /*!< \brief Vector with all the child FFD FFDBox. */
+ vector Fix_IPlane; /*!< \brief Fix FFD I plane. */
+ vector Fix_JPlane; /*!< \brief Fix FFD J plane. */
+ vector Fix_KPlane; /*!< \brief Fix FFD K plane. */
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ */
+ CFreeFormDefBox(void);
+
+ /*!
+ * \overload
+ * \param[in] val_lDegree - Degree of the FFDBox in the i direction.
+ * \param[in] val_mDegree - Degree of the FFDBox in the j direction.
+ * \param[in] val_nDegree - Degree of the FFDBox in the k direction.
+ */
+ CFreeFormDefBox(unsigned short val_lDegree, unsigned short val_mDegree, unsigned short val_nDegree);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CFreeFormDefBox(void);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ void Set_Fix_IPlane(unsigned short val_plane);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ void Set_Fix_JPlane(unsigned short val_plane);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ void Set_Fix_KPlane(unsigned short val_plane);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_Fix_IPlane(unsigned short val_index);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_Fix_JPlane(unsigned short val_index);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_Fix_KPlane(unsigned short val_index);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_nFix_IPlane(void);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_nFix_JPlane(void);
+
+ /*!
+ * \brief Define the I planes to to fix in a FFD box.
+ * \param[in] val_plane - Index of the plane to fix.
+ */
+ unsigned short Get_nFix_KPlane(void);
+
+ /*!
+ * \brief Add to the vector of markers a new marker.
+ * \param[in] val_iMarker - New marker inside the FFD box.
+ */
+ void Set_MarkerIndex(unsigned short val_iMarker);
+
+ /*!
+ * \brief Add to the vector of vertices a new vertex.
+ * \param[in] val_iVertex - New vertex inside the FFD box.
+ */
+ void Set_VertexIndex(unsigned long val_iVertex);
+
+ /*!
+ * \brief Add to the vector of points a new point.
+ * \param[in] val_iPoint - New point inside the FFD box.
+ */
+ void Set_PointIndex(unsigned long val_iPoint);
+
+ /*!
+ * \brief Add to the vector of cartesian coordinates a new coordinate.
+ * \param[in] val_coord - New coordinate inside the FFD box.
+ */
+ void Set_CartesianCoord(su2double *val_coord);
+
+ /*!
+ * \brief Add to the vector of parametric coordinates a new coordinate.
+ * \param[in] val_coord - New coordinate inside the FFD box.
+ */
+ void Set_ParametricCoord(su2double *val_coord);
+
+ /*!
+ * \brief Add to the vector of parent FFDBoxes a new FFD FFDBox.
+ * \param[in] val_iParentFFDBox - New parent FFDBox in the vector.
+ */
+ void SetParentFFDBox(string val_iParentFFDBox);
+
+ /*!
+ * \brief Add to the vector of child FFDBoxes a new FFD FFDBox.
+ * \param[in] val_iChildFFDBox - New child FFDBox in the vector.
+ */
+ void SetChildFFDBox(string val_iChildFFDBox);
+
+ /*!
+ * \brief _______________.
+ * \param[in] val_coord - _______________.
+ * \param[in] val_iSurfacePoints - _______________.
+ */
+ void Set_CartesianCoord(su2double *val_coord, unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] val_coord - _______________.
+ * \param[in] val_iSurfacePoints - _______________.
+ */
+ void Set_ParametricCoord(su2double *val_coord, unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] Get_MarkerIndex - _______________.
+ * \return _______________.
+ */
+ unsigned short Get_MarkerIndex(unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] Get_VertexIndex - _______________.
+ * \return _______________.
+ */
+ unsigned long Get_VertexIndex(unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] Get_PointIndex - _______________.
+ * \return _______________.
+ */
+ unsigned long Get_PointIndex(unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] Get_CartesianCoord - _______________.
+ * \return _______________.
+ */
+ su2double *Get_CartesianCoord(unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] Get_ParametricCoord - _______________.
+ * \return _______________.
+ */
+ su2double *Get_ParametricCoord(unsigned long val_iSurfacePoints);
+
+ /*!
+ * \brief _______________.
+ * \param[in] GetnSurfacePoint - _______________.
+ * \return _______________.
+ */
+ unsigned long GetnSurfacePoint(void);
+
+ /*!
+ * \brief _______________.
+ * \param[in] GetnParentFFDBox - _______________.
+ * \return _______________.
+ */
+ unsigned short GetnParentFFDBox(void);
+
+ /*!
+ * \brief _______________.
+ * \param[in] GetnChildFFDBox - _______________.
+ * \return _______________.
+ */
+ unsigned short GetnChildFFDBox(void);
+
+ /*!
+ * \brief _______________.
+ * \param[in] val_ParentFFDBox - _______________.
+ * \return _______________.
+ */
+ string GetParentFFDBoxTag(unsigned short val_ParentFFDBox);
+
+ /*!
+ * \brief _______________.
+ * \param[in] val_ChildFFDBox - _______________.
+ * \return _______________.
+ */
+ string GetChildFFDBoxTag(unsigned short val_ChildFFDBox);
+
+ /*!
+ * \brief Change the the position of the corners of the unitary FFDBox,
+ * and find the position of the control points for the FFDBox
+ * \param[in] FFDBox - Original FFDBox where we want to compute the control points.
+ */
+ void SetSupportCPChange(CFreeFormDefBox *FFDBox);
+
+ /*!
+ * \brief Set the number of corner points.
+ * \param[in] val_ncornerpoints - Number of corner points.
+ */
+ void SetnCornerPoints(unsigned short val_ncornerpoints);
+
+ /*!
+ * \brief Get the number of corner points.
+ * \return Number of corner points.
+ */
+ unsigned short GetnCornerPoints(void);
+
+ /*!
+ * \brief Get the number of control points.
+ * \return Number of control points.
+ */
+ unsigned short GetnControlPoints(void);
+
+ /*!
+ * \brief Get the number of control points.
+ * \return Number of control points.
+ */
+ void SetnControlPoints(void);
+
+ /*!
+ * \brief Get the number of numerical points on the surface.
+ * \return Number of numerical points on the surface.
+ */
+ unsigned long GetnSurfacePoints(void);
+
+ /*!
+ * \brief Set the corner point for the unitary FFDBox.
+ */
+ void SetUnitCornerPoints(void);
+
+ /*!
+ * \brief Set the coordinates of the corner points.
+ * \param[in] val_coord - Coordinates of the corner point with index val_icornerpoints.
+ * \param[in] val_icornerpoints - Index of the corner point.
+ */
+ void SetCoordCornerPoints(su2double *val_coord, unsigned short val_icornerpoints);
+
+ /*!
+ * \overload
+ * \param[in] val_xcoord - X coordinate of the corner point with index val_icornerpoints.
+ * \param[in] val_ycoord - Y coordinate of the corner point with index val_icornerpoints.
+ * \param[in] val_zcoord - Z coordinate of the corner point with index val_icornerpoints.
+ * \param[in] val_icornerpoints - Index of the corner point.
+ */
+ void SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints);
+
+ /*!
+ * \brief Set the coordinates of the control points.
+ * \param[in] val_coord - Coordinates of the control point.
+ * \param[in] iDegree - Index of the FFDBox, i direction.
+ * \param[in] jDegree - Index of the FFDBox, j direction.
+ * \param[in] kDegree - Index of the FFDBox, k direction.
+ */
+ void SetCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
+
+ /*!
+ * \brief Set the coordinates of the control points.
+ * \param[in] val_coord - Coordinates of the control point.
+ * \param[in] iDegree - Index of the FFDBox, i direction.
+ * \param[in] jDegree - Index of the FFDBox, j direction.
+ * \param[in] kDegree - Index of the FFDBox, k direction.
+ */
+ void SetCoordControlPoints_Copy(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
+
+ /*!
+ * \brief Set the coordinates of the control points.
+ * \param[in] val_coord - Coordinates of the control point.
+ * \param[in] iDegree - Index of the FFDBox, i direction.
+ * \param[in] jDegree - Index of the FFDBox, j direction.
+ * \param[in] kDegree - Index of the FFDBox, k direction.
+ */
+ void SetParCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree);
+
+ /*!
+ * \brief Get the coordinates of the corner points.
+ * \param[in] val_dim - Index of the coordinate (x, y, z).
+ * \param[in] val_icornerpoints - Index of the corner point.
+ * \return Coordinate val_dim of the corner point val_icornerpoints.
+ */
+ su2double GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints);
+
+ /*!
+ * \brief Get the coordinates of the corner points.
+ * \param[in] val_icornerpoints - Index of the corner point.
+ * \return Pointer to the coordinate vector of the corner point val_icornerpoints.
+ */
+ su2double *GetCoordCornerPoints(unsigned short val_icornerpoints);
+
+ /*!
+ * \brief Get the coordinates of the control point.
+ * \param[in] val_iindex - Value of the local i index of the control point.
+ * \param[in] val_jindex - Value of the local j index of the control point.
+ * \param[in] val_kindex - Value of the local k index of the control point.
+ * \return Pointer to the coordinate vector of the control point with local index (i, j, k).
+ */
+ su2double *GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex);
+
+ /*!
+ * \brief Get the parametric coordinates of the control point.
+ * \param[in] val_iindex - Value of the local i index of the control point.
+ * \param[in] val_jindex - Value of the local j index of the control point.
+ * \param[in] val_kindex - Value of the local k index of the control point.
+ * \return Pointer to the coordinate vector of the control point with local index (i, j, k).
+ */
+ su2double *GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex);
+
+ /*!
+ * \brief Set the control points in a parallelepiped (hexahedron).
+ */
+ void SetControlPoints_Parallelepiped(void);
+
+ /*!
+ * \brief Set the control points of the final chuck in a unitary hexahedron free form.
+ * \param[in] FFDBox - Original FFDBox where we want to compute the control points.
+ */
+ void SetSupportCP(CFreeFormDefBox *FFDBox);
+
+ /*!
+ * \brief Set the new value of the coordinates of the control points.
+ * \param[in] val_index - Local index (i, j, k) of the control point.
+ * \param[in] movement - Movement of the control point.
+ */
+ void SetControlPoints(unsigned short *val_index, su2double *movement);
+
+ /*!
+ * \brief Set the original value of the control points.
+ */
+ void SetOriginalControlPoints(void);
+
+ /*!
+ * \brief Set the tecplot file of the FFD chuck structure.
+ * \param[in] iFFDBox - Index of the FFD box.
+ * \param[in] original - Original box (before deformation).
+ */
+ void SetTecplot(CGeometry *geometry, unsigned short iFFDBox, bool original);
+
+ /*!
+ * \brief Set the cartesian coords of a point in R^3 and convert them to the parametric coords of
+ * our parametrization of a paralellepiped.
+ * \param[in] cart_coord - Cartesian coordinates of a point.
+ * \return Pointer to the parametric coordinates of a point.
+ */
+ su2double *GetParametricCoord_Analytical(su2double *cart_coord);
+
+ /*!
+ * \brief Iterative strategy for computing the parametric coordinates.
+ * \param[in] xyz - Cartesians coordinates of the target point.
+ * \param[in] guess - Initial guess for doing the parametric coordinates search.
+ * \param[in] tol - Level of convergence of the iterative method.
+ * \param[in] it_max - Maximal number of iterations.
+ * \return Parametric coordinates of the point.
+ */
+ su2double *GetParametricCoord_Iterative(unsigned long iPoint, su2double *xyz, su2double *guess, CConfig *config);
+
+ /*!
+ * \brief Compute the cross product.
+ * \param[in] v1 - First input vector.
+ * \param[in] v2 - Second input vector.
+ * \param[out] v3 - Output vector wuth the cross product.
+ */
+ void CrossProduct(su2double *v1, su2double *v2, su2double *v3);
+
+ /*!
+ * \brief Compute the doc product.
+ * \param[in] v1 - First input vector.
+ * \param[in] v2 - Sencond input vector.
+ * \return Dot product between v1, and v2.
+ */
+ su2double DotProduct(su2double *v1, su2double *v2);
+
+ /*!
+ * \brief Here we take the parametric coords of a point in the box and we convert them to the
+ * physical cartesian coords by plugging the ParamCoords on the Bezier parameterization of our box.
+ * \param[in] ParamCoord - Parametric coordinates of a point.
+ * \return Pointer to the cartesian coordinates of a point.
+ */
+ su2double *EvalCartesianCoord(su2double *ParamCoord);
+
+ /*!
+ * \brief Set the Bernstein polynomial, defined as B_i^n(t) = Binomial(n, i)*t^i*(1-t)^(n-i).
+ * \param[in] val_n - Degree of the Bernstein polynomial.
+ * \param[in] val_i - Order of the Bernstein polynomial.
+ * \param[in] val_t - Value of the parameter where the polynomial is evaluated.
+ * \return Value of the Bernstein polynomial.
+ */
+ su2double GetBernstein(short val_n, short val_i, su2double val_t);
+
+ /*!
+ * \brief Get the binomial coefficient n over i, defined as n!/(m!(n-m)!)
+ * \note If the denominator is 0, the value is 1.
+ * \param[in] n - Upper coefficient.
+ * \param[in] m - Lower coefficient.
+ * \return Value of the binomial coefficient n over m.
+ */
+ unsigned long Binomial(unsigned short n, unsigned short m);
+
+ /*!
+ * \brief Get the order in the l direction of the FFD FFDBox.
+ * \return Order in the l direction of the FFD FFDBox.
+ */
+ unsigned short GetlOrder(void);
+
+ /*!
+ * \brief Get the order in the m direction of the FFD FFDBox.
+ * \return Order in the m direction of the FFD FFDBox.
+ */
+ unsigned short GetmOrder(void);
+
+ /*!
+ * \brief Get the order in the n direction of the FFD FFDBox.
+ * \return Order in the n direction of the FFD FFDBox.
+ */
+ unsigned short GetnOrder(void);
+
+ /*!
+ * \brief Get the order in the l direction of the FFD FFDBox.
+ * \return Order in the l direction of the FFD FFDBox.
+ */
+ void SetlOrder(unsigned short val_lOrder);
+
+ /*!
+ * \brief Get the order in the m direction of the FFD FFDBox.
+ * \return Order in the m direction of the FFD FFDBox.
+ */
+ void SetmOrder(unsigned short val_mOrder);
+
+ /*!
+ * \brief Get the order in the n direction of the FFD FFDBox.
+ * \return Order in the n direction of the FFD FFDBox.
+ */
+ void SetnOrder(unsigned short val_nOrder);
+
+ /*!
+ * \brief Set, at each vertex, the index of the free form FFDBox that contains the vertex.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iFFDBox - Index of the FFDBox.
+ */
+ bool GetPointFFD(CGeometry *geometry, CConfig *config, unsigned long iPoint);
+
+ /*!
+ * \brief Set the zone of the computational domain that is going to be deformed.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iFFDBox - Index of the FFDBox.
+ */
+ void SetDeformationZone(CGeometry *geometry, CConfig *config, unsigned short iFFDBox);
+
+ /*!
+ * \brief The "order" derivative of the i-th Bernstein polynomial of degree n, evaluated at t,
+ * is calculated as (B_i^n(t))^{order}(t) = n*(GetBernstein(n-1, i-1, t)-GetBernstein(n-1, i, t)),
+ * having in account that if i=0, GetBernstein(n-1,-1, t) = 0.
+ * \param[in] val_n - Degree of the Bernstein polynomial.
+ * \param[in] val_i - Order of the Bernstein polynomial.
+ * \param[in] val_t - Value of the parameter where the polynomial is evaluated.
+ * \param[in] val_order - Order of the derivative.
+ * \return Value of the Derivative of the Bernstein polynomial.
+ */
+ su2double GetBernsteinDerivative(short val_n, short val_i, su2double val_t, short val_order);
+
+ /*!
+ * \brief The routine computes the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w).
+ * \param[in] val_coord - Parametric coordiates of the target point.
+ * \param[in] xyz - Cartesians coordinates of the point.
+ * \param[in] analytical - Compute the analytical gradient.
+ * \return Value of the analytical gradient.
+ */
+ su2double *GetFFDGradient(su2double *val_coord, su2double *xyz);
+
+ /*!
+ * \brief The routine that computes the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w)
+ * Input: (u, v, w), (x, y, z)
+ * Output: Hessian F (u, v, w).
+ * \param[in] uvw - Current value of the parametrics coordinates.
+ * \param[in] xyz - Cartesians coordinates of the target point to compose the functional.
+ * \param[in] val_Hessian - Value of the hessian.
+ */
+ void GetFFDHessian(su2double *uvw, su2double *xyz, su2double **val_Hessian);
+
+ /*!
+ * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
+ * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2
+ * Input: val_t, val_diff (to identify the index of the Bernstein polynomail we differentiate), the i, j, k , l, m, n
+ * E.G.: val_diff=2 => we differentiate w.r.t. w (val_diff=0,1, or 2) Output: d [B_i^l*B_j^m *B_k^n] / d val_diff
+ * (val_u, val_v, val_w).
+ * \param[in] uvw - __________.
+ * \param[in] val_diff - __________.
+ * \param[in] ijk - __________.
+ * \param[in] lmn - Degree of the FFD box.
+ * \return __________.
+ */
+ su2double GetDerivative1(su2double *uvw, unsigned short val_diff, unsigned short *ijk, unsigned short *lmn);
+
+ /*!
+ * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
+ * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2
+ * Input: (u, v, w), dim , xyz=(x, y, z), l, m, n E.G.: dim=2 => we use the third coordinate of the control points,
+ * and the z-coordinate of xyz (0<=dim<=2) Output: 2* ( (Sum_{i, j, k}^l, m, n P_{ijk}[dim] B_i^l[u] B_j^m[v] B_k^n[w]) -
+ * xyz[dim]).
+ * \param[in] uvw - __________.
+ * \param[in] dim - __________.
+ * \param[in] xyz - __________.
+ * \param[in] lmn - Degree of the FFD box.
+ * \return __________.
+ */
+ su2double GetDerivative2(su2double *uvw, unsigned short dim, su2double *xyz, unsigned short *lmn);
+
+ /*!
+ * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
+ * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
+ * \param[in] uvw - Parametric coordiates of the point.
+ * \param[in] dim - Value of the coordinate to be differentiate.
+ * \param[in] diff_this - Diferentiation with respect this coordinate.
+ * \param[in] lmn - Degree of the FFD box.
+ * \return Sum_{i, j, k}^{l, m, n} [one of them with -1,
+ * depending on diff_this=0,1 or 2] P_{ijk}[dim] * (B_i^l[u] B_j^m[v] B_k^n[w])--one of them diffrentiated;
+ * which? diff_thiss will tell us ; E.G.: dim=2, diff_this=1 => we use the third coordinate of the control
+ * points, and derivate de v-Bersntein polynomial (use m-1 when summing!!).
+ */
+ su2double GetDerivative3(su2double *uvw, unsigned short dim, unsigned short diff_this,
+ unsigned short *lmn);
+
+ /*!
+ * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
+ * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
+ * Input: val_t, val_diff, val_diff2 (to identify the index of the Bernstein polynomials we differentiate), the i, j, k , l, m, n
+ * E.G.: val_diff=1, val_diff2=2 => we differentiate w.r.t. v and w (val_diff=0,1, or 2)
+ * E.G.: val_diff=0, val_diff2=0 => we differentiate w.r.t. u two times
+ * Output: [d [B_i^l*B_j^m *B_k^n]/d val_diff *d [B_i^l*B_j^m *B_k^n]/d val_diff2] (val_u, val_v, val_w) .
+ * \param[in] uvw - __________.
+ * \param[in] val_diff - __________.
+ * \param[in] val_diff2 - __________.
+ * \param[in] ijk - __________.
+ * \param[in] lmn - Degree of the FFD box.
+ * \return __________.
+ */
+ su2double GetDerivative4(su2double *uvw, unsigned short val_diff, unsigned short val_diff2,
+ unsigned short *ijk, unsigned short *lmn);
+
+ /*!
+ * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 =
+ * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)
+ * Input: (u, v, w), dim , diff_this, diff_this_also, xyz=(x, y, z), l, m, n
+ * Output:
+ * Sum_{i, j, k}^{l, m, n} [two of them with -1, depending on diff_this, diff_this_also=0,1 or 2]
+ * P_{ijk}[dim] * (B_i^l[u] B_j^m[v] B_k^n[w])--one of them diffrentiated; which? diff_thiss will tell us ;
+ * E.G.: dim=2, diff_this=1 => we use the third coordinate of the control points, and derivate de v-Bersntein
+ * polynomial (use m-1 when summing!!).
+ * \param[in] uvw - __________.
+ * \param[in] dim - __________.
+ * \param[in] diff_this - __________.
+ * \param[in] diff_this_also - __________.
+ * \param[in] lmn - Degree of the FFD box.
+ * \return __________.
+ */
+ su2double GetDerivative5(su2double *uvw, unsigned short dim, unsigned short diff_this, unsigned short diff_this_also,
+ unsigned short *lmn);
+
+ /*!
+ * \brief Euclidean norm of a vector.
+ * \param[in] a - _______.
+ * \return __________.
+ */
+ su2double GetNorm(su2double *a);
+
+ /*!
+ * \brief Set the tag that identify a FFDBox.
+ * \param[in] val_tag - value of the tag.
+ */
+ void SetTag(string val_tag);
+
+ /*!
+ * \brief Get the tag that identify a FFDBox.
+ * \return Value of the tag that identigy the FFDBox.
+ */
+ string GetTag(void);
+
+ /*!
+ * \brief Set the nested level of the FFDBox.
+ * \param[in] val_level - value of the level.
+ */
+ void SetLevel(unsigned short val_level);
+
+ /*!
+ * \brief Get the nested level of the FFDBox.
+ * \return Value of the nested level of the the FFDBox.
+ */
+ unsigned short GetLevel(void);
+
+ /*!
+ * \brief Compute the determinant of a 3 by 3 matrix.
+ * \param[in] val_matrix 3 by 3 matrix.
+ * \result Determinant of the matrix
+ */
+ su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11,
+ su2double A12, su2double A20, su2double A21, su2double A22);
+
+};
+
+/*!
+ * \class CVolumetricMovement
+ * \brief Class for moving the volumetric numerical grid.
+ * \author F. Palacios, A. Bueno, T. Economon, S. Padron.
+ * \version 4.0.1 "Cardinal"
+ */
+class CVolumetricMovement : public CGridMovement {
+protected:
+
+ unsigned short nDim; /*!< \brief Number of dimensions. */
+ unsigned short nVar; /*!< \brief Number of variables. */
+
+ unsigned long nPoint; /*!< \brief Number of points. */
+ unsigned long nPointDomain; /*!< \brief Number of points in the domain. */
+
+ CSysMatrix StiffMatrix; /*!< \brief Matrix to store the point-to-point stiffness. */
+ CSysVector LinSysSol;
+ CSysVector LinSysRes;
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ */
+ CVolumetricMovement(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CVolumetricMovement(void);
+
+ /*!
+ * \brief Update the value of the coordinates after the grid movement.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void UpdateGridCoord(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Update the dual grid after the grid movement (edges and control volumes).
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void UpdateDualGrid(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Update the coarse multigrid levels after the grid movement.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void UpdateMultiGrid(CGeometry **geometry, CConfig *config);
+
+ /*!
+ * \brief Compute the stiffness matrix for grid deformation using spring analogy.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \return Value of the length of the smallest edge of the grid.
+ */
+ su2double SetFEAMethodContributions_Elem(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
+ * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
+ */
+ void SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double scale);
+
+ /*!
+ * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
+ * \param[in] CoordCorners - Index value for Node 1 of the current hexahedron.
+ */
+ void SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double scale);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] Mu - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] Mu - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] Mu - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] Mu - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Shape functions and derivative of the shape functions
+ * \param[in] Xi - Local coordinates.
+ * \param[in] Eta - Local coordinates.
+ * \param[in] CoordCorners - Coordiantes of the corners.
+ * \param[in] DShapeFunction - Shape function information
+ */
+ su2double ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetHexa_Volume(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetTetra_Volume(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetPrism_Volume(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetPyram_Volume(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetTriangle_Area(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Compute the shape functions for hexahedron
+ * \param[in] CoordCorners - coordinates of the cornes of the hexahedron.
+ */
+ su2double GetQuadrilateral_Area(su2double CoordCorners[8][3]);
+
+ /*!
+ * \brief Add the stiffness matrix for a 2-D triangular element to the global stiffness matrix for the entire mesh (node-based).
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled.
+ * \param[in] PointCorners
+ * \param[in] nNodes
+ */
+ void AddFEA_StiffMatrix(CGeometry *geometry, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], unsigned short nNodes);
+
+ /*!
+ * \brief Check for negative volumes (all elements) after performing grid deformation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ */
+ su2double Check_Grid(CGeometry *geometry);
+
+ /*!
+ * \brief Compute the minimum distance to the nearest deforming surface.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void ComputeDeforming_Wall_Distance(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Check the boundary vertex that are going to be moved.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetBoundaryDisplacements(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Check the domain points vertex that are going to be moved.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetDomainDisplacements(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Unsteady grid movement using rigid mesh rotation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Physical time iteration number.
+ */
+ void Rigid_Rotation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Unsteady pitching grid movement using rigid mesh motion.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Physical time iteration number.
+ */
+ void Rigid_Pitching(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Unsteady plunging grid movement using rigid mesh motion.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Physical time iteration number.
+ */
+ void Rigid_Plunging(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Unsteady translational grid movement using rigid mesh motion.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Physical time iteration number.
+ */
+ void Rigid_Translation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Scale the volume grid by a multiplicative factor.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] UpdateGeo - Update geometry.
+ */
+ void SetVolume_Scaling(CGeometry *geometry, CConfig *config, bool UpdateGeo);
+
+ /*!
+ * \brief Translate the volume grid by a specified displacement vector.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] UpdateGeo - Update geometry.
+ */
+ void SetVolume_Translation(CGeometry *geometry, CConfig *config, bool UpdateGeo);
+
+ /*!
+ * \brief Rotate the volume grid around a specified axis and angle.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] UpdateGeo - Update geometry.
+ */
+ void SetVolume_Rotation(CGeometry *geometry, CConfig *config, bool UpdateGeo);
+
+ /*!
+ * \brief Grid deformation using the spring analogy method.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] UpdateGeo - Update geometry.
+ * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled.
+ */
+ void SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative = false);
+
+ /*!
+ * \brief Set the derivatives of the boundary nodes.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetBoundaryDerivatives(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Update the derivatives of the coordinates after the grid movement.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void UpdateGridCoord_Derivatives(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Compute the determinant of a 3 by 3 matrix.
+ * 3 by 3 matrix elements
+ * \param[in] A00
+ * \param[in] A01
+ * \param[in] A02
+ * \param[in] A10
+ * \param[in] A11
+ * \param[in] A12
+ * \param[in] A20
+ * \param[in] A21
+ * \param[in] A22
+ * \result Determinant of the matrix
+ */
+ su2double Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22);
+
+};
+
+/*!
+ * \class CSurfaceMovement
+ * \brief Class for moving the surface numerical grid.
+ * \author F. Palacios, T. Economon.
+ * \version 4.0.1 "Cardinal"
+ */
+class CSurfaceMovement : public CGridMovement {
+protected:
+ CFreeFormDefBox** FFDBox; /*!< \brief Definition of the Free Form Deformation Box. */
+ unsigned short nFFDBox; /*!< \brief Number of FFD FFDBoxes. */
+ unsigned short nLevel; /*!< \brief Level of the FFD FFDBoxes (parent/child). */
+ bool FFDBoxDefinition; /*!< \brief If the FFD FFDBox has been defined in the input file. */
+ vector GlobalCoordX[MAX_NUMBER_FFD];
+ vector GlobalCoordY[MAX_NUMBER_FFD];
+ vector GlobalCoordZ[MAX_NUMBER_FFD];
+ vector GlobalTag[MAX_NUMBER_FFD];
+ vector GlobalPoint[MAX_NUMBER_FFD];
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ */
+ CSurfaceMovement(void);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CSurfaceMovement(void);
+
+ /*!
+ * \brief Set a Hicks-Henne deformation bump functions on an airfoil.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetHicksHenne(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a NACA 4 digits airfoil family for airfoil deformation.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetNACA_4Digits(CGeometry *boundary, CConfig *config);
+
+ /*!
+ * \brief Set a parabolic family for airfoil deformation.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetParabolic(CGeometry *boundary, CConfig *config);
+
+ /*!
+ * \brief Set a obstacle in a channel.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetAirfoil(CGeometry *boundary, CConfig *config);
+
+ /*!
+ * \brief Set a rotation for surface movement.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetRotation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set the translational/rotational velocity for a moving wall.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Physical time iteration number.
+ */
+ void Moving_Walls(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Computes the displacement of a translating surface for a dynamic mesh simulation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iter - Current physical time iteration.
+ * \param[in] iZone - Zone number in the mesh.
+ */
+ void Surface_Translating(CGeometry *geometry, CConfig *config,
+ unsigned long iter, unsigned short iZone);
+
+ /*!
+ * \brief Computes the displacement of a plunging surface for a dynamic mesh simulation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iter - Current physical time iteration.
+ * \param[in] iZone - Zone number in the mesh.
+ */
+ void Surface_Plunging(CGeometry *geometry, CConfig *config,
+ unsigned long iter, unsigned short iZone);
+
+ /*!
+ * \brief Computes the displacement of a pitching surface for a dynamic mesh simulation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iter - Current physical time iteration.
+ * \param[in] iZone - Zone number in the mesh.
+ */
+ void Surface_Pitching(CGeometry *geometry, CConfig *config,
+ unsigned long iter, unsigned short iZone);
+
+ /*!
+ * \brief Computes the displacement of a rotating surface for a dynamic mesh simulation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iter - Current physical time iteration.
+ * \param[in] iZone - Zone number in the mesh.
+ */
+ void Surface_Rotating(CGeometry *geometry, CConfig *config,
+ unsigned long iter, unsigned short iZone);
+
+ /*!
+ * \brief Unsteady aeroelastic grid movement by deforming the mesh.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] ExtIter - Physical iteration number.
+ * \param[in] iMarker - Marker to deform.
+ * \param[in] iMarker_Monitoring - Marker we are monitoring.
+ * \param[in] displacements - solution of typical section wing model.
+ */
+ void AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long ExtIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements);
+
+ /*!
+ * \brief Deforms a 3-D flutter/pitching surface during an unsteady simulation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iter - Current physical time iteration.
+ * \param[in] iZone - Zone number in the mesh.
+ */
+ void SetBoundary_Flutter3D(CGeometry *geometry, CConfig *config,
+ CFreeFormDefBox **FFDBox, unsigned long iter, unsigned short iZone);
+
+ /*!
+ * \brief Set the collective pitch for a blade surface movement.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetCollective_Pitch(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Set any surface deformationsbased on an input file.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iZone - Zone number in the mesh.
+ * \param[in] iter - Current physical time iteration.
+ */
+ void SetExternal_Deformation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter);
+
+ /*!
+ * \brief Set a displacement for surface movement.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetTranslation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a displacement for surface movement.
+ * \param[in] boundary - Geometry of the boundary.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetScale(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Copy the boundary coordinates to each vertex.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void CopyBoundary(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Set the surface/boundary deformation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetSurface_Deformation(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Compute the parametric coordinates of a grid point using a point inversion strategy
+ * in the free form FFDBox.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ */
+ void SetParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
+
+ /*!
+ * \brief Update the parametric coordinates of a grid point using a point inversion strategy
+ * in the free form FFDBox.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iFFDBox - _____________________.
+ */
+ void UpdateParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
+
+ /*!
+ * \brief Check the intersections of the FFD with the surface
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iFFDBox - _____________________.
+ */
+ void CheckFFDIntersections(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
+
+ /*!
+ * \brief _____________________.
+ * \param[in] geometry - _____________________.
+ * \param[in] config - _____________________.
+ * \param[in] FFDBoxParent - _____________________.
+ * \param[in] FFDBoxChild - _____________________.
+ */
+ void SetParametricCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild);
+
+ /*!
+ * \brief _____________________.
+ * \param[in] geometry - _____________________.
+ * \param[in] config - _____________________.
+ * \param[in] FFDBoxParent - _____________________.
+ * \param[in] FFDBoxChild - _____________________.
+ */
+ void GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild);
+
+ /*!
+ * \brief Recompute the cartesian coordinates using the control points position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iFFDBox - _____________________.
+ */
+ void SetCartesianCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox);
+
+ /*!
+ * \brief Set the deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set the deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDCPChange(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a camber deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDCamber_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a thickness deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDThickness_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a camber deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDCamber(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a thickness deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDThickness(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a dihedral angle deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDDihedralAngle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a twist angle deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDTwistAngle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a rotation angle deformation of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDRotation(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Set a rotation angle deformation in a control surface of the Free From box using the control point position.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] iDV - Index of the design variable.
+ * \param[in] ResetDef - Reset the deformation before starting a new one.
+ */
+ void SetFFDControl_Surface(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iDV, bool ResetDef);
+
+ /*!
+ * \brief Read the free form information from the grid input file.
+ * \note If there is no control point information, and no parametric
+ * coordinates information, the code will compute that information.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ * \param[in] val_mesh_filename - Name of the grid input file.
+ */
+ void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, string val_mesh_filename);
+
+ /*!
+ * \brief Read the free form information from the grid input file.
+ * \note If there is no control point information, and no parametric
+ * coordinates information, the code will compute that information.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
+ */
+ void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox);
+
+ /*!
+ * \brief Merge the Free Form information in the SU2 file.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] val_mesh_filename - Name of the grid output file.
+ */
+ void MergeFFDInfo(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Write the Free Form information in the SU2 file.
+ * \param[in] config - Definition of the particular problem.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] val_mesh_filename - Name of the grid output file.
+ */
+ void WriteFFDInfo(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Get information about if there is a complete FFDBox definition, or it is necessary to
+ * compute the parametric coordinates.
+ * \return TRUE
if the input grid file has a complete information; otherwise FALSE
.
+ */
+ bool GetFFDBoxDefinition(void);
+
+ /*!
+ * \brief Obtain the number of FFDBoxes.
+ * \return Number of FFD FFDBoxes.
+ */
+ unsigned short GetnFFDBox(void);
+
+ /*!
+ * \brief Obtain the number of levels.
+ * \return Number of FFD levels.
+ */
+ unsigned short GetnLevel(void);
+
+ /*!
+ * \brief Set derivatives of the surface/boundary deformation.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetSurface_Derivative(CGeometry *geometry, CConfig *config);
+};
+
+#include "grid_movement_structure.inl"
diff --git a/Common/include/grid_movement_structure.inl b/Common/include/grid_movement_structure.inl
index 3608d63fd96..7510585acb8 100644
--- a/Common/include/grid_movement_structure.inl
+++ b/Common/include/grid_movement_structure.inl
@@ -1,213 +1,213 @@
-/*!
- * \file grid_movement_structure.inl
- * \brief In-Line subroutines of the grid_movement_structure.hpp file.
- * \author F. Palacios, T. Economon, S. Padron
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-inline void CGridMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *config) { }
-
-inline unsigned short CSurfaceMovement::GetnLevel(void) { return nLevel; }
-
-inline unsigned short CSurfaceMovement::GetnFFDBox(void) { return nFFDBox; }
-
-inline bool CSurfaceMovement::GetFFDBoxDefinition(void) { return FFDBoxDefinition; }
-
-inline void CFreeFormDefBox::Set_Fix_IPlane(unsigned short val_plane) { Fix_IPlane.push_back(val_plane); }
-
-inline void CFreeFormDefBox::Set_Fix_JPlane(unsigned short val_plane) { Fix_JPlane.push_back(val_plane); }
-
-inline void CFreeFormDefBox::Set_Fix_KPlane(unsigned short val_plane) { Fix_KPlane.push_back(val_plane); }
-
-inline unsigned short CFreeFormDefBox::Get_Fix_IPlane(unsigned short val_index) { return Fix_IPlane[val_index]; }
-
-inline unsigned short CFreeFormDefBox::Get_Fix_JPlane(unsigned short val_index) { return Fix_JPlane[val_index]; }
-
-inline unsigned short CFreeFormDefBox::Get_Fix_KPlane(unsigned short val_index) { return Fix_KPlane[val_index]; }
-
-inline unsigned short CFreeFormDefBox::Get_nFix_IPlane(void) { return Fix_IPlane.size(); }
-
-inline unsigned short CFreeFormDefBox::Get_nFix_JPlane(void) { return Fix_JPlane.size(); }
-
-inline unsigned short CFreeFormDefBox::Get_nFix_KPlane(void) { return Fix_KPlane.size(); }
-
-inline void CFreeFormDefBox::Set_MarkerIndex(unsigned short val_iMarker) { MarkerIndex.push_back(val_iMarker); }
-
-inline void CFreeFormDefBox::SetParentFFDBox(string val_iParentFFDBox) { ParentFFDBox.push_back(val_iParentFFDBox); }
-
-inline void CFreeFormDefBox::SetChildFFDBox(string val_iChildFFDBox) { ChildFFDBox.push_back(val_iChildFFDBox); }
-
-inline void CFreeFormDefBox::Set_VertexIndex(unsigned long val_iVertex) { VertexIndex.push_back(val_iVertex); }
-
-inline void CFreeFormDefBox::Set_PointIndex(unsigned long val_iPoint) { PointIndex.push_back(val_iPoint); }
-
-inline void CFreeFormDefBox::Set_CartesianCoord(su2double *val_coord) { CartesianCoord[0].push_back(val_coord[0]);
- CartesianCoord[1].push_back(val_coord[1]);
- CartesianCoord[2].push_back(val_coord[2]); }
-
-inline void CFreeFormDefBox::Set_CartesianCoord(su2double *val_coord, unsigned long val_iSurfacePoints) { CartesianCoord[0][val_iSurfacePoints] = val_coord[0];
- CartesianCoord[1][val_iSurfacePoints] = val_coord[1];
- CartesianCoord[2][val_iSurfacePoints] = val_coord[2]; }
-
-inline void CFreeFormDefBox::Set_ParametricCoord(su2double *val_coord) { ParametricCoord[0].push_back(val_coord[0]);
- ParametricCoord[1].push_back(val_coord[1]);
- ParametricCoord[2].push_back(val_coord[2]); }
-
-inline void CFreeFormDefBox::Set_ParametricCoord(su2double *val_coord, unsigned long val_iSurfacePoints) { ParametricCoord[0][val_iSurfacePoints] = val_coord[0];
- ParametricCoord[1][val_iSurfacePoints] = val_coord[1];
- ParametricCoord[2][val_iSurfacePoints] = val_coord[2]; }
-
-inline unsigned short CFreeFormDefBox::Get_MarkerIndex(unsigned long val_iSurfacePoints) { return MarkerIndex[val_iSurfacePoints]; }
-
-inline unsigned short CFreeFormDefBox::GetnParentFFDBox(void) { return ParentFFDBox.size(); }
-
-inline unsigned short CFreeFormDefBox::GetnChildFFDBox(void) { return ChildFFDBox.size(); }
-
-inline string CFreeFormDefBox::GetParentFFDBoxTag(unsigned short val_ParentFFDBox) { return ParentFFDBox[val_ParentFFDBox]; }
-
-inline string CFreeFormDefBox::GetChildFFDBoxTag(unsigned short val_ChildFFDBox) { return ChildFFDBox[val_ChildFFDBox]; }
-
-inline unsigned long CFreeFormDefBox::Get_VertexIndex(unsigned long val_iSurfacePoints) { return VertexIndex[val_iSurfacePoints]; }
-
-inline unsigned long CFreeFormDefBox::Get_PointIndex(unsigned long val_iSurfacePoints) { return PointIndex[val_iSurfacePoints]; }
-
-inline su2double *CFreeFormDefBox::Get_CartesianCoord(unsigned long val_iSurfacePoints) {
- cart_coord_[0] = CartesianCoord[0][val_iSurfacePoints];
- cart_coord_[1] = CartesianCoord[1][val_iSurfacePoints];
- cart_coord_[2] = CartesianCoord[2][val_iSurfacePoints];
- return cart_coord_; }
-
-inline su2double *CFreeFormDefBox::Get_ParametricCoord(unsigned long val_iSurfacePoints) {
- ParamCoord_[0] = ParametricCoord[0][val_iSurfacePoints];
- ParamCoord_[1] = ParametricCoord[1][val_iSurfacePoints];
- ParamCoord_[2] = ParametricCoord[2][val_iSurfacePoints];
- return ParamCoord_; }
-
-inline unsigned long CFreeFormDefBox::GetnSurfacePoint(void) { return PointIndex.size(); }
-
-inline void CFreeFormDefBox::SetnCornerPoints(unsigned short val_ncornerpoints) { nCornerPoints = val_ncornerpoints; }
-
-inline unsigned short CFreeFormDefBox::GetnCornerPoints(void) { return nCornerPoints; }
-
-inline unsigned short CFreeFormDefBox::GetnControlPoints(void) { return nControlPoints; }
-
-inline void CFreeFormDefBox::SetnControlPoints(void) { nControlPoints = lOrder*mOrder*nOrder; }
-
-inline unsigned long CFreeFormDefBox::GetnSurfacePoints(void) { return 0; }
-
-inline su2double *CFreeFormDefBox::GetCoordCornerPoints(unsigned short val_icornerpoints) { return Coord_Corner_Points[val_icornerpoints]; }
-
-inline su2double *CFreeFormDefBox::GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) { return Coord_Control_Points[val_iindex][val_jindex][val_kindex]; }
-
-inline su2double *CFreeFormDefBox::GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) { return ParCoord_Control_Points[val_iindex][val_jindex][val_kindex]; }
-
-inline su2double CFreeFormDefBox::GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints) { return Coord_Corner_Points[val_icornerpoints][val_dim]; }
-
-inline unsigned short CFreeFormDefBox::GetlOrder(void) { return lOrder; }
-
-inline unsigned short CFreeFormDefBox::GetmOrder(void) { return mOrder; }
-
-inline unsigned short CFreeFormDefBox::GetnOrder(void) { return nOrder; }
-
-inline void CFreeFormDefBox::SetlOrder(unsigned short val_lOrder) { lOrder = val_lOrder; lDegree = lOrder-1; }
-
-inline void CFreeFormDefBox::SetmOrder(unsigned short val_mOrder) { mOrder = val_mOrder; mDegree = mOrder-1; }
-
-inline void CFreeFormDefBox::SetnOrder(unsigned short val_nOrder) { nOrder = val_nOrder; nDegree = nOrder-1;}
-
-inline void CFreeFormDefBox::SetCoordCornerPoints(su2double *val_coord, unsigned short val_icornerpoints) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim];
-}
-
-inline void CFreeFormDefBox::SetCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++) {
- Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
- }
-}
-
-inline void CFreeFormDefBox::SetCoordControlPoints_Copy(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++) {
- Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
- }
-}
-
-inline void CFreeFormDefBox::SetParCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- ParCoord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
-}
-
-inline void CFreeFormDefBox::SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints) {
- Coord_Corner_Points[val_icornerpoints][0] = val_xcoord;
- Coord_Corner_Points[val_icornerpoints][1] = val_ycoord;
- Coord_Corner_Points[val_icornerpoints][2] = val_zcoord;
-}
-
-inline void CFreeFormDefBox::SetControlPoints(unsigned short *val_index, su2double *movement) {
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Control_Points[val_index[0]][val_index[1]][val_index[2]][iDim] += movement[iDim];
-}
-
-inline void CFreeFormDefBox::SetOriginalControlPoints() {
- for (unsigned short iDegree = 0; iDegree <= lDegree_Copy; iDegree++)
- for (unsigned short jDegree = 0; jDegree <= mDegree_Copy; jDegree++)
- for (unsigned short kDegree = 0; kDegree <= nDegree_Copy; kDegree++)
- for (unsigned short iDim = 0; iDim < nDim; iDim++)
- Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim];
-
- lDegree = lDegree_Copy; mDegree = mDegree_Copy; nDegree = nDegree_Copy;
- lOrder = lOrder_Copy; mOrder = mOrder_Copy; nOrder = nOrder_Copy;
- nControlPoints = nControlPoints_Copy;
-}
-
-inline void CFreeFormDefBox::CrossProduct (su2double *v1, su2double *v2, su2double *v3) {
- v3[0] = v1[1]*v2[2]-v1[2]*v2[1];
- v3[1] = v1[2]*v2[0]-v1[0]*v2[2];
- v3[2] = v1[0]*v2[1]-v1[1]*v2[0];
-}
-
-inline su2double CFreeFormDefBox::DotProduct (su2double *v1, su2double *v2) { su2double scalar = v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]; return scalar; }
-
-inline su2double CFreeFormDefBox::GetNorm(su2double *a) { su2double norm = sqrt(a[0]*a[0] + a[1]*a[1]+ a[2]*a[2]); return norm; }
-
-inline void CFreeFormDefBox::SetTag(string val_tag) { Tag = val_tag; }
-
-inline string CFreeFormDefBox::GetTag() { return Tag; }
-
-inline void CFreeFormDefBox::SetLevel(unsigned short val_level) { Level = val_level; }
-
-inline unsigned short CFreeFormDefBox::GetLevel() { return Level; }
-
-inline su2double CFreeFormDefBox::Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
- return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
-}
-
-inline su2double CVolumetricMovement::Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
- return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
-}
+/*!
+ * \file grid_movement_structure.inl
+ * \brief In-Line subroutines of the grid_movement_structure.hpp file.
+ * \author F. Palacios, T. Economon, S. Padron
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+inline void CGridMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *config) { }
+
+inline unsigned short CSurfaceMovement::GetnLevel(void) { return nLevel; }
+
+inline unsigned short CSurfaceMovement::GetnFFDBox(void) { return nFFDBox; }
+
+inline bool CSurfaceMovement::GetFFDBoxDefinition(void) { return FFDBoxDefinition; }
+
+inline void CFreeFormDefBox::Set_Fix_IPlane(unsigned short val_plane) { Fix_IPlane.push_back(val_plane); }
+
+inline void CFreeFormDefBox::Set_Fix_JPlane(unsigned short val_plane) { Fix_JPlane.push_back(val_plane); }
+
+inline void CFreeFormDefBox::Set_Fix_KPlane(unsigned short val_plane) { Fix_KPlane.push_back(val_plane); }
+
+inline unsigned short CFreeFormDefBox::Get_Fix_IPlane(unsigned short val_index) { return Fix_IPlane[val_index]; }
+
+inline unsigned short CFreeFormDefBox::Get_Fix_JPlane(unsigned short val_index) { return Fix_JPlane[val_index]; }
+
+inline unsigned short CFreeFormDefBox::Get_Fix_KPlane(unsigned short val_index) { return Fix_KPlane[val_index]; }
+
+inline unsigned short CFreeFormDefBox::Get_nFix_IPlane(void) { return Fix_IPlane.size(); }
+
+inline unsigned short CFreeFormDefBox::Get_nFix_JPlane(void) { return Fix_JPlane.size(); }
+
+inline unsigned short CFreeFormDefBox::Get_nFix_KPlane(void) { return Fix_KPlane.size(); }
+
+inline void CFreeFormDefBox::Set_MarkerIndex(unsigned short val_iMarker) { MarkerIndex.push_back(val_iMarker); }
+
+inline void CFreeFormDefBox::SetParentFFDBox(string val_iParentFFDBox) { ParentFFDBox.push_back(val_iParentFFDBox); }
+
+inline void CFreeFormDefBox::SetChildFFDBox(string val_iChildFFDBox) { ChildFFDBox.push_back(val_iChildFFDBox); }
+
+inline void CFreeFormDefBox::Set_VertexIndex(unsigned long val_iVertex) { VertexIndex.push_back(val_iVertex); }
+
+inline void CFreeFormDefBox::Set_PointIndex(unsigned long val_iPoint) { PointIndex.push_back(val_iPoint); }
+
+inline void CFreeFormDefBox::Set_CartesianCoord(su2double *val_coord) { CartesianCoord[0].push_back(val_coord[0]);
+ CartesianCoord[1].push_back(val_coord[1]);
+ CartesianCoord[2].push_back(val_coord[2]); }
+
+inline void CFreeFormDefBox::Set_CartesianCoord(su2double *val_coord, unsigned long val_iSurfacePoints) { CartesianCoord[0][val_iSurfacePoints] = val_coord[0];
+ CartesianCoord[1][val_iSurfacePoints] = val_coord[1];
+ CartesianCoord[2][val_iSurfacePoints] = val_coord[2]; }
+
+inline void CFreeFormDefBox::Set_ParametricCoord(su2double *val_coord) { ParametricCoord[0].push_back(val_coord[0]);
+ ParametricCoord[1].push_back(val_coord[1]);
+ ParametricCoord[2].push_back(val_coord[2]); }
+
+inline void CFreeFormDefBox::Set_ParametricCoord(su2double *val_coord, unsigned long val_iSurfacePoints) { ParametricCoord[0][val_iSurfacePoints] = val_coord[0];
+ ParametricCoord[1][val_iSurfacePoints] = val_coord[1];
+ ParametricCoord[2][val_iSurfacePoints] = val_coord[2]; }
+
+inline unsigned short CFreeFormDefBox::Get_MarkerIndex(unsigned long val_iSurfacePoints) { return MarkerIndex[val_iSurfacePoints]; }
+
+inline unsigned short CFreeFormDefBox::GetnParentFFDBox(void) { return ParentFFDBox.size(); }
+
+inline unsigned short CFreeFormDefBox::GetnChildFFDBox(void) { return ChildFFDBox.size(); }
+
+inline string CFreeFormDefBox::GetParentFFDBoxTag(unsigned short val_ParentFFDBox) { return ParentFFDBox[val_ParentFFDBox]; }
+
+inline string CFreeFormDefBox::GetChildFFDBoxTag(unsigned short val_ChildFFDBox) { return ChildFFDBox[val_ChildFFDBox]; }
+
+inline unsigned long CFreeFormDefBox::Get_VertexIndex(unsigned long val_iSurfacePoints) { return VertexIndex[val_iSurfacePoints]; }
+
+inline unsigned long CFreeFormDefBox::Get_PointIndex(unsigned long val_iSurfacePoints) { return PointIndex[val_iSurfacePoints]; }
+
+inline su2double *CFreeFormDefBox::Get_CartesianCoord(unsigned long val_iSurfacePoints) {
+ cart_coord_[0] = CartesianCoord[0][val_iSurfacePoints];
+ cart_coord_[1] = CartesianCoord[1][val_iSurfacePoints];
+ cart_coord_[2] = CartesianCoord[2][val_iSurfacePoints];
+ return cart_coord_; }
+
+inline su2double *CFreeFormDefBox::Get_ParametricCoord(unsigned long val_iSurfacePoints) {
+ ParamCoord_[0] = ParametricCoord[0][val_iSurfacePoints];
+ ParamCoord_[1] = ParametricCoord[1][val_iSurfacePoints];
+ ParamCoord_[2] = ParametricCoord[2][val_iSurfacePoints];
+ return ParamCoord_; }
+
+inline unsigned long CFreeFormDefBox::GetnSurfacePoint(void) { return PointIndex.size(); }
+
+inline void CFreeFormDefBox::SetnCornerPoints(unsigned short val_ncornerpoints) { nCornerPoints = val_ncornerpoints; }
+
+inline unsigned short CFreeFormDefBox::GetnCornerPoints(void) { return nCornerPoints; }
+
+inline unsigned short CFreeFormDefBox::GetnControlPoints(void) { return nControlPoints; }
+
+inline void CFreeFormDefBox::SetnControlPoints(void) { nControlPoints = lOrder*mOrder*nOrder; }
+
+inline unsigned long CFreeFormDefBox::GetnSurfacePoints(void) { return 0; }
+
+inline su2double *CFreeFormDefBox::GetCoordCornerPoints(unsigned short val_icornerpoints) { return Coord_Corner_Points[val_icornerpoints]; }
+
+inline su2double *CFreeFormDefBox::GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) { return Coord_Control_Points[val_iindex][val_jindex][val_kindex]; }
+
+inline su2double *CFreeFormDefBox::GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) { return ParCoord_Control_Points[val_iindex][val_jindex][val_kindex]; }
+
+inline su2double CFreeFormDefBox::GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints) { return Coord_Corner_Points[val_icornerpoints][val_dim]; }
+
+inline unsigned short CFreeFormDefBox::GetlOrder(void) { return lOrder; }
+
+inline unsigned short CFreeFormDefBox::GetmOrder(void) { return mOrder; }
+
+inline unsigned short CFreeFormDefBox::GetnOrder(void) { return nOrder; }
+
+inline void CFreeFormDefBox::SetlOrder(unsigned short val_lOrder) { lOrder = val_lOrder; lDegree = lOrder-1; }
+
+inline void CFreeFormDefBox::SetmOrder(unsigned short val_mOrder) { mOrder = val_mOrder; mDegree = mOrder-1; }
+
+inline void CFreeFormDefBox::SetnOrder(unsigned short val_nOrder) { nOrder = val_nOrder; nDegree = nOrder-1;}
+
+inline void CFreeFormDefBox::SetCoordCornerPoints(su2double *val_coord, unsigned short val_icornerpoints) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim];
+}
+
+inline void CFreeFormDefBox::SetCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++) {
+ Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
+ }
+}
+
+inline void CFreeFormDefBox::SetCoordControlPoints_Copy(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++) {
+ Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
+ }
+}
+
+inline void CFreeFormDefBox::SetParCoordControlPoints(su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ ParCoord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim];
+}
+
+inline void CFreeFormDefBox::SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints) {
+ Coord_Corner_Points[val_icornerpoints][0] = val_xcoord;
+ Coord_Corner_Points[val_icornerpoints][1] = val_ycoord;
+ Coord_Corner_Points[val_icornerpoints][2] = val_zcoord;
+}
+
+inline void CFreeFormDefBox::SetControlPoints(unsigned short *val_index, su2double *movement) {
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Control_Points[val_index[0]][val_index[1]][val_index[2]][iDim] += movement[iDim];
+}
+
+inline void CFreeFormDefBox::SetOriginalControlPoints() {
+ for (unsigned short iDegree = 0; iDegree <= lDegree_Copy; iDegree++)
+ for (unsigned short jDegree = 0; jDegree <= mDegree_Copy; jDegree++)
+ for (unsigned short kDegree = 0; kDegree <= nDegree_Copy; kDegree++)
+ for (unsigned short iDim = 0; iDim < nDim; iDim++)
+ Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim];
+
+ lDegree = lDegree_Copy; mDegree = mDegree_Copy; nDegree = nDegree_Copy;
+ lOrder = lOrder_Copy; mOrder = mOrder_Copy; nOrder = nOrder_Copy;
+ nControlPoints = nControlPoints_Copy;
+}
+
+inline void CFreeFormDefBox::CrossProduct (su2double *v1, su2double *v2, su2double *v3) {
+ v3[0] = v1[1]*v2[2]-v1[2]*v2[1];
+ v3[1] = v1[2]*v2[0]-v1[0]*v2[2];
+ v3[2] = v1[0]*v2[1]-v1[1]*v2[0];
+}
+
+inline su2double CFreeFormDefBox::DotProduct (su2double *v1, su2double *v2) { su2double scalar = v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]; return scalar; }
+
+inline su2double CFreeFormDefBox::GetNorm(su2double *a) { su2double norm = sqrt(a[0]*a[0] + a[1]*a[1]+ a[2]*a[2]); return norm; }
+
+inline void CFreeFormDefBox::SetTag(string val_tag) { Tag = val_tag; }
+
+inline string CFreeFormDefBox::GetTag() { return Tag; }
+
+inline void CFreeFormDefBox::SetLevel(unsigned short val_level) { Level = val_level; }
+
+inline unsigned short CFreeFormDefBox::GetLevel() { return Level; }
+
+inline su2double CFreeFormDefBox::Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
+ return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
+}
+
+inline su2double CVolumetricMovement::Determinant_3x3(su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
+ return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
+}
diff --git a/Common/include/matrix_structure.hpp b/Common/include/matrix_structure.hpp
index 41a309adef4..639a1c33e77 100644
--- a/Common/include/matrix_structure.hpp
+++ b/Common/include/matrix_structure.hpp
@@ -1,695 +1,695 @@
-/*!
- * \file matrix_structure.hpp
- * \brief Headers of the main subroutines for creating the sparse matrices-by-blocks.
- * The subroutines and functions are in the matrix_structure.cpp file.
- * \author F. Palacios, A. Bueno, T. Economon
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-#include "./mpi_structure.hpp"
-#include
-#include
-#include
-#include
-
-#include "config_structure.hpp"
-#include "geometry_structure.hpp"
-#include "vector_structure.hpp"
-
-using namespace std;
-
-const su2double eps = numeric_limits::epsilon(); /*!< \brief machine epsilon */
-
-
-/*!
- * \class CSysMatrix
- * \brief Main class for defining sparse matrices-by-blocks
- with compressed row format.
- * \author A. Bueno, F. Palacios
- * \version 4.0.1 "Cardinal"
- */
-class CSysMatrix {
-private:
- unsigned long nPoint, /*!< \brief Number of points in the grid. */
- nPointDomain, /*!< \brief Number of points in the grid. */
- nVar, /*!< \brief Number of variables. */
- nEqn; /*!< \brief Number of equations. */
- su2double *matrix; /*!< \brief Entries of the sparse matrix. */
- su2double *ILU_matrix; /*!< \brief Entries of the ILU sparse matrix. */
- unsigned long *row_ptr; /*!< \brief Pointers to the first element in each row. */
- unsigned long *col_ind; /*!< \brief Column index for each of the elements in val(). */
- unsigned long nnz; /*!< \brief Number of possible nonzero entries in the matrix. */
- su2double *block; /*!< \brief Internal array to store a subblock of the matrix. */
- su2double *block_inverse; /*!< \brief Internal array to store a subblock of the matrix. */
- su2double *block_weight; /*!< \brief Internal array to store a subblock of the matrix. */
- su2double *prod_block_vector; /*!< \brief Internal array to store the product of a subblock with a vector. */
- su2double *prod_row_vector; /*!< \brief Internal array to store the product of a matrix-by-blocks "row" with a vector. */
- su2double *aux_vector; /*!< \brief Auxiliary array to store intermediate results. */
- su2double *sum_vector; /*!< \brief Auxiliary array to store intermediate results. */
- su2double *invM; /*!< \brief Inverse of (Jacobi) preconditioner. */
-
- bool *LineletBool; /*!< \brief Identify if a point belong to a linelet. */
- vector *LineletPoint; /*!< \brief Linelet structure. */
- unsigned long nLinelet; /*!< \brief Number of Linelets in the system. */
- su2double **UBlock, **invUBlock, **LBlock,
- **yVector, **zVector, **rVector, *LFBlock,
- *LyVector, *FzVector; /*!< \brief Arrays of the Linelet preconditioner methodology. */
- unsigned long max_nElem;
-
-public:
-
- /*!
- * \brief Constructor of the class.
- */
- CSysMatrix(void);
-
- /*!
- * \brief Destructor of the class.
- */
- ~CSysMatrix(void);
-
- /*!
- * \brief Initializes space matrix system.
- * \param[in] nVar - Number of variables.
- * \param[in] nEqn - Number of equations.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void Initialize(unsigned long nPoint, unsigned long nPointDomain, unsigned short nVar, unsigned short nEqn,
- bool EdgeConnect, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Assigns values to the sparse-matrix structure.
- * \param[in] val_nPoint - Number of points in the nPoint x nPoint block structure
- * \param[in] val_nVar - Number of nVar x nVar variables in each subblock of the matrix-by-block structure.
- * \param[in] val_nEq - Number of nEqn x nVar variables in each subblock of the matrix-by-block structure.
- * \param[in] val_row_ptr - Pointers to the first element in each row.
- * \param[in] val_col_ind - Column index for each of the elements in val().
- * \param[in] val_nnz - Number of possible nonzero entries in the matrix.
- * \param[in] config - Definition of the particular problem.
- */
- void SetIndexes(unsigned long val_nPoint, unsigned long val_nPointDomain, unsigned short val_nVar, unsigned short val_nEq, unsigned long* val_row_ptr, unsigned long* val_col_ind, unsigned long val_nnz, CConfig *config);
-
- /*!
- * \brief Sets to zero all the entries of the sparse matrix.
- */
- void SetValZero(void);
-
- /*!
- * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- */
- su2double *GetBlock(unsigned long block_i, unsigned long block_j);
-
- /*!
- * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- */
- su2double GetBlock(unsigned long block_i, unsigned long block_j, unsigned short iVar, unsigned short jVar);
-
- /*!
- * \brief Set the value of a block in the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to set to A(i, j).
- */
- void SetBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
-
- /*!
- * \brief Set the value of a block in the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to set to A(i, j).
- */
- void SetBlock(unsigned long block_i, unsigned long block_j, su2double *val_block);
-
- /*!
- * \brief Adds the specified block to the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to add to A(i, j).
- */
- void AddBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
-
- /*!
- * \brief Subtracts the specified block to the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to subtract to A(i, j).
- */
- void SubtractBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
-
- /*!
- * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- */
- su2double *GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j);
-
- /*!
- * \brief Set the value of a block in the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to set to A(i, j).
- */
- void SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
-
-
- /*!
- * \brief Set the transposed value of a block in the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to set to A(i, j).
- */
- void SetBlockTransposed_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
-
- /*!
- * \brief Subtracts the specified block to the sparse matrix.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] **val_block - Block to subtract to A(i, j).
- */
- void SubtractBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
-
- /*!
- * \brief Adds the specified value to the diagonal of the (i, i) subblock
- * of the matrix-by-blocks structure.
- * \param[in] block_i - Index of the block in the matrix-by-blocks structure.
- * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i).
- */
- void AddVal2Diag(unsigned long block_i, su2double val_matrix);
-
- /*!
- * \brief Sets the specified value to the diagonal of the (i, i) subblock
- * of the matrix-by-blocks structure.
- * \param[in] block_i - Index of the block in the matrix-by-blocks structure.
- * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i).
- */
- void SetVal2Diag(unsigned long block_i, su2double val_matrix);
-
- /*!
- * \brief Calculates the matrix-vector product
- * \param[in] matrix
- * \param[in] vector
- * \param[out] product
- */
- void MatrixVectorProduct(su2double *matrix, su2double *vector, su2double *product);
-
- /*!
- * \brief Calculates the matrix-matrix product
- * \param[in] matrix_a
- * \param[in] matrix_b
- * \param[out] product
- */
- void MatrixMatrixProduct(su2double *matrix_a, su2double *matrix_b, su2double *product);
-
- /*!
- * \brief Deletes the values of the row i of the sparse matrix.
- * \param[in] i - Index of the row.
- */
- void DeleteValsRowi(unsigned long i);
-
- /*!
- * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
- * \param[in] block_i - Index of the (i, i) subblock in the matrix-by-blocks structure.
- * \param[in] rhs - Right-hand-side of the linear system.
- * \param[in] transposed - If true the transposed of the block is used (default = false).
- * \return Solution of the linear system (overwritten on rhs).
- */
- void Gauss_Elimination(unsigned long block_i, su2double* rhs, bool transposed = false);
-
- /*!
- * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
- * \param[in] Block - matrix-by-blocks structure.
- * \param[in] rhs - Right-hand-side of the linear system.
- * \return Solution of the linear system (overwritten on rhs).
- */
- void Gauss_Elimination(su2double* Block, su2double* rhs);
-
- /*!
- * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
- * \param[in] block_i - Index of the (i, i) subblock in the matrix-by-blocks structure.
- * \param[in] rhs - Right-hand-side of the linear system.
- * \return Solution of the linear system (overwritten on rhs).
- */
- void Gauss_Elimination_ILUMatrix(unsigned long block_i, su2double* rhs);
-
- /*!
- * \fn void CSysMatrix::ProdBlockVector(unsigned long block_i, unsigned long block_j, su2double* vec);
- * \brief Performs the product of the block (i, j) by vector vec.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
- * \param[in] vec - Vector to be multiplied by the block (i, j) of the sparse matrix A.
- * \return Product of A(i, j) by vector *vec (stored at *prod_block_vector).
- */
- void ProdBlockVector(unsigned long block_i, unsigned long block_j, const CSysVector & vec);
-
- /*!
- * \brief Performs the product of i-th row of the upper part of a sparse matrix by a vector.
- * \param[in] vec - Vector to be multiplied by the upper part of the sparse matrix A.
- * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
- * \return prod Result of the product U(A)*vec (stored at *prod_row_vector).
- */
- void UpperProduct(CSysVector & vec, unsigned long row_i);
-
- /*!
- * \brief Performs the product of i-th row of the lower part of a sparse matrix by a vector.
- * \param[in] vec - Vector to be multiplied by the lower part of the sparse matrix A.
- * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
- * \return prod Result of the product L(A)*vec (stored at *prod_row_vector).
- */
- void LowerProduct(CSysVector & vec, unsigned long row_i);
-
- /*!
- * \brief Performs the product of i-th row of the diagonal part of a sparse matrix by a vector.
- * \param[in] vec - Vector to be multiplied by the diagonal part of the sparse matrix A.
- * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
- * \return prod Result of the product D(A)*vec (stored at *prod_row_vector).
- */
- void DiagonalProduct(CSysVector & vec, unsigned long row_i);
-
- /*!
- * \brief Send receive the solution using MPI.
- * \param[in] x - Solution..
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SendReceive_Solution(CSysVector & x, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Send receive the solution using MPI and the transposed structure of the matrix.
- * \param[in] x - Solution..
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- void SendReceive_SolutionTransposed(CSysVector & x, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Performs the product of i-th row of a sparse matrix by a vector.
- * \param[in] vec - Vector to be multiplied by the row of the sparse matrix A.
- * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
- * \return Result of the product (stored at *prod_row_vector).
- */
- void RowProduct(const CSysVector & vec, unsigned long row_i);
-
- /*!
- * \brief Performs the product of a sparse matrix by a vector.
- * \param[in] vec - Vector to be multiplied by the sparse matrix A.
- * \param[out] prod - Result of the product.
- * \return Result of the product A*vec.
- */
- void MatrixVectorProduct(const CSysVector & vec, CSysVector & prod);
-
- /*!
- * \brief Performs the product of a sparse matrix by a CSysVector.
- * \param[in] vec - CSysVector to be multiplied by the sparse matrix A.
- * \param[out] prod - Result of the product.
- */
- void MatrixVectorProduct(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Performs the product of a sparse matrix by a CSysVector.
- * \param[in] vec - CSysVector to be multiplied by the sparse matrix A.
- * \param[out] prod - Result of the product.
- */
- void MatrixVectorProductTransposed(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Performs the product of two block matrices.
- */
- void GetMultBlockBlock(su2double *c, su2double *a, su2double *b);
-
- /*!
- * \brief Performs the product of a block matrices by a vector.
- */
- void GetMultBlockVector(su2double *c, su2double *a, su2double *b);
-
- /*!
- * \brief Performs the subtraction of two matrices.
- */
- void GetSubsBlock(su2double *c, su2double *a, su2double *b);
-
- /*!
- * \brief Performs the subtraction of two vectors.
- */
- void GetSubsVector(su2double *c, su2double *a, su2double *b);
-
- /*!
- * \brief Inverse diagonal block.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[out] invBlock - Inverse block.
- */
- void InverseDiagonalBlock(unsigned long block_i, su2double *invBlock, bool transpose = false);
-
- /*!
- * \brief Inverse diagonal block.
- * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
- * \param[out] invBlock - Inverse block.
- */
- void InverseDiagonalBlock_ILUMatrix(unsigned long block_i, su2double *invBlock);
-
- /*!
- * \brief Inverse a block.
- * \param[in] Block - block matrix.
- * \param[out] invBlock - Inverse block.
- */
- void InverseBlock(su2double *Block, su2double *invBlock);
-
- /*!
- * \brief Build the Jacobi preconditioner.
- */
- void BuildJacobiPreconditioner(bool transpose = false);
-
- /*!
- * \brief Multiply CSysVector by the preconditioner
- * \param[in] vec - CSysVector to be multiplied by the preconditioner.
- * \param[out] prod - Result of the product A*vec.
- */
- void ComputeJacobiPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Apply Jacobi as a classical iterative smoother
- * \param[in] b - CSysVector containing the residual (b)
- * \param[in] x - CSysVector containing the solution (x^k)
- * \param[in] mat_vec - object that defines matrix-vector product
- * \param[in] tol - tolerance with which to solve the system
- * \param[in] m - maximum size of the search subspace
- * \param[in] monitoring - turn on priting residuals from solver to screen.
- * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
- */
- unsigned long Jacobi_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Build the ILU0 preconditioner.
- * \param[in] transposed - Flag to use the transposed matrix to construct the preconditioner.
- */
- void BuildILUPreconditioner(bool transposed = false);
-
- /*!
- * \brief Multiply CSysVector by the preconditioner
- * \param[in] vec - CSysVector to be multiplied by the preconditioner.
- * \param[out] prod - Result of the product A*vec.
- */
- void ComputeILUPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Apply ILU0 as a classical iterative smoother
- * \param[in] b - CSysVector containing the residual (b)
- * \param[in] x - CSysVector containing the solution (x^k)
- * \param[in] mat_vec - object that defines matrix-vector product
- * \param[in] tol - tolerance with which to solve the system
- * \param[in] m - maximum size of the search subspace
- * \param[in] monitoring - turn on priting residuals from solver to screen.
- * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
- */
- unsigned long ILU0_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Multiply CSysVector by the preconditioner
- * \param[in] vec - CSysVector to be multiplied by the preconditioner.
- * \param[out] prod - Result of the product A*vec.
- */
- void ComputeLU_SGSPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
-/*!
- * \brief Apply LU_SGS as a classical iterative smoother
- * \param[in] b - CSysVector containing the residual (b)
- * \param[in] x - CSysVector containing the solution (x^k)
- * \param[in] mat_vec - object that defines matrix-vector product
- * \param[in] tol - tolerance with which to solve the system
- * \param[in] m - maximum size of the search subspace
- * \param[in] monitoring - turn on priting residuals from solver to screen.
- * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
- */
- unsigned long LU_SGS_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Build the Linelet preconditioner.
- * \param[in] geometry - Geometrical definition of the problem.
- * \param[in] config - Definition of the particular problem.
- */
- unsigned short BuildLineletPreconditioner(CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Multiply CSysVector by the preconditioner
- * \param[in] vec - CSysVector to be multiplied by the preconditioner.
- * \param[out] prod - Result of the product A*vec.
- */
- void ComputeLineletPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
-
- /*!
- * \brief Compute the residual Ax-b
- * \param[in] sol - CSysVector to be multiplied by the preconditioner.
- * \param[in] f - Result of the product A*vec.
- * \param[out] res - Result of the product A*vec.
- */
- void ComputeResidual(const CSysVector & sol, const CSysVector & f, CSysVector & res);
-
-};
-
-/*!
- * \class CSysMatrixVectorProduct
- * \brief specialization of matrix-vector product that uses CSysMatrix class
- */
-class CSysMatrixVectorProduct : public CMatrixVectorProduct {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the product. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the products
- */
- CSysMatrixVectorProduct(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CSysMatrixVectorProduct() {}
-
- /*!
- * \brief operator that defines the CSysMatrix-CSysVector product
- * \param[in] u - CSysVector that is being multiplied by the sparse matrix
- * \param[out] v - CSysVector that is the result of the product
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CSysMatrixVectorProduct
- * \brief specialization of matrix-vector product that uses CSysMatrix class
- */
-class CSysMatrixVectorProductTransposed : public CMatrixVectorProduct {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the product. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the products
- */
- CSysMatrixVectorProductTransposed(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CSysMatrixVectorProductTransposed() {}
-
- /*!
- * \brief operator that defines the CSysMatrix-CSysVector product
- * \param[in] u - CSysVector that is being multiplied by the sparse matrix
- * \param[out] v - CSysVector that is the result of the product
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CJacobiPreconditioner
- * \brief specialization of preconditioner that uses CSysMatrix class
- */
-class CJacobiPreconditioner : public CPreconditioner {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
- */
- CJacobiPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CJacobiPreconditioner() {}
-
- /*!
- * \brief operator that defines the preconditioner operation
- * \param[in] u - CSysVector that is being preconditioned
- * \param[out] v - CSysVector that is the result of the preconditioning
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CJacobiTransposedPreconditioner
- * \brief specialization of preconditioner that uses CSysMatrix class
- */
-class CJacobiTransposedPreconditioner : public CPreconditioner {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
- */
- CJacobiTransposedPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CJacobiTransposedPreconditioner() {}
-
- /*!
- * \brief operator that defines the preconditioner operation
- * \param[in] u - CSysVector that is being preconditioned
- * \param[out] v - CSysVector that is the result of the preconditioning
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CILUPreconditioner
- * \brief specialization of preconditioner that uses CSysMatrix class
- */
-class CILUPreconditioner : public CPreconditioner {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
- */
- CILUPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CILUPreconditioner() {}
-
- /*!
- * \brief operator that defines the preconditioner operation
- * \param[in] u - CSysVector that is being preconditioned
- * \param[out] v - CSysVector that is the result of the preconditioning
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CLU_SGSPreconditioner
- * \brief specialization of preconditioner that uses CSysMatrix class
- */
-class CLU_SGSPreconditioner : public CPreconditioner {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
- */
- CLU_SGSPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CLU_SGSPreconditioner() {}
-
- /*!
- * \brief operator that defines the preconditioner operation
- * \param[in] u - CSysVector that is being preconditioned
- * \param[out] v - CSysVector that is the result of the preconditioning
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-/*!
- * \class CLineletPreconditioner
- * \brief specialization of preconditioner that uses CSysMatrix class
- */
-class CLineletPreconditioner : public CPreconditioner {
-private:
- CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
- CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
- CConfig* config; /*!< \brief pointer to matrix that defines the config. */
-
-public:
-
- /*!
- * \brief constructor of the class
- * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
- */
- CLineletPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
-
- /*!
- * \brief destructor of the class
- */
- ~CLineletPreconditioner() {}
-
- /*!
- * \brief operator that defines the preconditioner operation
- * \param[in] u - CSysVector that is being preconditioned
- * \param[out] v - CSysVector that is the result of the preconditioning
- */
- void operator()(const CSysVector & u, CSysVector & v) const;
-};
-
-#include "matrix_structure.inl"
+/*!
+ * \file matrix_structure.hpp
+ * \brief Headers of the main subroutines for creating the sparse matrices-by-blocks.
+ * The subroutines and functions are in the matrix_structure.cpp file.
+ * \author F. Palacios, A. Bueno, T. Economon
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+#include "./mpi_structure.hpp"
+#include
+#include
+#include
+#include
+
+#include "config_structure.hpp"
+#include "geometry_structure.hpp"
+#include "vector_structure.hpp"
+
+using namespace std;
+
+const su2double eps = numeric_limits::epsilon(); /*!< \brief machine epsilon */
+
+
+/*!
+ * \class CSysMatrix
+ * \brief Main class for defining sparse matrices-by-blocks
+ with compressed row format.
+ * \author A. Bueno, F. Palacios
+ * \version 4.0.1 "Cardinal"
+ */
+class CSysMatrix {
+private:
+ unsigned long nPoint, /*!< \brief Number of points in the grid. */
+ nPointDomain, /*!< \brief Number of points in the grid. */
+ nVar, /*!< \brief Number of variables. */
+ nEqn; /*!< \brief Number of equations. */
+ su2double *matrix; /*!< \brief Entries of the sparse matrix. */
+ su2double *ILU_matrix; /*!< \brief Entries of the ILU sparse matrix. */
+ unsigned long *row_ptr; /*!< \brief Pointers to the first element in each row. */
+ unsigned long *col_ind; /*!< \brief Column index for each of the elements in val(). */
+ unsigned long nnz; /*!< \brief Number of possible nonzero entries in the matrix. */
+ su2double *block; /*!< \brief Internal array to store a subblock of the matrix. */
+ su2double *block_inverse; /*!< \brief Internal array to store a subblock of the matrix. */
+ su2double *block_weight; /*!< \brief Internal array to store a subblock of the matrix. */
+ su2double *prod_block_vector; /*!< \brief Internal array to store the product of a subblock with a vector. */
+ su2double *prod_row_vector; /*!< \brief Internal array to store the product of a matrix-by-blocks "row" with a vector. */
+ su2double *aux_vector; /*!< \brief Auxiliary array to store intermediate results. */
+ su2double *sum_vector; /*!< \brief Auxiliary array to store intermediate results. */
+ su2double *invM; /*!< \brief Inverse of (Jacobi) preconditioner. */
+
+ bool *LineletBool; /*!< \brief Identify if a point belong to a linelet. */
+ vector *LineletPoint; /*!< \brief Linelet structure. */
+ unsigned long nLinelet; /*!< \brief Number of Linelets in the system. */
+ su2double **UBlock, **invUBlock, **LBlock,
+ **yVector, **zVector, **rVector, *LFBlock,
+ *LyVector, *FzVector; /*!< \brief Arrays of the Linelet preconditioner methodology. */
+ unsigned long max_nElem;
+
+public:
+
+ /*!
+ * \brief Constructor of the class.
+ */
+ CSysMatrix(void);
+
+ /*!
+ * \brief Destructor of the class.
+ */
+ ~CSysMatrix(void);
+
+ /*!
+ * \brief Initializes space matrix system.
+ * \param[in] nVar - Number of variables.
+ * \param[in] nEqn - Number of equations.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void Initialize(unsigned long nPoint, unsigned long nPointDomain, unsigned short nVar, unsigned short nEqn,
+ bool EdgeConnect, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Assigns values to the sparse-matrix structure.
+ * \param[in] val_nPoint - Number of points in the nPoint x nPoint block structure
+ * \param[in] val_nVar - Number of nVar x nVar variables in each subblock of the matrix-by-block structure.
+ * \param[in] val_nEq - Number of nEqn x nVar variables in each subblock of the matrix-by-block structure.
+ * \param[in] val_row_ptr - Pointers to the first element in each row.
+ * \param[in] val_col_ind - Column index for each of the elements in val().
+ * \param[in] val_nnz - Number of possible nonzero entries in the matrix.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SetIndexes(unsigned long val_nPoint, unsigned long val_nPointDomain, unsigned short val_nVar, unsigned short val_nEq, unsigned long* val_row_ptr, unsigned long* val_col_ind, unsigned long val_nnz, CConfig *config);
+
+ /*!
+ * \brief Sets to zero all the entries of the sparse matrix.
+ */
+ void SetValZero(void);
+
+ /*!
+ * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ */
+ su2double *GetBlock(unsigned long block_i, unsigned long block_j);
+
+ /*!
+ * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ */
+ su2double GetBlock(unsigned long block_i, unsigned long block_j, unsigned short iVar, unsigned short jVar);
+
+ /*!
+ * \brief Set the value of a block in the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to set to A(i, j).
+ */
+ void SetBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
+
+ /*!
+ * \brief Set the value of a block in the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to set to A(i, j).
+ */
+ void SetBlock(unsigned long block_i, unsigned long block_j, su2double *val_block);
+
+ /*!
+ * \brief Adds the specified block to the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to add to A(i, j).
+ */
+ void AddBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
+
+ /*!
+ * \brief Subtracts the specified block to the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to subtract to A(i, j).
+ */
+ void SubtractBlock(unsigned long block_i, unsigned long block_j, su2double **val_block);
+
+ /*!
+ * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ */
+ su2double *GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j);
+
+ /*!
+ * \brief Set the value of a block in the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to set to A(i, j).
+ */
+ void SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
+
+
+ /*!
+ * \brief Set the transposed value of a block in the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to set to A(i, j).
+ */
+ void SetBlockTransposed_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
+
+ /*!
+ * \brief Subtracts the specified block to the sparse matrix.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] **val_block - Block to subtract to A(i, j).
+ */
+ void SubtractBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, su2double *val_block);
+
+ /*!
+ * \brief Adds the specified value to the diagonal of the (i, i) subblock
+ * of the matrix-by-blocks structure.
+ * \param[in] block_i - Index of the block in the matrix-by-blocks structure.
+ * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i).
+ */
+ void AddVal2Diag(unsigned long block_i, su2double val_matrix);
+
+ /*!
+ * \brief Sets the specified value to the diagonal of the (i, i) subblock
+ * of the matrix-by-blocks structure.
+ * \param[in] block_i - Index of the block in the matrix-by-blocks structure.
+ * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i).
+ */
+ void SetVal2Diag(unsigned long block_i, su2double val_matrix);
+
+ /*!
+ * \brief Calculates the matrix-vector product
+ * \param[in] matrix
+ * \param[in] vector
+ * \param[out] product
+ */
+ void MatrixVectorProduct(su2double *matrix, su2double *vector, su2double *product);
+
+ /*!
+ * \brief Calculates the matrix-matrix product
+ * \param[in] matrix_a
+ * \param[in] matrix_b
+ * \param[out] product
+ */
+ void MatrixMatrixProduct(su2double *matrix_a, su2double *matrix_b, su2double *product);
+
+ /*!
+ * \brief Deletes the values of the row i of the sparse matrix.
+ * \param[in] i - Index of the row.
+ */
+ void DeleteValsRowi(unsigned long i);
+
+ /*!
+ * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
+ * \param[in] block_i - Index of the (i, i) subblock in the matrix-by-blocks structure.
+ * \param[in] rhs - Right-hand-side of the linear system.
+ * \param[in] transposed - If true the transposed of the block is used (default = false).
+ * \return Solution of the linear system (overwritten on rhs).
+ */
+ void Gauss_Elimination(unsigned long block_i, su2double* rhs, bool transposed = false);
+
+ /*!
+ * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
+ * \param[in] Block - matrix-by-blocks structure.
+ * \param[in] rhs - Right-hand-side of the linear system.
+ * \return Solution of the linear system (overwritten on rhs).
+ */
+ void Gauss_Elimination(su2double* Block, su2double* rhs);
+
+ /*!
+ * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i, i) subblock and rhs.
+ * \param[in] block_i - Index of the (i, i) subblock in the matrix-by-blocks structure.
+ * \param[in] rhs - Right-hand-side of the linear system.
+ * \return Solution of the linear system (overwritten on rhs).
+ */
+ void Gauss_Elimination_ILUMatrix(unsigned long block_i, su2double* rhs);
+
+ /*!
+ * \fn void CSysMatrix::ProdBlockVector(unsigned long block_i, unsigned long block_j, su2double* vec);
+ * \brief Performs the product of the block (i, j) by vector vec.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure.
+ * \param[in] vec - Vector to be multiplied by the block (i, j) of the sparse matrix A.
+ * \return Product of A(i, j) by vector *vec (stored at *prod_block_vector).
+ */
+ void ProdBlockVector(unsigned long block_i, unsigned long block_j, const CSysVector & vec);
+
+ /*!
+ * \brief Performs the product of i-th row of the upper part of a sparse matrix by a vector.
+ * \param[in] vec - Vector to be multiplied by the upper part of the sparse matrix A.
+ * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
+ * \return prod Result of the product U(A)*vec (stored at *prod_row_vector).
+ */
+ void UpperProduct(CSysVector & vec, unsigned long row_i);
+
+ /*!
+ * \brief Performs the product of i-th row of the lower part of a sparse matrix by a vector.
+ * \param[in] vec - Vector to be multiplied by the lower part of the sparse matrix A.
+ * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
+ * \return prod Result of the product L(A)*vec (stored at *prod_row_vector).
+ */
+ void LowerProduct(CSysVector & vec, unsigned long row_i);
+
+ /*!
+ * \brief Performs the product of i-th row of the diagonal part of a sparse matrix by a vector.
+ * \param[in] vec - Vector to be multiplied by the diagonal part of the sparse matrix A.
+ * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
+ * \return prod Result of the product D(A)*vec (stored at *prod_row_vector).
+ */
+ void DiagonalProduct(CSysVector & vec, unsigned long row_i);
+
+ /*!
+ * \brief Send receive the solution using MPI.
+ * \param[in] x - Solution..
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SendReceive_Solution(CSysVector & x, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Send receive the solution using MPI and the transposed structure of the matrix.
+ * \param[in] x - Solution..
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ void SendReceive_SolutionTransposed(CSysVector & x, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Performs the product of i-th row of a sparse matrix by a vector.
+ * \param[in] vec - Vector to be multiplied by the row of the sparse matrix A.
+ * \param[in] row_i - Row of the matrix to be multiplied by vector vec.
+ * \return Result of the product (stored at *prod_row_vector).
+ */
+ void RowProduct(const CSysVector & vec, unsigned long row_i);
+
+ /*!
+ * \brief Performs the product of a sparse matrix by a vector.
+ * \param[in] vec - Vector to be multiplied by the sparse matrix A.
+ * \param[out] prod - Result of the product.
+ * \return Result of the product A*vec.
+ */
+ void MatrixVectorProduct(const CSysVector & vec, CSysVector & prod);
+
+ /*!
+ * \brief Performs the product of a sparse matrix by a CSysVector.
+ * \param[in] vec - CSysVector to be multiplied by the sparse matrix A.
+ * \param[out] prod - Result of the product.
+ */
+ void MatrixVectorProduct(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Performs the product of a sparse matrix by a CSysVector.
+ * \param[in] vec - CSysVector to be multiplied by the sparse matrix A.
+ * \param[out] prod - Result of the product.
+ */
+ void MatrixVectorProductTransposed(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Performs the product of two block matrices.
+ */
+ void GetMultBlockBlock(su2double *c, su2double *a, su2double *b);
+
+ /*!
+ * \brief Performs the product of a block matrices by a vector.
+ */
+ void GetMultBlockVector(su2double *c, su2double *a, su2double *b);
+
+ /*!
+ * \brief Performs the subtraction of two matrices.
+ */
+ void GetSubsBlock(su2double *c, su2double *a, su2double *b);
+
+ /*!
+ * \brief Performs the subtraction of two vectors.
+ */
+ void GetSubsVector(su2double *c, su2double *a, su2double *b);
+
+ /*!
+ * \brief Inverse diagonal block.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[out] invBlock - Inverse block.
+ */
+ void InverseDiagonalBlock(unsigned long block_i, su2double *invBlock, bool transpose = false);
+
+ /*!
+ * \brief Inverse diagonal block.
+ * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure.
+ * \param[out] invBlock - Inverse block.
+ */
+ void InverseDiagonalBlock_ILUMatrix(unsigned long block_i, su2double *invBlock);
+
+ /*!
+ * \brief Inverse a block.
+ * \param[in] Block - block matrix.
+ * \param[out] invBlock - Inverse block.
+ */
+ void InverseBlock(su2double *Block, su2double *invBlock);
+
+ /*!
+ * \brief Build the Jacobi preconditioner.
+ */
+ void BuildJacobiPreconditioner(bool transpose = false);
+
+ /*!
+ * \brief Multiply CSysVector by the preconditioner
+ * \param[in] vec - CSysVector to be multiplied by the preconditioner.
+ * \param[out] prod - Result of the product A*vec.
+ */
+ void ComputeJacobiPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Apply Jacobi as a classical iterative smoother
+ * \param[in] b - CSysVector containing the residual (b)
+ * \param[in] x - CSysVector containing the solution (x^k)
+ * \param[in] mat_vec - object that defines matrix-vector product
+ * \param[in] tol - tolerance with which to solve the system
+ * \param[in] m - maximum size of the search subspace
+ * \param[in] monitoring - turn on priting residuals from solver to screen.
+ * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
+ */
+ unsigned long Jacobi_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Build the ILU0 preconditioner.
+ * \param[in] transposed - Flag to use the transposed matrix to construct the preconditioner.
+ */
+ void BuildILUPreconditioner(bool transposed = false);
+
+ /*!
+ * \brief Multiply CSysVector by the preconditioner
+ * \param[in] vec - CSysVector to be multiplied by the preconditioner.
+ * \param[out] prod - Result of the product A*vec.
+ */
+ void ComputeILUPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Apply ILU0 as a classical iterative smoother
+ * \param[in] b - CSysVector containing the residual (b)
+ * \param[in] x - CSysVector containing the solution (x^k)
+ * \param[in] mat_vec - object that defines matrix-vector product
+ * \param[in] tol - tolerance with which to solve the system
+ * \param[in] m - maximum size of the search subspace
+ * \param[in] monitoring - turn on priting residuals from solver to screen.
+ * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
+ */
+ unsigned long ILU0_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Multiply CSysVector by the preconditioner
+ * \param[in] vec - CSysVector to be multiplied by the preconditioner.
+ * \param[out] prod - Result of the product A*vec.
+ */
+ void ComputeLU_SGSPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+/*!
+ * \brief Apply LU_SGS as a classical iterative smoother
+ * \param[in] b - CSysVector containing the residual (b)
+ * \param[in] x - CSysVector containing the solution (x^k)
+ * \param[in] mat_vec - object that defines matrix-vector product
+ * \param[in] tol - tolerance with which to solve the system
+ * \param[in] m - maximum size of the search subspace
+ * \param[in] monitoring - turn on priting residuals from solver to screen.
+ * \param[out] x - CSysVector containing the result of the smoothing (x^k+1 = x^k + M^-1*(b - A*x^k).
+ */
+ unsigned long LU_SGS_Smoother(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, su2double tol, unsigned long m, su2double *residual, bool monitoring, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Build the Linelet preconditioner.
+ * \param[in] geometry - Geometrical definition of the problem.
+ * \param[in] config - Definition of the particular problem.
+ */
+ unsigned short BuildLineletPreconditioner(CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Multiply CSysVector by the preconditioner
+ * \param[in] vec - CSysVector to be multiplied by the preconditioner.
+ * \param[out] prod - Result of the product A*vec.
+ */
+ void ComputeLineletPreconditioner(const CSysVector & vec, CSysVector & prod, CGeometry *geometry, CConfig *config);
+
+ /*!
+ * \brief Compute the residual Ax-b
+ * \param[in] sol - CSysVector to be multiplied by the preconditioner.
+ * \param[in] f - Result of the product A*vec.
+ * \param[out] res - Result of the product A*vec.
+ */
+ void ComputeResidual(const CSysVector & sol, const CSysVector & f, CSysVector & res);
+
+};
+
+/*!
+ * \class CSysMatrixVectorProduct
+ * \brief specialization of matrix-vector product that uses CSysMatrix class
+ */
+class CSysMatrixVectorProduct : public CMatrixVectorProduct {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the product. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the products
+ */
+ CSysMatrixVectorProduct(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CSysMatrixVectorProduct() {}
+
+ /*!
+ * \brief operator that defines the CSysMatrix-CSysVector product
+ * \param[in] u - CSysVector that is being multiplied by the sparse matrix
+ * \param[out] v - CSysVector that is the result of the product
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CSysMatrixVectorProduct
+ * \brief specialization of matrix-vector product that uses CSysMatrix class
+ */
+class CSysMatrixVectorProductTransposed : public CMatrixVectorProduct {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the product. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the products
+ */
+ CSysMatrixVectorProductTransposed(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CSysMatrixVectorProductTransposed() {}
+
+ /*!
+ * \brief operator that defines the CSysMatrix-CSysVector product
+ * \param[in] u - CSysVector that is being multiplied by the sparse matrix
+ * \param[out] v - CSysVector that is the result of the product
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CJacobiPreconditioner
+ * \brief specialization of preconditioner that uses CSysMatrix class
+ */
+class CJacobiPreconditioner : public CPreconditioner {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
+ */
+ CJacobiPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CJacobiPreconditioner() {}
+
+ /*!
+ * \brief operator that defines the preconditioner operation
+ * \param[in] u - CSysVector that is being preconditioned
+ * \param[out] v - CSysVector that is the result of the preconditioning
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CJacobiTransposedPreconditioner
+ * \brief specialization of preconditioner that uses CSysMatrix class
+ */
+class CJacobiTransposedPreconditioner : public CPreconditioner {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
+ */
+ CJacobiTransposedPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CJacobiTransposedPreconditioner() {}
+
+ /*!
+ * \brief operator that defines the preconditioner operation
+ * \param[in] u - CSysVector that is being preconditioned
+ * \param[out] v - CSysVector that is the result of the preconditioning
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CILUPreconditioner
+ * \brief specialization of preconditioner that uses CSysMatrix class
+ */
+class CILUPreconditioner : public CPreconditioner {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
+ */
+ CILUPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CILUPreconditioner() {}
+
+ /*!
+ * \brief operator that defines the preconditioner operation
+ * \param[in] u - CSysVector that is being preconditioned
+ * \param[out] v - CSysVector that is the result of the preconditioning
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CLU_SGSPreconditioner
+ * \brief specialization of preconditioner that uses CSysMatrix class
+ */
+class CLU_SGSPreconditioner : public CPreconditioner {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
+ */
+ CLU_SGSPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CLU_SGSPreconditioner() {}
+
+ /*!
+ * \brief operator that defines the preconditioner operation
+ * \param[in] u - CSysVector that is being preconditioned
+ * \param[out] v - CSysVector that is the result of the preconditioning
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+/*!
+ * \class CLineletPreconditioner
+ * \brief specialization of preconditioner that uses CSysMatrix class
+ */
+class CLineletPreconditioner : public CPreconditioner {
+private:
+ CSysMatrix* sparse_matrix; /*!< \brief pointer to matrix that defines the preconditioner. */
+ CGeometry* geometry; /*!< \brief pointer to matrix that defines the geometry. */
+ CConfig* config; /*!< \brief pointer to matrix that defines the config. */
+
+public:
+
+ /*!
+ * \brief constructor of the class
+ * \param[in] matrix_ref - matrix reference that will be used to define the preconditioner
+ */
+ CLineletPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref);
+
+ /*!
+ * \brief destructor of the class
+ */
+ ~CLineletPreconditioner() {}
+
+ /*!
+ * \brief operator that defines the preconditioner operation
+ * \param[in] u - CSysVector that is being preconditioned
+ * \param[out] v - CSysVector that is the result of the preconditioning
+ */
+ void operator()(const CSysVector & u, CSysVector & v) const;
+};
+
+#include "matrix_structure.inl"
diff --git a/Common/include/matrix_structure.inl b/Common/include/matrix_structure.inl
index 37a8f317f07..4a9c426ef4a 100644
--- a/Common/include/matrix_structure.inl
+++ b/Common/include/matrix_structure.inl
@@ -1,128 +1,128 @@
-/*!
- * \file matrix_structure.inl
- * \brief In-Line subroutines of the matrix_structure.hpp file.
- * \author F. Palacios, A. Bueno, T. Economon
- * \version 4.0.1 "Cardinal"
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-inline void CSysMatrix::SetValZero(void) {
- for (unsigned long index = 0; index < nnz*nVar*nEqn; index++)
- matrix[index] = 0.0;
-}
-
-inline CSysMatrixVectorProduct::CSysMatrixVectorProduct(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CSysMatrixVectorProduct::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CSysMatrixVectorProduct::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->MatrixVectorProduct(u, v, geometry, config);
-}
-
-inline CSysMatrixVectorProductTransposed::CSysMatrixVectorProductTransposed(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CSysMatrixVectorProductTransposed::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CSysMatrixVectorProduct::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->MatrixVectorProductTransposed(u, v, geometry, config);
-}
-
-
-inline CJacobiPreconditioner::CJacobiPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CJacobiPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CJacobiPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->ComputeJacobiPreconditioner(u, v, geometry, config);
-}
-
-inline CILUPreconditioner::CILUPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CILUPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CILUPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->ComputeILUPreconditioner(u, v, geometry, config);
-}
-
-inline CLU_SGSPreconditioner::CLU_SGSPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CLU_SGSPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CLU_SGSPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->ComputeLU_SGSPreconditioner(u, v, geometry, config);
-}
-
-inline CLineletPreconditioner::CLineletPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
- sparse_matrix = &matrix_ref;
- geometry = geometry_ref;
- config = config_ref;
-}
-
-inline void CLineletPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
- if (sparse_matrix == NULL) {
- cerr << "CLineletPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
- cerr << "pointer to sparse matrix is NULL." << endl;
- throw(-1);
- }
- sparse_matrix->ComputeLineletPreconditioner(u, v, geometry, config);
-}
+/*!
+ * \file matrix_structure.inl
+ * \brief In-Line subroutines of the matrix_structure.hpp file.
+ * \author F. Palacios, A. Bueno, T. Economon
+ * \version 4.0.1 "Cardinal"
+ *
+ * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
+ * Dr. Thomas D. Economon (economon@stanford.edu).
+ *
+ * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
+ * Prof. Piero Colonna's group at Delft University of Technology.
+ * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
+ * Prof. Alberto Guardone's group at Polytechnic University of Milan.
+ * Prof. Rafael Palacios' group at Imperial College London.
+ *
+ * Copyright (C) 2012-2015 SU2, the open-source CFD code.
+ *
+ * SU2 is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * SU2 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with SU2. If not, see .
+ */
+
+#pragma once
+
+inline void CSysMatrix::SetValZero(void) {
+ for (unsigned long index = 0; index < nnz*nVar*nEqn; index++)
+ matrix[index] = 0.0;
+}
+
+inline CSysMatrixVectorProduct::CSysMatrixVectorProduct(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CSysMatrixVectorProduct::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CSysMatrixVectorProduct::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->MatrixVectorProduct(u, v, geometry, config);
+}
+
+inline CSysMatrixVectorProductTransposed::CSysMatrixVectorProductTransposed(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CSysMatrixVectorProductTransposed::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CSysMatrixVectorProduct::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->MatrixVectorProductTransposed(u, v, geometry, config);
+}
+
+
+inline CJacobiPreconditioner::CJacobiPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CJacobiPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CJacobiPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->ComputeJacobiPreconditioner(u, v, geometry, config);
+}
+
+inline CILUPreconditioner::CILUPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CILUPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CILUPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->ComputeILUPreconditioner(u, v, geometry, config);
+}
+
+inline CLU_SGSPreconditioner::CLU_SGSPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CLU_SGSPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CLU_SGSPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->ComputeLU_SGSPreconditioner(u, v, geometry, config);
+}
+
+inline CLineletPreconditioner::CLineletPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, CConfig *config_ref) {
+ sparse_matrix = &matrix_ref;
+ geometry = geometry_ref;
+ config = config_ref;
+}
+
+inline void CLineletPreconditioner::operator()(const CSysVector & u, CSysVector & v) const {
+ if (sparse_matrix == NULL) {
+ cerr << "CLineletPreconditioner::operator()(const CSysVector &, CSysVector &): " << endl;
+ cerr << "pointer to sparse matrix is NULL." << endl;
+ throw(-1);
+ }
+ sparse_matrix->ComputeLineletPreconditioner(u, v, geometry, config);
+}
diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp
index 9901cf29496..7ddb00c50a1 100644
--- a/Common/include/option_structure.hpp
+++ b/Common/include/option_structure.hpp
@@ -1,3079 +1,3079 @@
-/*!
- * \file option_structure.hpp
- * \brief Defines classes for referencing options for easy input in CConfig
- * \author J. Hicken, B. Tracey
- * \version 4.0.1 "Cardinal"
- *
- * Many of the classes in this file are templated, and therefore must
- * be declared and defined here; to keep all elements together, there
- * is no corresponding .cpp file at this time.
- *
- * SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com).
- * Dr. Thomas D. Economon (economon@stanford.edu).
- *
- * SU2 Developers: Prof. Juan J. Alonso's group at Stanford University.
- * Prof. Piero Colonna's group at Delft University of Technology.
- * Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology.
- * Prof. Alberto Guardone's group at Polytechnic University of Milan.
- * Prof. Rafael Palacios' group at Imperial College London.
- *
- * Copyright (C) 2012-2015 SU2, the open-source CFD code.
- *
- * SU2 is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * SU2 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with SU2. If not, see .
- */
-
-#pragma once
-
-#include "./mpi_structure.hpp"
-
-#include
-#include
-#include
-#include
-#include