HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_EdgeMeshBase< T > Class Template Referenceabstract

This base class implements the low-level solve routines for GU_EdgeMesh. More...

#include <GU_EdgeMesh.h>

+ Inheritance diagram for GU_EdgeMeshBase< T >:

Public Member Functions

 GU_EdgeMeshBase ()
 
virtual ~GU_EdgeMeshBase ()
 
virtual void buildMesh (const GU_Detail *gdp)=0
 
void setMinimumDistance (T min_dist)
 Set the minimum distance between adjacent nodes used by the solver. More...
 
template<bool USE_SPEEDS>
void solveEikonal (UT_Array< T > &times, const UT_Array< T > &speeds, const UT_Set< int > &starters) const
 
void laplacian (UT_Array< T > &result, const UT_Array< T > &vals) const
 Computes the Laplacian of the function defined in vals. More...
 
void weightedLaplacian (UT_Array< T > &result, const UT_Array< T > &vals, const UT_Array< T > &weights) const
 
void solvePoisson (UT_Array< T > &sol, const UT_Array< T > &rhs, const UT_Set< int > &pinned, T def=0) const
 
void solveDiffusion (UT_Array< T > &sol, const UT_Array< T > *rates, const UT_Set< int > &pinned, T dt) const
 

Protected Member Functions

void setDiffusionRatesCacheIds (bool used, GA_DataId id, float min_rate) const
 
void resetCache () const
 Resets the internal cache. Should only be called if the graph changed. More...
 

Protected Attributes

int myNumVertices
 Number of vertices in this graph. More...
 
UT_Array< UT_Set< int > > myVertexConnections
 Adjacency list for each vertex. More...
 
UT_Array< UT_Vector3T< T > > myVertexPositions
 Array of point locations in space. More...
 
gu_EMSolveCache< T > * mySolveCache
 Our solve cache to speed up subsequent similar solves. More...
 
T myMinDist2
 

Detailed Description

template<typename T>
class GU_EdgeMeshBase< T >

This base class implements the low-level solve routines for GU_EdgeMesh.

Definition at line 34 of file GU_EdgeMesh.h.

Constructor & Destructor Documentation

template<typename T >
GU_EdgeMeshBase< T >::GU_EdgeMeshBase ( )

The constructor does nothing... The programmer should interface with a concrete subclass which implements buildMesh() (like GU_EdgeMesh).

template<typename T >
virtual GU_EdgeMeshBase< T >::~GU_EdgeMeshBase ( )
virtual

Member Function Documentation

template<typename T >
virtual void GU_EdgeMeshBase< T >::buildMesh ( const GU_Detail gdp)
pure virtual

Implemented in GU_EdgeMesh< T >.

template<typename T >
void GU_EdgeMeshBase< T >::laplacian ( UT_Array< T > &  result,
const UT_Array< T > &  vals 
) const

Computes the Laplacian of the function defined in vals.

template<typename T >
void GU_EdgeMeshBase< T >::resetCache ( ) const
protected

Resets the internal cache. Should only be called if the graph changed.

template<typename T >
void GU_EdgeMeshBase< T >::setDiffusionRatesCacheIds ( bool  used,
GA_DataId  id,
float  min_rate 
) const
protected

Internal function to signal that the diffusion rates will be used for the next diffusion solve. This is for caching optimization.

template<typename T >
void GU_EdgeMeshBase< T >::setMinimumDistance ( T  min_dist)

Set the minimum distance between adjacent nodes used by the solver.

template<typename T >
void GU_EdgeMeshBase< T >::solveDiffusion ( UT_Array< T > &  sol,
const UT_Array< T > *  rates,
const UT_Set< int > &  pinned,
T  dt 
) const

Solves the boundary value problem for the heat equation. Vertices in pineed are the fixed Dirichlet boundary conditions, with their values given by the respective entry in sol. dt is size of the time step: its value must be positive. If provided, the rates array is assumed to contain conductivities at the vertices.

template<typename T >
template<bool USE_SPEEDS>
void GU_EdgeMeshBase< T >::solveEikonal ( UT_Array< T > &  times,
const UT_Array< T > &  speeds,
const UT_Set< int > &  starters 
) const

This function calculates arrival times for vertices given the starting vertices and propagation speeds. If USE_SPEEDS is false, the speeds array is unused; in this case, each vertex is assumed to have a speed of 1. times and speeds should come in pre-initialized. times(x) should be set to the respective arrival time for starters; for non-starters, it should be set to a large value (preferrably infinity).

template<typename T >
void GU_EdgeMeshBase< T >::solvePoisson ( UT_Array< T > &  sol,
const UT_Array< T > &  rhs,
const UT_Set< int > &  pinned,
T  def = 0 
) const

Solves the boundary value problem for the Poisson equation. Vertices in pinned are the boundary conditions, with their values given by the respective entry in sol. def is the default value to give to unpinned components.

template<typename T >
void GU_EdgeMeshBase< T >::weightedLaplacian ( UT_Array< T > &  result,
const UT_Array< T > &  vals,
const UT_Array< T > &  weights 
) const

Computes the weighted Laplacian (divergence of product of weights with the gradient of vals).

Member Data Documentation

template<typename T >
T GU_EdgeMeshBase< T >::myMinDist2
protected

Minimum squared distance between nodes; maximum edge weight is the reciprocal of this value.

Definition at line 100 of file GU_EdgeMesh.h.

template<typename T >
int GU_EdgeMeshBase< T >::myNumVertices
protected

Number of vertices in this graph.

Definition at line 90 of file GU_EdgeMesh.h.

template<typename T >
gu_EMSolveCache<T>* GU_EdgeMeshBase< T >::mySolveCache
protected

Our solve cache to speed up subsequent similar solves.

Definition at line 96 of file GU_EdgeMesh.h.

template<typename T >
UT_Array<UT_Set<int> > GU_EdgeMeshBase< T >::myVertexConnections
protected

Adjacency list for each vertex.

Definition at line 92 of file GU_EdgeMesh.h.

template<typename T >
UT_Array<UT_Vector3T<T> > GU_EdgeMeshBase< T >::myVertexPositions
protected

Array of point locations in space.

Definition at line 94 of file GU_EdgeMesh.h.


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