Accu
 All Files Functions
Functions
geom.h File Reference

Go to the source code of this file.

Functions

void IniGeom (const int myid, const int procx, const int procy, int neigh[], int &color)
 
void IniCoord (const int myid, const int procx, const int procy, double &xl, double &xr, double &yb, double &yt)
 
void GetCoordsInRectangle (const int nx, const int ny, const double &xl, const double &xr, const double &yb, const double &yt, double xc[])
 
void GetConnectivityInRectangle (const int nx, const int ny, int ia[])
 
void GetBound (const int ib, const int nx, const int ny, const double w[], double s[])
 
void AddBound (const int ib, const int nx, const int ny, double w[], const double s[])
 
void SaveVectorP (const int myid, const string &name, const double u[], const int nx, const int ny, const double &xl, const double &xr, const double &yb, const double &yt)
 
void GetMesh (const int nx, const int ny, const double xl, const double xr, const double yb, const double yt, int &nnode, double *&xc, int &nelem, int *&ia)
 
void DebugMesh (const int nnode, const double xc[], const int nelem, const int ndof_e, const int ia[])
 

Function Documentation

void AddBound ( const int  ib,
const int  nx,
const int  ny,
double  w[],
const double  s[] 
)

Computes w := w + s at the interface/boundary nodes on the boundary ib . South (ib==1), East (ib==2), North (ib==3), West (ib==4)

Parameters
[in]ibmy local boundary
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in,out]wvector for all nodes of local discretization
[in]sshort vector with values on boundary ib
void DebugMesh ( const int  nnode,
const double  xc[],
const int  nelem,
const int  ndof_e,
const int  ia[] 
)

Prints the information for a finite element mesh

Parameters
[in]nnodenumber coordinates
[in]xc[nnode]array of coordinates
[in]nelemnumber of elements
[in]ndof_edegrees of freedom per element (= number of geometric points)
[in]ia[nelem][ndof_e]element connectivity array for linear triangular elements
void GetBound ( const int  ib,
const int  nx,
const int  ny,
const double  w[],
double  s[] 
)

Copies the values of w corresponding to boundary ib onto vector s. South (ib==1), East (ib==2), North (ib==3), West (ib==4). The vector s has to be long enough!!

Parameters
[in]ibmy local boundary
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in]wvector for all nodes of local discretization
[out]sshort vector with values on boundary ib
void GetConnectivityInRectangle ( const int  nx,
const int  ny,
int  ia[] 
)

Determines the element connectivity of linear triangular elements of a FEM discretization of a rectangle using nx x ny equidistant intervals for discretization.

Parameters
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[out]iaelement connectivity matrix with ia(3*s,3*s+1,3*s+2) as node numbers od element s
void GetCoordsInRectangle ( const int  nx,
const int  ny,
const double &  xl,
const double &  xr,
const double &  yb,
const double &  yt,
double  xc[] 
)

Determines the coordinates of the dicretization nodes of the domain [xl, xr] x [yb, yt] which is discretized into nx x ny intervals.

Parameters
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in]xlx-coordinate of left boundary
[in]xrx-coordinate of right boundary
[in]yby-coordinate of lower boundary
[in]yty-coordinate of upper boundary
[out]xccoordinate vector of length 2n with x(2*k,2*k+1) as coodinates of node k
void GetMesh ( const int  nx,
const int  ny,
const double  xl,
const double  xr,
const double  yb,
const double  yt,
int &  nnode,
double *&  xc,
int &  nelem,
int *&  ia 
)

The 2D domain [xl,xr] x [yb,yt] is discretized into a triangular mesh based on nx times ny equidistant grid of the rectangle.

The memory for coordinates array xc and for the element connectivity ia is allocated inside the function.

Parameters
[in]nxnumber of equidistant intervals in x-direction
[in]nynumber of equidistant intervals in y-direction
[in]xlx-coordinate of left boundary
[in]xrx-coordinate of right boundary
[in]yby-coordinate of lower boundary
[in]yty-coordinate of upper boundary
[out]nnodenumber of coordinates
[out]xcarray[nnode][2] of x- and y-coordinates
[out]nelemnumber of triangular elements
[out]iaarray[nelem][3] element connectivity for linear triangular elements
void IniCoord ( const int  myid,
const int  procx,
const int  procy,
double &  xl,
double &  xr,
double &  yb,
double &  yt 
)

The quadratic domain [0,1] x [0,1] is divided into procx * procy subdomains numbered rowise. According to my process with rank number myid, the coordinates of the lower left corner (xl, yb) and of the upper right corner (xr, yt) are generated.

Parameters
[in]myidmy rank
[in]procxnumber of processes in x-direction
[in]procynumber of processes in y-direction
[out]xlx-coordinate of left boundary
[out]xrx-coordinate of right boundary
[out]yby-coordinate of lower boundary
[out]yty-coordinate of upper boundary
void IniGeom ( const int  myid,
const int  procx,
const int  procy,
int  neigh[],
int &  color 
)

The quadratic domain [0,1] x [0,1] is divided into procx * procy subdomains numbered rowise. According to my process with rank number myid, the vector neigh contains the ranks of the neighbours t the South, East, North, West.

Parameters
[in]myidmy rank
[in]procxnumber of processes in x-direction
[in]procynumber of processes in y-direction
[out]neighvector of 4 elements containing the ranks of neighbouring processes, -1 indicates a boundary in this direction
[out]colorred/black coloring of subdomains (0/1)
void SaveVectorP ( const int  myid,
const string &  name,
const double  u[],
const int  nx,
const int  ny,
const double &  xl,
const double &  xr,
const double &  yb,
const double &  yt 
)

Stores the values of vector u of subdomain myid into a file. The file stores rowise the x- and y- coordinates together with the value from u . The domain [xl, xr] x [yb, yt] is discretized into nx x ny intervals.

Parameters
[in]myidmy rank
[in]namebasename of file name (file name will be extended by the rank number)
[in]ulocal vector
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in]xlx-coordinate of left boundary
[in]xrx-coordinate of right boundary
[in]yby-coordinate of lower boundary
[in]yty-coordinate of upper boundary