Structured3DMeshShape Class Reference

#include <Structured3DMeshShape.hpp>

Collaboration diagram for Structured3DMeshShape:

Collaboration graph
[legend]

List of all members.

Public Member Functions

size_t operator() (const size_t &i, const size_t &j, const size_t &k) const
const Array3DShapeshape () const
const TinyVector< 3 > & a () const
const real_t & a (const size_t &i) const
const TinyVector< 3 > & b () const
const real_t & b (const size_t &i) const
const real_t & dimension (const size_t &i) const
const real_t & hx () const
const real_t & hy () const
const real_t & hz () const
bool operator== (const Structured3DMeshShape &s) const
size_t nx () const
 Access to the first component of the shape.
size_t ny () const
 Access to the second component of the shape.
size_t nz () const
 Access to the third component of the shape.
size_t numberOfVertices () const
 Returns the product of shape components (ie: the number of elements when tensorized).
size_t numberOfEdges () const
 Computes the number of edges.
size_t numberOfCells () const
 Returns the product of shape components (ie: the number of elements when tensorized).
const Structured3DMeshShapeoperator= (const Structured3DMeshShape &s)
 operator =
 Structured3DMeshShape (const TinyVector< 3, size_t > &shape, const TinyVector< 3, real_t > &a, const TinyVector< 3, real_t > &b)
 Structured3DMeshShape (const Structured3DMeshShape &s)
 Copy constructor.
 ~Structured3DMeshShape ()

Private Attributes

Array3DShape __shape
 The shape.
TinyVector< 3, real_t > __stepSize
TinyVector< 3 > __a
TinyVector< 3 > __b
TinyVector< 3 > __dimensions


Detailed Description

This class defines the shape of a 3d structured mesh, vector, ...

Author:
Stéphane Del Pino.

Definition at line 37 of file Structured3DMeshShape.hpp.


Constructor & Destructor Documentation

Structured3DMeshShape::Structured3DMeshShape ( const TinyVector< 3, size_t > &  shape,
const TinyVector< 3, real_t > &  a,
const TinyVector< 3, real_t > &  b 
) [inline]

Constructs the mesh shape

Parameters:
shape indicates the number of vertices in each direction
a first box corner
b second box corner

Definition at line 163 of file Structured3DMeshShape.hpp.

References __a, __b, __shape, and __stepSize.

00166     : __shape(shape),
00167       __a(std::min(a[0],b[0]),
00168           std::min(a[1],b[1]),
00169           std::min(a[2],b[2])),
00170       __b(std::max(a[0],b[0]),
00171           std::max(a[1],b[1]),
00172           std::max(a[2],b[2])),
00173       __dimensions(std::abs(a[0]-b[0]),
00174                    std::abs(a[1]-b[1]),
00175                    std::abs(a[2]-b[2]))
00176   {
00177     for (size_t n=0; n<3; ++n)
00178       __stepSize[n] = (__b[n]-__a[n])/(__shape[n]-1.);
00179   }

Structured3DMeshShape::Structured3DMeshShape ( const Structured3DMeshShape s  )  [inline]

Copy constructor.

Definition at line 182 of file Structured3DMeshShape.hpp.

References __shape, fferr(), nx(), ny(), and nz().

00183     : __shape(s.__shape),
00184       __stepSize(s.__stepSize),
00185       __a(s.__a),
00186       __b(s.__b),
00187       __dimensions(s.__dimensions)
00188   {
00189     if ((nx()<=1)||(ny()<=1)||nz()<=1)
00190       fferr(2) << "\nthe mesh shape is not valid: "
00191                << __shape << '\n';
00192   }

Here is the call graph for this function:

Structured3DMeshShape::~Structured3DMeshShape (  )  [inline]

Definition at line 194 of file Structured3DMeshShape.hpp.

00195   {
00196     ;
00197   }


Member Function Documentation

size_t Structured3DMeshShape::operator() ( const size_t &  i,
const size_t &  j,
const size_t &  k 
) const [inline]

Definition at line 50 of file Structured3DMeshShape.hpp.

References __shape.

00051   {
00052     return __shape(i,j,k);
00053   }

const Array3DShape& Structured3DMeshShape::shape (  )  const [inline]

Definition at line 55 of file Structured3DMeshShape.hpp.

References __shape.

Referenced by MultiGrid::computes(), MultiGrid::MultiGrid(), MeshExpressionSpectral::put(), and MeshExpressionStructured::put().

00056   {
00057     return __shape;
00058   }

const TinyVector<3>& Structured3DMeshShape::a (  )  const [inline]

const real_t& Structured3DMeshShape::a ( const size_t &  i  )  const [inline]

Definition at line 65 of file Structured3DMeshShape.hpp.

References __a.

00066   {
00067     return __a[i];
00068   }

const TinyVector<3>& Structured3DMeshShape::b (  )  const [inline]

const real_t& Structured3DMeshShape::b ( const size_t &  i  )  const [inline]

Definition at line 75 of file Structured3DMeshShape.hpp.

References __b.

00076   {
00077     return __b[i];
00078   }

const real_t& Structured3DMeshShape::dimension ( const size_t &  i  )  const [inline]

Definition at line 80 of file Structured3DMeshShape.hpp.

References __dimensions.

Referenced by MultiGrid::computeResidu(), and MultiGrid::weightJacobi().

00081   {
00082     return __dimensions[i];
00083   }

const real_t& Structured3DMeshShape::hx (  )  const [inline]

const real_t& Structured3DMeshShape::hy (  )  const [inline]

const real_t& Structured3DMeshShape::hz (  )  const [inline]

bool Structured3DMeshShape::operator== ( const Structured3DMeshShape s  )  const [inline]

Definition at line 99 of file Structured3DMeshShape.hpp.

References __a, __b, and __shape.

00100   {
00101     return ((__shape==s.__shape)&&
00102             (__a==s.__a)&&
00103             (__b==s.__b));
00104   }

size_t Structured3DMeshShape::nx (  )  const [inline]

Access to the first component of the shape.

Definition at line 107 of file Structured3DMeshShape.hpp.

References __shape, and Array3DShape::nx().

Referenced by WriterVTK::__fillCrossedComponent(), ScalarFunctionReaderVTK::getFunction(), MultiGrid::MultiGrid(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMeshShape(), and SpectralMesh::vertexIndex().

00108   {
00109     return __shape.nx();
00110   }

Here is the call graph for this function:

size_t Structured3DMeshShape::ny (  )  const [inline]

Access to the second component of the shape.

Definition at line 113 of file Structured3DMeshShape.hpp.

References __shape, and Array3DShape::ny().

Referenced by WriterVTK::__fillCrossedComponent(), ScalarFunctionReaderVTK::getFunction(), MultiGrid::MultiGrid(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMeshShape(), and SpectralMesh::vertexIndex().

00114   {
00115     return __shape.ny();
00116   }

Here is the call graph for this function:

size_t Structured3DMeshShape::nz (  )  const [inline]

Access to the third component of the shape.

Definition at line 119 of file Structured3DMeshShape.hpp.

References __shape, and Array3DShape::nz().

Referenced by WriterVTK::__fillCrossedComponent(), ScalarFunctionReaderVTK::getFunction(), MultiGrid::MultiGrid(), SpectralMesh::SpectralMesh(), Structured3DMesh::Structured3DMesh(), Structured3DMeshShape(), and SpectralMesh::vertexIndex().

00120   {
00121     return __shape.nz();
00122   }

Here is the call graph for this function:

size_t Structured3DMeshShape::numberOfVertices (  )  const [inline]

Returns the product of shape components (ie: the number of elements when tensorized).

Definition at line 125 of file Structured3DMeshShape.hpp.

References __shape, Array3DShape::nx(), Array3DShape::ny(), and Array3DShape::nz().

Referenced by SpectralFEMPreconditioner::Internal::computes(), SpectralFEMPreconditioner::Internal::computesTransposed(), MeshExpressionSpectral::execute(), MeshExpressionStructured::execute(), and MultiGrid::MultiGrid().

00126   {
00127     return __shape.nx()*__shape.ny()*__shape.nz();
00128   }

Here is the call graph for this function:

size_t Structured3DMeshShape::numberOfEdges (  )  const [inline]

Computes the number of edges.

Definition at line 131 of file Structured3DMeshShape.hpp.

References __shape, Array3DShape::nx(), Array3DShape::ny(), and Array3DShape::nz().

00132   {
00133     return ((__shape.nx()-1)*__shape.ny()*__shape.nz()
00134             +__shape.nx()*(__shape.ny()-1)*__shape.nz()
00135             +__shape.nx()*__shape.ny()*(__shape.nz()-1));
00136   }

Here is the call graph for this function:

size_t Structured3DMeshShape::numberOfCells (  )  const [inline]

Returns the product of shape components (ie: the number of elements when tensorized).

Definition at line 139 of file Structured3DMeshShape.hpp.

References __shape, Array3DShape::nx(), Array3DShape::ny(), and Array3DShape::nz().

00140   {
00141     return (__shape.nx()-1)*(__shape.ny()-1)*(__shape.nz()-1);
00142   }

Here is the call graph for this function:

const Structured3DMeshShape& Structured3DMeshShape::operator= ( const Structured3DMeshShape s  )  [inline]

operator =

Definition at line 145 of file Structured3DMeshShape.hpp.

References __a, __b, __dimensions, __shape, and __stepSize.

00146   {
00147     __shape=s.__shape;
00148     __stepSize=s.__stepSize;
00149     __a=s.__a;
00150     __b=s.__b;
00151     __dimensions=s.__dimensions;
00152 
00153     return *this;
00154   }


Member Data Documentation

Definition at line 42 of file Structured3DMeshShape.hpp.

Referenced by hx(), hy(), hz(), operator=(), and Structured3DMeshShape().

Definition at line 44 of file Structured3DMeshShape.hpp.

Referenced by a(), operator=(), operator==(), and Structured3DMeshShape().

Definition at line 45 of file Structured3DMeshShape.hpp.

Referenced by b(), operator=(), operator==(), and Structured3DMeshShape().

Definition at line 47 of file Structured3DMeshShape.hpp.

Referenced by dimension(), and operator=().


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

Generated on Wed Nov 19 00:15:30 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6