Chaste  Build::
Vessel< DIM > Class Template Reference

#include <Vessel.hpp>

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

Public Member Functions

 ~Vessel ()
 
void AddSegment (boost::shared_ptr< VesselSegment< DIM > > pSegment)
 
void AddSegments (std::vector< boost::shared_ptr< VesselSegment< DIM > > > pSegments)
 
void CopyDataFromExistingVessel (boost::shared_ptr< Vessel< DIM > > pTargetVessel)
 
boost::shared_ptr< VesselNode< DIM > > DivideSegment (const DimensionalChastePoint< DIM > &rLocation, double distanceTolerance=1.e-6)
 
units::quantity< unit::length > GetClosestEndNodeDistance (const DimensionalChastePoint< DIM > &rLocation)
 
units::quantity< unit::length > GetDistance (const DimensionalChastePoint< DIM > &rLocation) const
 
std::vector< boost::shared_ptr< Vessel< DIM > > > GetConnectedVessels ()
 
boost::shared_ptr< VesselNode< DIM > > GetEndNode ()
 
boost::shared_ptr< VesselFlowProperties< DIM > > GetFlowProperties () const
 
boost::shared_ptr< VesselNode< DIM > > GetNodeAtOppositeEnd (boost::shared_ptr< VesselNode< DIM > > pQueryNode)
 
units::quantity< unit::length > GetLength () const
 
units::quantity< unit::length > GetRadius () const
 
boost::shared_ptr< VesselNode< DIM > > GetNode (unsigned index)
 
std::vector< boost::shared_ptr< VesselNode< DIM > > > GetNodes ()
 
const std::vector< boost::shared_ptr< VesselNode< DIM > > > & rGetNodes ()
 
unsigned GetNumberOfNodes ()
 
unsigned GetNumberOfSegments ()
 
std::map< std::string, double > GetOutputData ()
 
boost::shared_ptr< VesselSegment< DIM > > GetSegment (unsigned index)
 
std::vector< boost::shared_ptr< VesselSegment< DIM > > > GetSegments ()
 
boost::shared_ptr< VesselNode< DIM > > GetStartNode ()
 
bool IsConnectedTo (boost::shared_ptr< Vessel< DIM > > pOtherVessel)
 
void Remove ()
 
void RemoveSegments (SegmentLocation::Value location)
 
void SetRadius (units::quantity< unit::length > radius)
 
void SetFlowProperties (const VesselFlowProperties< DIM > &rFlowProperties)
 
void UpdateNodes ()
 
- Public Member Functions inherited from AbstractVesselNetworkComponent< DIM >
 AbstractVesselNetworkComponent ()
 
virtual ~AbstractVesselNetworkComponent ()
 
virtual unsigned GetId () const
 
virtual double GetOutputDataValue (const std::string &rKey)
 
virtual std::vector< std::string > GetOutputDataKeys ()
 
virtual void SetId (unsigned id)
 
virtual void SetOutputData (const std::string &rKey, double value)
 

Static Public Member Functions

static boost::shared_ptr< Vessel< DIM > > Create (boost::shared_ptr< VesselSegment< DIM > > pSegment)
 
static boost::shared_ptr< Vessel< DIM > > Create (std::vector< boost::shared_ptr< VesselSegment< DIM > > > segments)
 
static boost::shared_ptr< Vessel< DIM > > Create (std::vector< boost::shared_ptr< VesselNode< DIM > > > nodes)
 
static boost::shared_ptr< Vessel< DIM > > Create (boost::shared_ptr< VesselNode< DIM > > pStartNode, boost::shared_ptr< VesselNode< DIM > > pEndNode)
 

Private Member Functions

 Vessel (boost::shared_ptr< VesselSegment< DIM > > pSegment)
 
 Vessel (std::vector< boost::shared_ptr< VesselSegment< DIM > > > segments)
 
 Vessel (std::vector< boost::shared_ptr< VesselNode< DIM > > > nodes)
 
 Vessel (boost::shared_ptr< VesselNode< DIM > > pStartNode, boost::shared_ptr< VesselNode< DIM > > pEndNode)
 
boost::shared_ptr< Vessel< DIM > > Shared ()
 

Private Attributes

std::vector< boost::shared_ptr< VesselSegment< DIM > > > mSegments
 
std::vector< boost::shared_ptr< VesselNode< DIM > > > mNodes
 
bool mNodesUpToDate
 
boost::shared_ptr< VesselFlowProperties< DIM > > mpFlowProperties
 

Additional Inherited Members

- Protected Attributes inherited from AbstractVesselNetworkComponent< DIM >
std::map< std::string, double > mOutputData
 
unsigned mId
 
units::quantity< unit::length > mRadius
 

Detailed Description

template<unsigned DIM>
class Vessel< DIM >

This is a class for vessels. A vessel is a component of a vessel network. Vessels are a collection of connected straight-line segments, such as a polyline. Vessel data and properties are derived from averaging or summing over their segments as required.

Definition at line 69 of file Vessel.hpp.

Constructor & Destructor Documentation

template<unsigned DIM>
Vessel< DIM >::Vessel ( boost::shared_ptr< VesselSegment< DIM > >  pSegment)
private

Constructor. Kept private as the factory Create methods should be used instead.

The vessel should always have at least one segment.

Parameters
pSegmentthe input segment

Definition at line 43 of file Vessel.cpp.

References Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
Vessel< DIM >::Vessel ( std::vector< boost::shared_ptr< VesselSegment< DIM > > >  segments)
private

Alternate Constructor. Kept private as the factory Create methods should be used instead.

The vessel should always have at least one segment. This is useful for initializing with many segments at once.

Parameters
segmentsa collection of segments, should be joined end to tip

Definition at line 55 of file Vessel.cpp.

References Vessel< DIM >::IsConnectedTo(), Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
Vessel< DIM >::Vessel ( std::vector< boost::shared_ptr< VesselNode< DIM > > >  nodes)
private

Alternate Constructor. Kept private as the factory Create methods should be used instead.

Initialize with a vector of nodes. The nodes are joined by segments in order. The ends are not closed.

Parameters
nodesthese nodes will be joined to form the vessel

Definition at line 90 of file Vessel.cpp.

References Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
Vessel< DIM >::Vessel ( boost::shared_ptr< VesselNode< DIM > >  pStartNode,
boost::shared_ptr< VesselNode< DIM > >  pEndNode 
)
private

Alternate Constructor. Kept private as the factory Create methods should be used instead. Initialize with two nodes.

Parameters
pStartNodethe start node
pEndNodethe end node

Definition at line 112 of file Vessel.cpp.

References Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
Vessel< DIM >::~Vessel ( )

Destructor.

Definition at line 123 of file Vessel.cpp.

Member Function Documentation

template<unsigned DIM>
void Vessel< DIM >::AddSegment ( boost::shared_ptr< VesselSegment< DIM > >  pSegment)

Add a single segment to either end of the vessel

Parameters
pSegmentthe segment

Definition at line 181 of file Vessel.cpp.

References Vessel< DIM >::mNodesUpToDate, Vessel< DIM >::mpFlowProperties, Vessel< DIM >::mSegments, and Vessel< DIM >::Shared().

template<unsigned DIM>
void Vessel< DIM >::AddSegments ( std::vector< boost::shared_ptr< VesselSegment< DIM > > >  pSegments)

Add a collection of segments to either end of the vessel

Parameters
pSegmentsthe segments

Definition at line 233 of file Vessel.cpp.

References Vessel< DIM >::IsConnectedTo(), Vessel< DIM >::mNodesUpToDate, Vessel< DIM >::mpFlowProperties, Vessel< DIM >::mSegments, and Vessel< DIM >::Shared().

template<unsigned DIM>
void Vessel< DIM >::CopyDataFromExistingVessel ( boost::shared_ptr< Vessel< DIM > >  pTargetVessel)

Copy the member data from the input vessel.

Parameters
pTargetVesselthe vessel to be copied from

Definition at line 294 of file Vessel.cpp.

References AbstractVesselNetworkComponent< DIM >::mOutputData.

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > Vessel< DIM >::Create ( boost::shared_ptr< VesselSegment< DIM > >  pSegment)
static

Construct a new instance of the class and return a shared pointer to it.

Parameters
pSegmentthe input segment
Returns
a pointer to the vessel

Definition at line 128 of file Vessel.cpp.

Referenced by VesselNetwork< DIM >::DivideVessel(), VesselNetwork< DIM >::FormSprout(), and VesselNetworkGenerator< DIM >::SetReferenceLengthScale().

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > Vessel< DIM >::Create ( std::vector< boost::shared_ptr< VesselSegment< DIM > > >  segments)
static

Construct a new instance of the class and return a shared pointer to it.

Parameters
segmentsa collection of segments, should be joined end to tip
Returns
a pointer to the vessel

Definition at line 138 of file Vessel.cpp.

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > Vessel< DIM >::Create ( std::vector< boost::shared_ptr< VesselNode< DIM > > >  nodes)
static

Construct a new instance of the class and return a shared pointer to it.

Parameters
nodesthese nodes will be joined to form the vessel
Returns
a pointer to the vessel

Definition at line 151 of file Vessel.cpp.

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > Vessel< DIM >::Create ( boost::shared_ptr< VesselNode< DIM > >  pStartNode,
boost::shared_ptr< VesselNode< DIM > >  pEndNode 
)
static

Construct a new instance of the class and return a shared pointer to it.

Parameters
pStartNodethe start node
pEndNodethe end node
Returns
a pointer to the vessel

Definition at line 166 of file Vessel.cpp.

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > Vessel< DIM >::DivideSegment ( const DimensionalChastePoint< DIM > &  rLocation,
double  distanceTolerance = 1.e-6 
)

Divide the vessel at the specified location

Parameters
rLocationthe location of the division
distanceTolerancehow far from a segment should the probe point be
Returns
the node at the division

Definition at line 300 of file Vessel.cpp.

References VesselSegment< DIM >::CopyDataFromExistingSegment(), VesselSegment< DIM >::Create(), VesselNode< DIM >::Create(), Vessel< DIM >::GetDistance(), Vessel< DIM >::IsConnectedTo(), Vessel< DIM >::mNodesUpToDate, Vessel< DIM >::mpFlowProperties, Vessel< DIM >::mSegments, and Vessel< DIM >::Shared().

template<unsigned DIM>
units::quantity< unit::length > Vessel< DIM >::GetClosestEndNodeDistance ( const DimensionalChastePoint< DIM > &  rLocation)

Return the dimensionless distance to the vessel end node closest to the input location

Parameters
rLocationthe location to probe
Returns
the distance to the closest end node

Definition at line 462 of file Vessel.cpp.

References Vessel< DIM >::GetEndNode(), and Vessel< DIM >::GetStartNode().

template<unsigned DIM>
std::vector< boost::shared_ptr< Vessel< DIM > > > Vessel< DIM >::GetConnectedVessels ( )
Returns
vector of vessels connected to this one

Definition at line 493 of file Vessel.cpp.

References Vessel< DIM >::GetStartNode(), and Vessel< DIM >::Shared().

template<unsigned DIM>
units::quantity< unit::length > Vessel< DIM >::GetDistance ( const DimensionalChastePoint< DIM > &  rLocation) const

Return the distance from the vessel to the input location

Parameters
rLocationthe location to probe
Returns
the distance from the vessel to the input location

Definition at line 477 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

Referenced by Vessel< DIM >::DivideSegment().

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > Vessel< DIM >::GetEndNode ( )
Returns
shared pointer to the second node of the last segment

Definition at line 518 of file Vessel.cpp.

References Vessel< DIM >::mNodes, Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

Referenced by Vessel< DIM >::GetClosestEndNodeDistance(), Vessel< DIM >::GetNodeAtOppositeEnd(), and Vessel< DIM >::IsConnectedTo().

template<unsigned DIM>
boost::shared_ptr< VesselFlowProperties< DIM > > Vessel< DIM >::GetFlowProperties ( ) const

Return the flow properties of the component

Returns
the flow properties of the component

Definition at line 445 of file Vessel.cpp.

References Vessel< DIM >::mpFlowProperties.

template<unsigned DIM>
units::quantity< unit::length > Vessel< DIM >::GetLength ( ) const

Return the length

Returns
the length

Definition at line 552 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > Vessel< DIM >::GetNode ( unsigned  index)

Return the vessel node

Parameters
indexthe query index
Returns
the vessel node

Definition at line 574 of file Vessel.cpp.

References Vessel< DIM >::mNodes, Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

Referenced by VesselNetworkWriter< DIM >::GetOutput(), and Vessel< DIM >::UpdateNodes().

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > Vessel< DIM >::GetNodeAtOppositeEnd ( boost::shared_ptr< VesselNode< DIM > >  pQueryNode)
Parameters
pQueryNodethe query node
Returns
shared pointer to the node at the opposite end of the vessel to the supplied one.

Definition at line 529 of file Vessel.cpp.

References Vessel< DIM >::GetEndNode(), Vessel< DIM >::GetStartNode(), Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

template<unsigned DIM>
std::vector< boost::shared_ptr< VesselNode< DIM > > > Vessel< DIM >::GetNodes ( )

Return the vessel's nodes

Returns
the vessel nodes

Definition at line 588 of file Vessel.cpp.

References Vessel< DIM >::mNodes, Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

template<unsigned DIM>
unsigned Vessel< DIM >::GetNumberOfNodes ( )

Return the number of nodes in the vessel

Returns
unsigned the number of nodes

Definition at line 608 of file Vessel.cpp.

References Vessel< DIM >::GetNumberOfSegments(), Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

template<unsigned DIM>
unsigned Vessel< DIM >::GetNumberOfSegments ( )
Returns
the number of segments

Definition at line 618 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

Referenced by Vessel< DIM >::GetNumberOfNodes().

template<unsigned DIM>
std::map< std::string, double > Vessel< DIM >::GetOutputData ( )
virtual

Return a map of vessel data for use by the vtk writer

Returns
a map of vessel data for use by the vtk writer

Implements AbstractVesselNetworkComponent< DIM >.

Definition at line 451 of file Vessel.cpp.

References AbstractVesselNetworkComponent< DIM >::GetId(), Vessel< DIM >::GetRadius(), AbstractVesselNetworkComponent< DIM >::mOutputData, and Vessel< DIM >::mpFlowProperties.

template<unsigned DIM>
units::quantity< unit::length > Vessel< DIM >::GetRadius ( ) const
virtual

Return the radius

Returns
the radius

Reimplemented from AbstractVesselNetworkComponent< DIM >.

Definition at line 563 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

Referenced by Vessel< DIM >::GetOutputData().

template<unsigned DIM>
boost::shared_ptr< VesselSegment< DIM > > Vessel< DIM >::GetSegment ( unsigned  index)
Parameters
indexthe segment index to return
Returns
the indexed segment

Definition at line 624 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

template<unsigned DIM>
std::vector< boost::shared_ptr< VesselSegment< DIM > > > Vessel< DIM >::GetSegments ( )
Returns
all the vessel segments

Definition at line 634 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

template<unsigned DIM>
boost::shared_ptr< VesselNode< DIM > > Vessel< DIM >::GetStartNode ( )
template<unsigned DIM>
bool Vessel< DIM >::IsConnectedTo ( boost::shared_ptr< Vessel< DIM > >  pOtherVessel)
Parameters
pOtherVesselthe other vessel to check for connect
Returns
whether the vessel is connected to another vessel.

Definition at line 650 of file Vessel.cpp.

References Vessel< DIM >::GetEndNode(), and Vessel< DIM >::GetStartNode().

Referenced by Vessel< DIM >::AddSegments(), Vessel< DIM >::DivideSegment(), and Vessel< DIM >::Vessel().

template<unsigned DIM>
void Vessel< DIM >::Remove ( )

Remove the vessel from all its segments

Definition at line 664 of file Vessel.cpp.

References Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::mSegments.

template<unsigned DIM>
void Vessel< DIM >::RemoveSegments ( SegmentLocation::Value  location)

Remove segments from the ends of a vessel

Parameters
locationwhich end to remove from

Definition at line 676 of file Vessel.cpp.

References Vessel< DIM >::mNodesUpToDate, Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
const std::vector< boost::shared_ptr< VesselNode< DIM > > > & Vessel< DIM >::rGetNodes ( )

Return a reference to the vessel node vector, avoids a copy

Returns
a reference to the vessel node vector

Definition at line 598 of file Vessel.cpp.

References Vessel< DIM >::mNodes, Vessel< DIM >::mNodesUpToDate, and Vessel< DIM >::UpdateNodes().

template<unsigned DIM>
void Vessel< DIM >::SetFlowProperties ( const VesselFlowProperties< DIM > &  rFlowProperties)

Set the flow properties of the vessel

Parameters
rFlowPropertiesthe flow properties to be set

Definition at line 701 of file Vessel.cpp.

References Vessel< DIM >::mpFlowProperties, and Vessel< DIM >::mSegments.

template<unsigned DIM>
void Vessel< DIM >::SetRadius ( units::quantity< unit::length >  radius)
virtual

Set the radius

Parameters
radiusthe radius

Reimplemented from AbstractVesselNetworkComponent< DIM >.

Definition at line 708 of file Vessel.cpp.

References Vessel< DIM >::mSegments.

template<unsigned DIM>
boost::shared_ptr< Vessel< DIM > > Vessel< DIM >::Shared ( )
private
Returns
boost::shared_ptr<Vessel<DIM> >

Definition at line 717 of file Vessel.cpp.

Referenced by Vessel< DIM >::AddSegment(), Vessel< DIM >::AddSegments(), Vessel< DIM >::DivideSegment(), and Vessel< DIM >::GetConnectedVessels().

Member Data Documentation

template<unsigned DIM>
std::vector<boost::shared_ptr<VesselNode<DIM> > > Vessel< DIM >::mNodes
private
template<unsigned DIM>
boost::shared_ptr<VesselFlowProperties<DIM> > Vessel< DIM >::mpFlowProperties
private

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