CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Example::My_Mesh< _Type > Class Template Reference
Inheritance diagram for Example::My_Mesh< _Type >:
CppNoddy::TwoD_Mapped_Node_Mesh< _Type > CppNoddy::TwoD_Mapped_Node_Mesh< _Type >

Public Member Functions

 My_Mesh (double left, double right, double bottom, double top, std::size_t nz, std::size_t ny, std::size_t nv)
 
double FnComp_X (const double &x) const
 Mapping function that provides a computational X coordinate from a physical coordinate. More...
 
double FnComp_Xd (const double &x) const
 Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate. More...
 
double FnComp_Xdd (const double &x) const
 Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate. More...
 
double FnComp_Y (const double &y) const
 Mapping function that provides the computational Y coordinate as a function of the physical coordinate. More...
 
double FnComp_Yd (const double &y) const
 Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
double FnComp_Ydd (const double &y) const
 Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
 My_Mesh (double left, double right, double bottom, double top, std::size_t nz, std::size_t ny, std::size_t nv)
 
double FnComp_X (const double &x) const
 Mapping function that provides a computational X coordinate from a physical coordinate. More...
 
double FnComp_Xd (const double &x) const
 Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate. More...
 
double FnComp_Xdd (const double &x) const
 Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate. More...
 
double FnComp_Y (const double &y) const
 Mapping function that provides the computational Y coordinate as a function of the physical coordinate. More...
 
double FnComp_Yd (const double &y) const
 Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
double FnComp_Ydd (const double &y) const
 Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
- Public Member Functions inherited from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >
virtual double FnComp_X (const double &zeta) const
 Mapping function that provides a computational X coordinate from a physical coordinate. More...
 
virtual double FnComp_Xd (const double &zeta) const
 Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate. More...
 
virtual double FnComp_Xdd (const double &zeta) const
 Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate. More...
 
virtual double FnComp_Y (const double &eta) const
 Mapping function that provides the computational Y coordinate as a function of the physical coordinate. More...
 
virtual double FnComp_Yd (const double &eta) const
 Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
virtual double FnComp_Ydd (const double &eta) const
 Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate. More...
 
 TwoD_Mapped_Node_Mesh ()
 
 TwoD_Mapped_Node_Mesh (const double left, const double right, const double bottom, const double top, const std::size_t nx, const std::size_t ny, const std::size_t nvars)
 ctor of a blank mesh More...
 
 TwoD_Mapped_Node_Mesh (std::string filename, const std::size_t nx, const std::size_t ny, const std::size_t nv)
 
void init_mapping ()
 Sometimes a useful mapping is painful to invert analytically. More...
 
std::pair< double, double > get_comp_step_sizes () const
 
virtual ~TwoD_Mapped_Node_Mesh ()
 dtor More...
 
DenseVector< _Type > operator() (const std::size_t nodex, const std::size_t nodey)
 Access operator for a nodal point that returns a vector. More...
 
_Type & operator() (const std::size_t nodex, const std::size_t nodey, const std::size_t var)
 Access operator for a nodal point/variable in the mesh. More...
 
const _Type & operator() (const std::size_t nodex, const std::size_t nodey, const std::size_t var) const
 Const access operator for a nodal point/variable in the mesh. More...
 
std::pair< double, double > coord (const std::size_t nodex, const std::size_t nodey) const
 Access the physical nodal position - as a pair. More...
 
void set_nodes_vars (const std::size_t nodex, const std::size_t nodey, const DenseVector< _Type > &U)
 Set the variables stored at A SPECIFIED node. More...
 
DenseVector< _Type > get_nodes_vars (const std::size_t nodex, const std::size_t nodey) const
 Get the variables stored at A SPECIFIED node – equivalent to mesh(nodex,nodey). More...
 
std::pair< std::size_t, std::size_t > get_nnodes () const
 Get the number of nodes in the two directions of the 2D mesh. More...
 
std::size_t get_nvars () const
 Get the number of variables that are stored at each node. More...
 
DenseVector< double > & xnodes ()
 Access the vector of x-nodal positions. More...
 
DenseVector< double > & ynodes ()
 Access the vector of y-nodal positions. More...
 
OneD_Node_Mesh< _Type > get_xsection_at_xnode (const std::size_t nodex) const
 Get a cross section of the 2D mesh at a specified (constant) x node. More...
 
OneD_Node_Mesh< _Type > get_xsection_at_ynode (const std::size_t nodey) const
 Get a cross section of the 2D mesh at a specified (constant) y node. More...
 
void read (std::string filename, const bool reset=false)
 A simple method for reading data from a file. More...
 
void dump_gnu (std::string filename) const
 A simple method for dumping data to a file for gnuplot surface plotting. More...
 
void normalise (const std::size_t &var)
 Normalise all data in the mesh based on one variable. More...
 
void scale (const _Type &value)
 Rescale all values stored in the mapped mesh by a scalar. More...
 
double max (unsigned var)
 Find the maximum stored absolute value in the mesh for a given variable – no interpolation is used. More...
 
DenseVector< _Type > get_interpolated_vars (const double &x, const double &y)
 Get a bilinearly interpolated value at a specified point. More...
 
void normalise (const std::size_t &var)
 
void normalise (const std::size_t &var)
 
void read (std::string filename, bool reset)
 
void read (std::string filename, bool reset)
 
void dump_gnu (std::string filename) const
 
void dump_gnu (std::string filename) const
 

Additional Inherited Members

- Protected Attributes inherited from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >
double m_left
 
double m_right
 
double m_bottom
 
double m_top
 
std::size_t m_nx
 
std::size_t m_ny
 
std::size_t m_nv
 
DenseVector< double > m_compX
 
DenseVector< double > m_compY
 
DenseVector< double > m_X
 
DenseVector< double > m_Y
 
DenseVector< _Type > m_vars
 

Detailed Description

template<typename _Type>
class Example::My_Mesh< _Type >

Definition at line 63 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

Constructor & Destructor Documentation

◆ My_Mesh() [1/2]

template<typename _Type >
Example::My_Mesh< _Type >::My_Mesh ( double  left,
double  right,
double  bottom,
double  top,
std::size_t  nz,
std::size_t  ny,
std::size_t  nv 
)
inline

Definition at line 66 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

66 : TwoD_Mapped_Node_Mesh<_Type>( left, right, bottom, top, nz, ny, nv )
67 {
68 // mesh stretching parameters
69 BX = 10.0;
70 BY = 10.0;
71 CX = 0.2;
72 CY = 0.8;
73 this -> init_mapping();
74 }
A two dimensional (mapped) mesh utility object.
void init_mapping()
Sometimes a useful mapping is painful to invert analytically.

References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::init_mapping().

◆ My_Mesh() [2/2]

template<typename _Type >
Example::My_Mesh< _Type >::My_Mesh ( double  left,
double  right,
double  bottom,
double  top,
std::size_t  nz,
std::size_t  ny,
std::size_t  nv 
)
inline

Definition at line 66 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

66 : TwoD_Mapped_Node_Mesh<_Type>( left, right, bottom, top, nz, ny, nv )
67 {
68 // mesh stretching parameters
69 BX = 10.0;
70 BY = 10.0;
71 CX = 0.2;
72 CY = 0.8;
73 this -> init_mapping();
74 }

References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::init_mapping().

Member Function Documentation

◆ FnComp_X() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_X ( const double &  zeta) const
inlinevirtual

Mapping function that provides a computational X coordinate from a physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 78 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

79 {
80 return x;
81 }

◆ FnComp_X() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_X ( const double &  zeta) const
inlinevirtual

Mapping function that provides a computational X coordinate from a physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 78 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

79 {
80 return x;
81 }

◆ FnComp_Xd() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Xd ( const double &  zeta) const
inlinevirtual

Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 82 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

83 {
84 return 1.0;
85 }

Referenced by main().

◆ FnComp_Xd() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Xd ( const double &  zeta) const
inlinevirtual

Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 82 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

83 {
84 return 1.0;
85 }

◆ FnComp_Xdd() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Xdd ( const double &  zeta) const
inlinevirtual

Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 86 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

87 {
88 return 0.0;
89 }

Referenced by main().

◆ FnComp_Xdd() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Xdd ( const double &  zeta) const
inlinevirtual

Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate.

Parameters
zetaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 86 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

87 {
88 return 0.0;
89 }

◆ FnComp_Y() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Y ( const double &  eta) const
inlinevirtual

Mapping function that provides the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 91 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

92 {
93 return y;
94 }

◆ FnComp_Y() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Y ( const double &  eta) const
inlinevirtual

Mapping function that provides the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 91 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

92 {
93 return y;
94 }

◆ FnComp_Yd() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Yd ( const double &  eta) const
inlinevirtual

Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 95 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

96 {
97 return 1.0;
98 }

Referenced by main().

◆ FnComp_Yd() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Yd ( const double &  eta) const
inlinevirtual

Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 95 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

96 {
97 return 1.0;
98 }

◆ FnComp_Ydd() [1/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Ydd ( const double &  eta) const
inlinevirtual

Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 99 of file EVP2DOrrSommerfeld_slepcz_mumps.cpp.

100 {
101 return 0.0;
102 }

Referenced by main().

◆ FnComp_Ydd() [2/2]

template<typename _Type >
double Example::My_Mesh< _Type >::FnComp_Ydd ( const double &  eta) const
inlinevirtual

Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate.

Parameters
etaThe physical coordinate
Returns
The corresponding derivative of the computational coordinate

Reimplemented from CppNoddy::TwoD_Mapped_Node_Mesh< _Type >.

Definition at line 99 of file EVP2DOrrSommerfeld_slepcz_superludist.cpp.

100 {
101 return 0.0;
102 }

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

© 2012

R.E. Hewitt