flippy
a c++20 package for dynamically triangulated membrane simulations.
Loading...
Searching...
No Matches
fp::Geometry Struct Reference

A helper struct. Used by the triangulation class to pass data around in one convenient package. More...

#include <Triangulation.hpp>

Collaboration diagram for fp::Geometry:

Public Member Functions

 Geometry ()
 Default constructor, that zero initiates all the data members.
 
 Geometry (Node const &node)
 Construct from a node.
 
 Geometry (Real area_inp, Real volume_inp)
 Direct Constructor.
 
void operator+= (Node const &node)
 Overloaded addition and assignment operator.
 

Public Attributes

Real area
 Area of the patch. Sum over the associated areas of individual nodes that comprise the patch. (Compare to Node::area).
 
Real volume
 

Friends

Geometry operator+ (Geometry const &lhs, Geometry const &rhs)
 Overloaded addition operator.
 
Geometry operator- (Geometry const &lhs, Geometry const &rhs)
 Overloaded subtraction operator.
 
void operator+= (Geometry &lhs, Geometry const &rhs)
 Overloaded addition and assignment operator.
 
void operator-= (Geometry &lhs, Geometry const &rhs)
 Overloaded subtraction and assignment operator.
 

Detailed Description

A helper struct. Used by the triangulation class to pass data around in one convenient package.

Geometry is a struct that contains the usually needed geometric data in a triangulation. This struct can hold such data for a single node, a collection of nodes, or the entire triangulation. In the abstract, the fp::Geometry struct contains geometric data associated with some surface patch. This is useful since we often need to aggregate information for a node and its neighboring nodes.

The Data members of this struct are public, and thus, it does not guarantee the correctness or consistency of the data it holds, since it can be changed externally. The geometry struct also provides overloaded arithmetic operators, that are usually useful when aggregating geometric data from single nodes over a larger patch of the surface.

Template Parameters
Realtype that will be used for all floating point numbers inside this class/struct. Any data type that satisfies the floating_point_number concept is allowed, for example, float.
Indextype that will be used for all integer numbers inside this class/struct. Any data type that satisfies the indexing_number concept is allowed, for example, unsigned int.

Constructor & Destructor Documentation

◆ Geometry() [1/2]

fp::Geometry::Geometry ( Node const & node)
inlineexplicit

Construct from a node.

Parameters
nodeInitiates data members of the struct with the geometric values of this single node.

◆ Geometry() [2/2]

fp::Geometry::Geometry ( Real area_inp,
Real volume_inp )
inline

Direct Constructor.

Initiates data members from directly provided numeric values.

Parameters
area_inpInput area.
volume_inpInput volume.
unit_bending_energy_inpInput unit bending energy.

Member Function Documentation

◆ operator+=()

void fp::Geometry::operator+= ( Node const & node)
inline

Overloaded addition and assignment operator.

Can accumulate a node onto a Geometry struct.

Parameters
nodeGeometric data from this node is added to the corresponding data members of the Geometry struct.

Friends And Related Symbol Documentation

◆ operator+

Geometry operator+ ( Geometry const & lhs,
Geometry const & rhs )
friend

Overloaded addition operator.

Implements addition between two Geometries. Each data member of lhs and rhs Geometries is added pairwise and stored in the corresponding data member of the returned struct.

++
//Example
res.area == lhs.area + rhs.area; // true
res.volume == lhs.volume + rhs.volume; // true
res.unit_bending_energy == lhs.unit_bending_energy + rhs.unit_bending_energy; // true
A helper struct. Used by the triangulation class to pass data around in one convenient package.
Definition Triangulation.hpp:138
Real area
Area of the patch. Sum over the associated areas of individual nodes that comprise the patch....
Definition Triangulation.hpp:139
Real volume
Definition Triangulation.hpp:140
Parameters
lhs
rhs
Returns
lhs+rhs

◆ operator-

Geometry operator- ( Geometry const & lhs,
Geometry const & rhs )
friend

Overloaded subtraction operator.

Implements subtraction between two Geometries. Each data member of lhs and rhs Geometries is subtracted pairwise and stored in the corresponding data member of the returned struct.

++
//Example
res.area == lhs.area - rhs.area; // true
res.volume == lhs.volume - rhs.volume; // true
res.unit_bending_energy == lhs.unit_bending_energy - rhs.unit_bending_energy; // true
Parameters
lhs
rhs
Returns
lhs-rhs

◆ operator+=

void operator+= ( Geometry & lhs,
Geometry const & rhs )
friend

Overloaded addition and assignment operator.

Works through the use of an already overloaded addition operator and simply performs lhs = lhs + rhs;.

Parameters
lhs
rhs
See also
Geometry operator+(Geometry const& lhs, Geometry const& rhs)

◆ operator-=

void operator-= ( Geometry & lhs,
Geometry const & rhs )
friend

Overloaded subtraction and assignment operator.

Works through the use of an already overloaded subtraction operator and simply performs lhs = lhs - rhs;.

Parameters
lhs
rhs
See also
Geometry operator-(Geometry const& lhs, Geometry const& rhs)

Member Data Documentation

◆ volume

Real fp::Geometry::volume

Volume of the patch. Sum over the associated volumes of individual nodes that comprise the patch. (Compare to Node::volume).


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