PRAgMaTIc  master
Public Member Functions | Static Public Member Functions | Friends | List of all members
MetricTensor< treal_t, dim > Class Template Reference

symmetric metric tensor class. More...

#include <MetricTensor.h>

Public Member Functions

 MetricTensor ()
 Default constructor. More...
 
 ~MetricTensor ()
 Default destructor. More...
 
 MetricTensor (const treal_t *metric)
 
 MetricTensor (const MetricTensor< treal_t, dim > &metric)
 
const MetricTensoroperator= (const MetricTensor< treal_t, dim > &metric)
 
void get_metric (treal_t *metric)
 
const treal_t * get_metric () const
 Give const pointer to metric tensor. More...
 
void set_metric (const treal_t *metric)
 
void constrain (const treal_t *M_in, bool perserved_small_edges=true)
 
void limit_aspect_ratio (treal_t max_ratio)
 
void scale (treal_t scale_factor)
 
treal_t average_length () const
 
treal_t max_length () const
 
double min_length () const
 
void eigen_decomp (treal_t *eigenvalues, treal_t *eigenvectors) const
 
void eigen_undecomp (const treal_t *D, const treal_t *V)
 

Static Public Member Functions

static void positive_definiteness (treal_t *metric)
 

Friends

std::ostream & operator<< (std::ostream &out, const MetricTensor< treal_t, dim > &metric)
 

Detailed Description

template<typename treal_t, int dim>
class MetricTensor< treal_t, dim >

symmetric metric tensor class.

Use to store and operate on metric tensors. The upper triangle is stored, i.e.

For 2D: m[0] m[1] .... m[2]

For 3D: m[0] m[1] m[2] .... m[3] m[4] .... .... m[5]

Definition at line 48 of file MetricTensor.h.

Constructor & Destructor Documentation

template<typename treal_t, int dim>
MetricTensor< treal_t, dim >::MetricTensor ( )
inline

Default constructor.

Definition at line 69 of file MetricTensor.h.

template<typename treal_t, int dim>
MetricTensor< treal_t, dim >::~MetricTensor ( )
inline

Default destructor.

Definition at line 72 of file MetricTensor.h.

template<typename treal_t, int dim>
MetricTensor< treal_t, dim >::MetricTensor ( const treal_t *  metric)
inline

Constructor. The upper triangle is expected, i.e.

For 2D: m[0] m[1] .... m[2]

For 3D: m[0] m[1] m[2] .... m[3] m[4] .... .... m[5]

Parameters
metricpoints to the upper triangle of the tensor.

Definition at line 88 of file MetricTensor.h.

template<typename treal_t, int dim>
MetricTensor< treal_t, dim >::MetricTensor ( const MetricTensor< treal_t, dim > &  metric)
inline

Copy constructor.

Parameters
metricis a reference to a MetricTensor object.

Definition at line 95 of file MetricTensor.h.

Member Function Documentation

template<typename treal_t, int dim>
treal_t MetricTensor< treal_t, dim >::average_length ( ) const
inline

Definition at line 370 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::constrain ( const treal_t *  M_in,
bool  perserved_small_edges = true 
)
inline

By default this calculates the superposition of two metrics where by default small edge lengths are preserved. If the optional argument perserved_small_edges==false then large edge lengths are perserved instead.

Parameters
Mis a reference to a MetricTensor object.
perserved_small_edgeswhen true causes small edge lengths to be preserved (default). Otherwise long edge are perserved.

Definition at line 186 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::eigen_decomp ( treal_t *  eigenvalues,
treal_t *  eigenvectors 
) const
inline

Definition at line 424 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::eigen_undecomp ( const treal_t *  D,
const treal_t *  V 
)
inline

Definition at line 455 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::get_metric ( treal_t *  metric)
inline

Copy back the metric tensor field.

Parameters
metricis a pointer to the buffer where the metric field can be copied.

Definition at line 111 of file MetricTensor.h.

template<typename treal_t, int dim>
const treal_t* MetricTensor< treal_t, dim >::get_metric ( ) const
inline

Give const pointer to metric tensor.

Definition at line 117 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::limit_aspect_ratio ( treal_t  max_ratio)
inline

Limits the ratio of the edge lengths.

Parameters
max_ratioThe maximum allowed ratio between edge lengths in the orthogonal

Definition at line 313 of file MetricTensor.h.

template<typename treal_t, int dim>
treal_t MetricTensor< treal_t, dim >::max_length ( ) const
inline

Definition at line 392 of file MetricTensor.h.

template<typename treal_t, int dim>
double MetricTensor< treal_t, dim >::min_length ( ) const
inline

Definition at line 408 of file MetricTensor.h.

template<typename treal_t, int dim>
const MetricTensor& MetricTensor< treal_t, dim >::operator= ( const MetricTensor< treal_t, dim > &  metric)
inline

Assignment operator.

Parameters
metricis a reference to a MetricTensor object.

Definition at line 102 of file MetricTensor.h.

template<typename treal_t, int dim>
static void MetricTensor< treal_t, dim >::positive_definiteness ( treal_t *  metric)
inlinestatic

Definition at line 143 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::scale ( treal_t  scale_factor)
inline

Definition at line 365 of file MetricTensor.h.

template<typename treal_t, int dim>
void MetricTensor< treal_t, dim >::set_metric ( const treal_t *  metric)
inline

Set the metric tensor field. The upper triangle is expected, i.e.

For 2D: m[0] m[1] .... m[2]

For 3D: m[0] m[1] m[2] .... m[3] m[4] .... .... m[5]

Parameters
metricis a pointer to the buffer where the metric field is to be copied from.

Definition at line 135 of file MetricTensor.h.

Friends And Related Function Documentation

template<typename treal_t, int dim>
std::ostream& operator<< ( std::ostream &  out,
const MetricTensor< treal_t, dim > &  metric 
)
friend

Stream operator.

Definition at line 490 of file MetricTensor.h.


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