Unstruct2D  1.0
Solution of 2-D Euler- and Navier-Stokes Equations on Unstructured Triangular Grids
 All Classes Files Functions Variables Typedefs Enumerations Macros
Geometry Class Reference

#include <geometry.h>

Classes

struct  T_BFACE
 Nodes defining a face. More...
 
struct  T_BNODE
 Data related to boundary nodes. More...
 
struct  T_EDGE
 Nodes of an edge. More...
 
struct  T_IBOUND
 Pointer from boundary segment to its faces and nodes. More...
 
struct  T_TRIA
 Nodes of a triangle. More...
 

Public Types

typedef struct Geometry::T_TRIA TRIA
 Nodes of a triangle.
 
typedef struct Geometry::T_EDGE EDGE
 Nodes of an edge.
 
typedef struct Geometry::T_BFACE BFACE
 Nodes defining a face.
 
typedef struct Geometry::T_BNODE BNODE
 Data related to boundary nodes.
 
typedef struct Geometry::T_IBOUND IBOUND
 Pointer from boundary segment to its faces and nodes.
 

Public Member Functions

 Geometry ()
 
 ~Geometry ()
 
void ComputeMetrics ()
 
void GenerateEdgelist ()
 
int GetNumberBoundNodes (int btypeFrom, int btypeTo) const
 
void ReadGrid ()
 

Public Attributes

int nNodes
 
int nndInt
 
int nEdges
 
int nedInt
 
int nTria
 
int nSegs
 
int nBfaces
 
int nBnodes
 
int * btype
 
TRIAtria
 
EDGEedge
 
BFACEbface
 
BNODEbnode
 
IBOUNDibound
 
REAL xref
 
REAL yref
 
REAL cref
 
NODEcoords
 
NODEsij
 
REALvol
 
NODEsbf
 
NODEsproj
 
std::string fnameGrid
 
std::string * bname
 

Detailed Description

Encompasses variables and functions related to the geometrical data including the topology of the boundaries. It also contains edge list, control volumes and face vectors. The class takes care of input, initialization and computation of geometrical data.

Constructor & Destructor Documentation

Geometry::Geometry ( )

Initializes variables related to grid geometry.

Geometry::~Geometry ( )

Finishes and cleans up the memory.

Member Function Documentation

void Geometry::ComputeMetrics ( )

Computes face vectors and cell volumes; checks their values. Sets coordinates of dummy nodes equal to those of boundary nodes. Corrects face vectors at symmetry boundaries. Computes projections of control volumes on coordinate axes.

Exceptions
std::runtime_errorfailed logic check
std::bad_allocfailed memory allocation
void Geometry::GenerateEdgelist ( )

Generates temporary and final edge lists. Computes the total number of edges (interior + dummy). The temporary edge list is used in function ComputeMetrics and then deleted. The final edge list (Geometry::edge) is utilized for the computation of fluxes.

Exceptions
std::runtime_errorfailed logic check
std::bad_allocfailed memory allocation
int Geometry::GetNumberBoundNodes ( int  btypeFrom,
int  btypeTo 
) const

Returns maximum number of boundary nodes for given range of boundary types.

Parameters
btypeFromstarting value of the boundary type(s)
btypeToending value of the boundary type(s)
Returns
number of nodes
void Geometry::ReadGrid ( )

Reads in grid data and boundary segments.

Exceptions
std::runtime_errorfailed logic check or read problem
std::bad_allocfailed memory allocation

Member Data Documentation

BFACE* Geometry::bface

indexes of two nodes defining boundary faces (NOT for periodic boundaries!)

std::string* Geometry::bname

names of boundary segments (used for plots)

BNODE* Geometry::bnode

pointers from boundary nodes to related data

int* Geometry::btype

types of boundary conditions:
100-199 = inflow
200-299 = outflow
300-399 = viscous wall
400-499 = inviscid wall
500-599 = symmetry line
600-699 = far-field
700-799 = periodic boundary

NODE* Geometry::coords

x- and y-coordinates

REAL Geometry::cref

reference length or airfoil chord

EDGE* Geometry::edge

edge list (node i, node j). For ie > nedInt, edge[ie] represents the edge from a boundary node (i) to a dummy node (used at inlet, outlet and far-field boundaries).

std::string Geometry::fnameGrid

file with grid and topology data

IBOUND* Geometry::ibound

pointers from boundary segments to boundary faces and nodes

int Geometry::nBfaces

number of all boundary faces

int Geometry::nBnodes

total number of boundary nodes

int Geometry::nEdges

total number of edges (including edges between boundary and dummy nodes)

int Geometry::nedInt

number of edges excluding those to dummy nodes

int Geometry::nndInt

number of physical grid nodes (nNodes - dummy nodes)

int Geometry::nNodes

total number of grid nodes (including dummy nodes).
Dummy nodes are defined for inlet, outlet and far-field boundaries only. The variables cv[], dv[], coords[], edge[], vol[] and sij[] are divided into two parts. The first part is related to the physical grid (dimensions nndInt, nedInt). The second part refers to the dummy nodes. This approach makes it easier to loop either only over the physical grid nodes (edges), or over all nodes (edges) using the same vector.

int Geometry::nSegs

number of boundary segments (composed of boundary faces)

int Geometry::nTria

number of triangles

NODE* Geometry::sbf

normal vector of boundary face (outward pointing, size equal to the edge length); defined for all boundaries except for periodic ones.

NODE* Geometry::sij

x,y-components of the face vector (n*dS). For ie > nedInt, sij[ie] represents the average face vector at a boundary node (face between boundary and dummy node); sij always points from node i to node j (see Fig. 5.9).

NODE* Geometry::sproj

projections of control volumes on the x- and y-axis (used to compute the time step - see Eq. (6.22)).

TRIA* Geometry::tria

node indexes of triangle elements

REAL* Geometry::vol

median-dual control volume (shaded area in Fig. 5.8)

REAL Geometry::xref

x-coordinate of the reference point

REAL Geometry::yref

y-coordinate of the reference point


The documentation for this class was generated from the following files: