Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
ChastePoint< DIM > Class Template Reference

#include <ChastePoint.hpp>

+ Inheritance diagram for ChastePoint< DIM >:
+ Collaboration diagram for ChastePoint< DIM >:

Public Member Functions

 ChastePoint (double v1=0, double v2=0, double v3=0)
 
 ChastePoint (std::vector< double > coords)
 
 ChastePoint (c_vector< double, DIM > location)
 
c_vector< double, DIM > & rGetLocation ()
 
const c_vector< double, DIM > & rGetLocation () const
 
double operator[] (unsigned i) const
 
double GetWithDefault (unsigned i, double def=0.0) const
 
void SetCoordinate (unsigned i, double value)
 
bool IsSamePoint (const ChastePoint< DIM > &rPoint) const
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

c_vector< double, DIM > mLocation
 

Friends

class boost::serialization::access
 

Detailed Description

template<unsigned DIM>
class ChastePoint< DIM >

A ChastePoint class, templated over spatial dimension.

Definition at line 49 of file ChastePoint.hpp.

Constructor & Destructor Documentation

◆ ChastePoint() [1/3]

template<unsigned DIM>
ChastePoint< DIM >::ChastePoint ( double  v1 = 0,
double  v2 = 0,
double  v3 = 0 
)

Create a Point object. There are 3 optional arguments, which can be used to specify the values of the first 3 dimensions, if present.

Point now uses a ublas vector to store its location. The rGetLocation method returns a reference to this vector. Use of this method together with ublas operations is the perfered way to use this class.

Parameters
v1the point's x-coordinate (defaults to 0)
v2the point's y-coordinate (defaults to 0)
v3the point's z-coordinate (defaults to 0)

Definition at line 44 of file ChastePoint.cpp.

◆ ChastePoint() [2/3]

template<unsigned DIM>
ChastePoint< DIM >::ChastePoint ( std::vector< double coords)

Create a Point object. This constructor takes a vector giving the coordinates of the point. The length of the vector must be at least the dimension of the point.

Parameters
coordsa std::vector storing the point's coordinates

Definition at line 61 of file ChastePoint.cpp.

◆ ChastePoint() [3/3]

template<unsigned DIM>
ChastePoint< DIM >::ChastePoint ( c_vector< double, DIM >  location)

Alternative constructor which takes in a c_vector.

Parameters
locationa c_vector storing the point's coordinates

Definition at line 70 of file ChastePoint.cpp.

Member Function Documentation

◆ GetWithDefault()

template<unsigned DIM>
double ChastePoint< DIM >::GetWithDefault ( unsigned  i,
double  def = 0.0 
) const
Returns
a co-ordinate, returning the default value if the co-ordinate doesn't exist.
Parameters
ithe co-ordinate to get
defthe default value

Definition at line 95 of file ChastePoint.cpp.

◆ IsSamePoint()

template<unsigned DIM>
bool ChastePoint< DIM >::IsSamePoint ( const ChastePoint< DIM > &  rPoint) const

Checks whether one chaste point is the same as the one constructed

Parameters
rPointthe point to be checked
Returns
true if the are the same

Definition at line 115 of file ChastePoint.cpp.

◆ operator[]()

template<unsigned DIM>
double ChastePoint< DIM >::operator[] ( unsigned  i) const
Returns
the vector mLocation.
Parameters
ithe index of the vector to return

Definition at line 88 of file ChastePoint.cpp.

◆ rGetLocation() [1/2]

◆ rGetLocation() [2/2]

template<unsigned DIM>
const c_vector< double, DIM > & ChastePoint< DIM >::rGetLocation ( ) const
Returns
the location of the Point. Constant non-liberal variety.

Definition at line 82 of file ChastePoint.cpp.

◆ serialize()

template<unsigned DIM>
template<class Archive >
void ChastePoint< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archive
version

Definition at line 60 of file ChastePoint.hpp.

◆ SetCoordinate()

template<unsigned DIM>
void ChastePoint< DIM >::SetCoordinate ( unsigned  i,
double  value 
)

Set one of the coordinates of the Point.

Parameters
ithe index of the coordinate
valuethe value of the coordinate

Definition at line 108 of file ChastePoint.cpp.

Referenced by Cylindrical2dMesh::SetNode(), Toroidal2dMesh::SetNode(), Cylindrical2dVertexMesh::SetNode(), Toroidal2dVertexMesh::SetNode(), Cylindrical2dNodesOnlyMesh::SetNode(), and PeriodicNodesOnlyMesh< SPACE_DIM >::SetNode().

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 52 of file ChastePoint.hpp.

Member Data Documentation

◆ mLocation

template<unsigned DIM>
c_vector<double, DIM> ChastePoint< DIM >::mLocation
private

The location of the Point.

Definition at line 68 of file ChastePoint.hpp.


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