HDK
|
This base class implements the low-level solve routines for GU_EdgeMesh. More...
#include <GU_EdgeMesh.h>
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 > ×, 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 |
This base class implements the low-level solve routines for GU_EdgeMesh.
Definition at line 34 of file GU_EdgeMesh.h.
GU_EdgeMeshBase< T >::GU_EdgeMeshBase | ( | ) |
The constructor does nothing... The programmer should interface with a concrete subclass which implements buildMesh() (like GU_EdgeMesh).
|
virtual |
|
pure virtual |
Implemented in GU_EdgeMesh< 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.
|
protected |
Resets the internal cache. Should only be called if the graph changed.
|
protected |
Internal function to signal that the diffusion rates will be used for the next diffusion solve. This is for caching optimization.
void GU_EdgeMeshBase< T >::setMinimumDistance | ( | T | min_dist | ) |
Set the minimum distance between adjacent nodes used by the solver.
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.
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).
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.
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).
|
protected |
Minimum squared distance between nodes; maximum edge weight is the reciprocal of this value.
Definition at line 100 of file GU_EdgeMesh.h.
|
protected |
Number of vertices in this graph.
Definition at line 90 of file GU_EdgeMesh.h.
|
protected |
Our solve cache to speed up subsequent similar solves.
Definition at line 96 of file GU_EdgeMesh.h.
|
protected |
Adjacency list for each vertex.
Definition at line 92 of file GU_EdgeMesh.h.
|
protected |
Array of point locations in space.
Definition at line 94 of file GU_EdgeMesh.h.