CppNoddy
0.92
|
A two dimensional (mapped) mesh utility object. More...
#include <TwoD_Mapped_Node_Mesh.h>
Public Member Functions | |
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 |
Protected Attributes | |
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 |
A two dimensional (mapped) mesh utility object.
Definition at line 21 of file TwoD_Mapped_Node_Mesh.h.
|
inline |
Definition at line 90 of file TwoD_Mapped_Node_Mesh.h.
|
inline |
ctor of a blank mesh
Definition at line 94 of file TwoD_Mapped_Node_Mesh.h.
References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compX, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compY, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nv, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nx, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_ny, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_vars, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_X, and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_Y.
|
inline |
Definition at line 114 of file TwoD_Mapped_Node_Mesh.h.
References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_bottom, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compX, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compY, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_left, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nv, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nx, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_ny, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_right, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_top, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_vars, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_X, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_Y, and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::read().
|
inlinevirtual |
|
inline |
Access the physical nodal position - as a pair.
nodex | The x nodal position to return |
nodey | The y nodal position to return |
Definition at line 371 of file TwoD_Mapped_Node_Mesh.h.
Referenced by main().
void CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::dump_gnu | ( | std::string | filename | ) | const |
A simple method for dumping data to a file for gnuplot surface plotting.
filename | The filename to write the data to (will overwrite) |
Referenced by main().
void CppNoddy::TwoD_Mapped_Node_Mesh< double >::dump_gnu | ( | std::string | filename | ) | const |
Definition at line 298 of file TwoD_Mapped_Node_Mesh.cpp.
void CppNoddy::TwoD_Mapped_Node_Mesh< D_complex >::dump_gnu | ( | std::string | filename | ) | const |
Definition at line 320 of file TwoD_Mapped_Node_Mesh.cpp.
|
inlinevirtual |
Mapping function that provides a computational X coordinate from a physical coordinate.
zeta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 28 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars().
|
inlinevirtual |
Mapping function that provides the first derivative of the computational m_X coordinate as a function of the physical coordinate.
zeta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 39 of file TwoD_Mapped_Node_Mesh.h.
|
inlinevirtual |
Mapping function that provides the second derivative of the computational X coordinate as a function of the physical coordinate.
zeta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 50 of file TwoD_Mapped_Node_Mesh.h.
|
inlinevirtual |
Mapping function that provides the computational Y coordinate as a function of the physical coordinate.
eta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 61 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars().
|
inlinevirtual |
Mapping function that provides the first derivative of the computational Y coordinate as a function of the physical coordinate.
eta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 72 of file TwoD_Mapped_Node_Mesh.h.
|
inlinevirtual |
Mapping function that provides the second derivative of the computational Y coordinate as a function of the physical coordinate.
eta | The physical coordinate |
Reimplemented in Example::My_Mesh< _Type >, and Example::My_Mesh< _Type >.
Definition at line 83 of file TwoD_Mapped_Node_Mesh.h.
std::pair< double, double > CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_comp_step_sizes |
|
inline |
Get a bilinearly interpolated value at a specified point.
x | Physical (unmapped) x-coordinate in the 2D mesh |
y | Physical (unmapped) y-coordinate in the 2D mesh |
Definition at line 251 of file TwoD_Mapped_Node_Mesh.h.
References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::FnComp_X(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::FnComp_Y(), CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::get_interpolated_vars(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_nodes_vars(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compX, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_compY, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nv, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nx, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_ny, and CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::set_nodes_vars().
std::pair< std::size_t, std::size_t > CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_nnodes |
Get the number of nodes in the two directions of the 2D mesh.
Definition at line 163 of file TwoD_Mapped_Node_Mesh.cpp.
DenseVector< _Type > CppNoddy::TwoD_Mapped_Node_Mesh< _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).
nodex | The x nodal index to be returned |
nodey | The y nodal index to be returned |
Definition at line 37 of file TwoD_Mapped_Node_Mesh.cpp.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars().
std::size_t CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_nvars |
Get the number of variables that are stored at each node.
Definition at line 171 of file TwoD_Mapped_Node_Mesh.cpp.
OneD_Node_Mesh< _Type > CppNoddy::TwoD_Mapped_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.
nodex | The x nodal index at which the cross section is to be taken |
Definition at line 52 of file TwoD_Mapped_Node_Mesh.cpp.
References CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::set_nodes_vars().
OneD_Node_Mesh< _Type > CppNoddy::TwoD_Mapped_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.
nodey | The y nodal index at which the cross section is to be taken |
Definition at line 61 of file TwoD_Mapped_Node_Mesh.cpp.
References CppNoddy::OneD_Node_Mesh< _Type, _Xtype >::set_nodes_vars().
void CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::init_mapping |
Sometimes a useful mapping is painful to invert analytically.
Here we construct the physical node distribution by finding the set of points x_i such that the computation nodes X satisfy X_i = FnComp_X(x_i), for example.
Definition at line 75 of file TwoD_Mapped_Node_Mesh.cpp.
References CppNoddy::Utility::uniform_node_vector().
Referenced by Example::My_Mesh< _Type >::My_Mesh().
|
inline |
Find the maximum stored absolute value in the mesh for a given variable – no interpolation is used.
var | The variable index whose maximum is being asked for |
Definition at line 234 of file TwoD_Mapped_Node_Mesh.h.
References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nv, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_nx, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_ny, CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_vars, and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max().
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max().
void CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::normalise | ( | const std::size_t & | var | ) |
Normalise all data in the mesh based on one variable.
var | This var will have its peak (absolute) value as +/-unity following the normalisation. All other variables will also be rescaled by the same amount. |
void CppNoddy::TwoD_Mapped_Node_Mesh< double >::normalise | ( | const std::size_t & | var | ) |
Definition at line 186 of file TwoD_Mapped_Node_Mesh.cpp.
void CppNoddy::TwoD_Mapped_Node_Mesh< D_complex >::normalise | ( | const std::size_t & | var | ) |
Definition at line 192 of file TwoD_Mapped_Node_Mesh.cpp.
|
inline |
Access operator for a nodal point that returns a vector.
nodex | The nodal index value in the first direction |
nodey | The nodal index value in the second direction |
Definition at line 319 of file TwoD_Mapped_Node_Mesh.h.
|
inline |
Access operator for a nodal point/variable in the mesh.
nodex | The nodal index value in the first direction |
nodey | The nodal index value in the second direction |
var | The variable index to be accessed |
Definition at line 333 of file TwoD_Mapped_Node_Mesh.h.
|
inline |
Const access operator for a nodal point/variable in the mesh.
nodex | The nodal index value in the first direction |
nodey | The nodal index value in the second direction |
var | The variable index to be accessed |
Definition at line 352 of file TwoD_Mapped_Node_Mesh.h.
void CppNoddy::TwoD_Mapped_Node_Mesh< double >::read | ( | std::string | filename, |
bool | reset | ||
) |
Definition at line 213 of file TwoD_Mapped_Node_Mesh.cpp.
void CppNoddy::TwoD_Mapped_Node_Mesh< D_complex >::read | ( | std::string | filename, |
bool | reset | ||
) |
Definition at line 256 of file TwoD_Mapped_Node_Mesh.cpp.
void CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::read | ( | std::string | filename, |
const bool | reset = false |
||
) |
A simple method for reading data from a file.
filename | The filename to write the data to (will overwrite) |
reset | Will reset the nodal positions using those from the file |
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
inline |
Rescale all values stored in the mapped mesh by a scalar.
value | The scalar that is to multiply all mesh content |
Definition at line 226 of file TwoD_Mapped_Node_Mesh.h.
References CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::m_vars.
void CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::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.
nodex | The x nodal index to be set |
nodey | The y nodal index to be set |
U | The vector of VARIABLES to be written to this nodal point |
Definition at line 20 of file TwoD_Mapped_Node_Mesh.cpp.
References U.
DenseVector< double > & CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::xnodes |
Access the vector of x-nodal positions.
Definition at line 176 of file TwoD_Mapped_Node_Mesh.cpp.
DenseVector< double > & CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::ynodes |
Access the vector of y-nodal positions.
Definition at line 181 of file TwoD_Mapped_Node_Mesh.cpp.
|
protected |
Definition at line 301 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 306 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 309 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 301 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 303 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 303 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 303 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::get_interpolated_vars(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 301 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 301 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 315 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::max(), CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::scale(), and CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 311 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
|
protected |
Definition at line 313 of file TwoD_Mapped_Node_Mesh.h.
Referenced by CppNoddy::TwoD_Mapped_Node_Mesh< _Type >::TwoD_Mapped_Node_Mesh().
© 2012
R.E. Hewitt