44namespace fast_multipole_embedder {
49 std::list<LinearQuadtree::NodeID>
nodes;
52 template<
typename Func>
173 for (
uint32_t i = begin; i <= end; i++) {
321 fx + offset,
fy + offset, numPoints);
338 ,
tree(pLocalContext->pGlobalContext->pQuadtree)
339 ,
localContexts(pLocalContext->pGlobalContext->pLocalContext) { }
409 l_par.push_back(nodeID);
422 while (!
l_par.empty()) {
466 for (
uint32_t i = begin; i <= end; i++) {
493 for (
uint32_t i = begin; i <= end; i++) {
527 for (
uint32_t i = begin; i <= end; i++) {
562 for (
uint32_t i = begin; i <= end; i++) {
603 for (
uint32_t i = begin; i <= end; i++) {
619template<
unsigned int FLAGS>
647 float fa =
f * 0.25f;
648 float fb =
f * 0.25f;
666 for (
uint32_t i = begin; i <= end; i++) {
684template<
unsigned int FLAGS>
704 return static_cast<int>(lhs) |
static_cast<int>(rhs);
707template<
unsigned int FLAGS>
757 for (
uint32_t i = begin; i <= end; i++) {
772template<
unsigned int FLAGS>
782template<
unsigned int FLAGS>
846 for (
uint32_t i = begin; i <= end; i++) {
863template<
unsigned int FLAGS>
868template<
typename TYP>
872 if (threadNr == numThreads - 1) {
873 s = s + (n % numThreads);
Declaration of class ArrayGraph.
Declaration of FME kernel.
Declaration of class LinearQuadtree.
Declaration of class LinearQuadtreeBuilder.
Declaration of class LinearQuadtreeExpansion.
Declaration of class WSPD (well-separated pair decomposition).
float * nodeMoveRadius()
Returns the node movement radius array for all nodes.
float * nodeXPos()
Returns the x coord array for all nodes.
uint32_t numEdges() const
Returns the number of edges.
EdgeAdjInfo & edgeInfo(uint32_t i)
Returns the adjacency information for the edge at index i in m_edgeAdj.
float * nodeYPos()
Returns the y coord array for all nodes.
NodeAdjInfo & nodeInfo(uint32_t i)
Returns the adjacency information for the node at index i in m_nodeAdj.
float * nodeSize()
Returns the node size array for all nodes.
uint32_t numNodes() const
Returns the number of nodes.
float * desiredEdgeLength()
Returns the edge length array for all edges.
CollectForceFunctor(FMELocalContext *pLocalContext)
FMEGlobalContext * globalContext
uint32_t operator()(void) const
void operator()(uint32_t begin, uint32_t end)
FMELocalContext ** localContexts
void operator()(uint32_t i)
Calculates the repulsive forces acting between all nodes of the direct interacting cells of the i-th ...
D2DFunctor(FMELocalContext *pLocalContext)
void operator()(uint32_t begin, uint32_t end)
LinearQuadtree * quadtree
uint32_t operator()(void) const
LinearQuadtreeExpansion * quadtreeExp
void operator()(uint32_t i)
Information about an edge (16 bytes).
void operator()(uint32_t begin, uint32_t end)
void operator()(uint32_t i)
float * desiredEdgeLength
uint32_t operator()(void) const
EdgeForceFunctor(FMELocalContext *pLocalContext)
Computes the coords and size of the i-th node in the LinearQuadtree.
LQCoordsFunctor(FMELocalContext *pLocalContext)
uint32_t operator()(void) const
LinearQuadtree * quadtree
void operator()(uint32_t begin, uint32_t end)
LinearQuadtreeExpansion * quadtreeExp
void operator()(uint32_t i)
LQMortonFunctor(FMELocalContext *pLocalContext)
void operator()(uint32_t i)
uint32_t operator()(void) const
void operator()(uint32_t begin, uint32_t end)
LinearQuadtree * quadtree
The partitioner which partitions the quadtree into subtrees and partitions the sequence of inner node...
LQPartitioner(FMELocalContext *pLocalContext)
FMELocalContext ** localContexts
std::list< uint32_t > l_par
void newPartition(uint32_t nodeID)
void partitionNodeChains()
FMETreePartition * currPartition()
uint32_t numPointsPerThread
void operator()(uint32_t begin, uint32_t end)
LQPointUpdateFunctor(FMELocalContext *pLocalContext)
LinearQuadtree * quadtree
uint32_t operator()(void) const
void operator()(uint32_t i)
void P2M(uint32_t point, uint32_t receiver)
adds a point with the given charge to the receiver expansion
void M2L(uint32_t source, uint32_t receiver)
converts the source multipole coefficient in to a local coefficients at the center of the receiver an...
void M2M(uint32_t source, uint32_t receiver)
shifts the source multipole coefficient to the center of the receiver and adds them
void L2P(uint32_t source, uint32_t point, float &fx, float &fy)
evaluates the derivate of the local expansion at the point and adds the forces to fx fy
void L2L(uint32_t source, uint32_t receiver)
shifts the source local coefficient to the center of the receiver and adds them
uint32_t numberOfLeaves() const
NodeID directNode(uint32_t i) const
uint32_t numberOfDirectPairs() const
void computeCoords(NodeID nodeIndex)
void nodeFence(NodeID nodeID)
PointID firstPoint(NodeID nodeID) const
uint32_t refOfPoint(PointID id) const
uint32_t numberOfChilds(NodeID nodeID) const
returns the number of children of node nodeID. for an inner node this is 1..4 and can be accessed by ...
float pointSize(PointID point) const
NodeID directNodeA(uint32_t i) const
NodeID nextNode(NodeID nodeID) const
forall_children_functor< F > forall_children(F f) const
creator
void setPoint(PointID id, float x, float y, uint32_t ref)
uint32_t numberOfDirectNodes() const
NodeID child(NodeID nodeID, uint32_t i) const
returns the i th child index of node nodeID
float pointY(PointID point) const
NodeID firstInnerNode() const
NodeID root() const
returns the index of the root
bool isLeaf(NodeID nodeID) const
returns true if the given node index is a leaf
NodeID pointLeaf(PointID point) const
uint32_t numberOfInnerNodes() const
float pointX(PointID point) const
NodeID directNodeB(uint32_t i) const
LQPoint & point(PointID pointID)
uint32_t numberOfPoints(NodeID nodeID) const
returns the number of points contained in the subtree of node nodeID
uint32_t numberOfNodes() const
returns the number of nodes in this tree
Converts the multipole expansion coefficients from all nodes which are well separated from the i-th n...
M2LFunctor(FMELocalContext *pLocalContext)
void operator()(uint32_t i)
LinearQuadtree * quadtree
void operator()(uint32_t begin, uint32_t end)
uint32_t operator()(void) const
LinearQuadtreeExpansion * quadtreeExp
Calculates the repulsive forces acting between all nodes inside the cell of the i-th LinearQuadtree n...
void operator()(uint32_t begin, uint32_t end)
void operator()(uint32_t i)
LinearQuadtreeExpansion * quadtreeExp
uint32_t operator()(void) const
NDFunctor(FMELocalContext *pLocalContext)
LinearQuadtree * quadtree
Information about incident edges (16 bytes).
uint32_t degree
Total count of pairs where is either the first or second node.
FMELocalContext * localContext
float * currentEdgeLength
void operator()(uint32_t i)
void operator()(uint32_t begin, uint32_t end)
NodeMoveFunctor(FMELocalContext *pLocalContext)
Class for the Well-Separated-Pairs-Decomposition (WSPD)
uint32_t nextPair(uint32_t currPairIndex, NodeID a) const
Returns the index of the next pair of currPairIndex of the node with index a.
uint32_t firstPairEntry(NodeID nodeID) const
Returns the index of the first pair of node nodeID.
uint32_t numWSNodes(NodeID a) const
Returns the number of well separated nodes for node a.
uint32_t wsNodeOfPair(uint32_t currPairIndex, NodeID a) const
Returns the other node (not a) of the pair with index currPairIndex.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
static m2l_functor m2l_function(FMELocalContext *pLocalContext)
creates Multipole-to-Local functor
static pair_call_functor< F, A > pair_call(F f, A a)
creates a pair call resulting in a call f(a, *)
static CollectForceFunctor< FLAGS > collect_force_function(FMELocalContext *pLocalContext)
static min_max_functor< float > min_max_x_function(FMELocalContext *pLocalContext)
creates a min max functor for the x coords of the node
static constexpr int USE_NODE_MOVE_RAD
static m2m_functor m2m_function(FMELocalContext *pLocalContext)
creates Multipole-to-Multipole functor
static NodeMoveFunctor< FLAGS > node_move_function(FMELocalContext *pLocalContext)
static p2p_functor p2p_function(FMELocalContext *pLocalContext)
creates Local-to-Point functor
static min_max_functor< float > min_max_y_function(FMELocalContext *pLocalContext)
creates a min max functor for the y coords of the node
int operator&(int lhs, FMEEdgeForce rhs)
void eval_direct_fast(float *x, float *y, float *s, float *fx, float *fy, size_t n)
kernel function to evaluate forces between n points with coords x, y directly. result is stored in fx...
static l2p_functor l2p_function(FMELocalContext *pLocalContext)
creates Local-to-Point functor
static l2l_functor l2l_function(FMELocalContext *pLocalContext)
creates Local-to-Local functor
static p2m_functor p2m_function(FMELocalContext *pLocalContext)
creates a Point-to-Multipole functor
static constexpr int ZERO_GLOBAL_ARRAY
static constexpr int TIME_STEP_NORMAL
static EdgeForceFunctor< FLAGS > edge_force_function(FMELocalContext *pLocalContext)
constexpr int operator|(int lhs, FMECollect rhs)
static constexpr int TIME_STEP_PREP
void for_loop_array_set(uint32_t threadNr, uint32_t numThreads, TYP *a, uint32_t n, TYP value)
The namespace for all OGDF objects.
uint32_t numThreads
number of threads, local contexts
bool earlyExit
var for the main thread to notify the other threads that they are done
FMELocalContext ** pLocalContext
all local contexts
float * globalForceX
the global node force x array
float max_y
global point, node max y coordinate for bounding box calculations
float min_y
global point, node min y coordinate for bounding box calculations
float max_x
global point, node max x coordinate for bounding box calculations
ArrayGraph * pGraph
pointer to the array graph
FMEGlobalOptions * pOptions
pointer to the global options
float * globalForceY
the global node force y array
LinearQuadtreeExpansion * pExpansion
pointer to the coeefficients
float min_x
global point, node min x coordinate for bounding box calculations
WSPD * pWSPD
pointer to the well separated pairs decomposition
LinearQuadtree * pQuadtree
pointer to the quadtree
the main global options for a run
float repForceFactor
repulsive force factor for the main step
double stopCritAvgForce
stopping criteria
float preProcTimeStep
time step factor for the preprocessing step
float normEdgeLength
average edge length when desired edge length are normalized
uint32_t minNumIterations
minimum number of iterations to be done regardless of any other conditions
float preProcEdgeForceFactor
edge force factor for the preprocessing step
bool doPrepProcessing
enable preprocessing
uint32_t multipolePrecision
float timeStep
time step factor for the main step
double stopCritConstSq
stopping criteria
uint32_t preProcMaxNumIterations
number of iterations the preprocessing is applied
bool doPostProcessing
enable postprocessing
float normNodeSize
average node size when node sizes are normalized
uint32_t maxNumIterations
maximum number of iterations in the main step
float edgeForceFactor
edge force factor for the main step
double stopCritForce
stopping criteria
uint32_t numInnerNodes
number of inner nodes the thread prepared
LinearQuadtree::NodeID firstLeaf
first leaves the thread prepared
LinearQuadtree::NodeID lastLeaf
last leaves the thread prepared
float * forceY
local force array for all nodes, points
float * forceX
local force array for all nodes, points
FMETreePartition treePartition
tree partition assigned to the thread
float max_x
global point, node max x coordinate for bounding box calculations
float max_y
global point, node max y coordinate for bounding box calculations
FMENodeChainPartition innerNodePartition
chain of inner nodes assigned to the thread
FMENodeChainPartition leafPartition
chain of leaf nodes assigned to the thread
uint32_t numLeaves
number of leaves the thread prepared
FMEGlobalContext * pGlobalContext
pointer to the global context
LinearQuadtree::NodeID firstInnerNode
first inner nodes the thread prepared
float min_x
global point, node min x coordinate for bounding box calculations
double maxForceSq
local maximum force
LinearQuadtree::NodeID lastInnerNode
last inner nodes the thread prepared
float min_y
global point, node min y coordinate for bounding box calculations
double avgForce
local maximum force
struct for distributing subtrees to the threads
std::list< LinearQuadtree::NodeID > nodes
void for_loop(Func &func)
const LinearQuadtree & tree
void operator()(LinearQuadtree::NodeID nodeIndex)
void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child)
LinearQuadtreeExpansion & expansions
l2l_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
l2p_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e, float *x, float *y)
void operator()(LinearQuadtree::NodeID nodeIndex, LinearQuadtree::PointID pointIndex)
void operator()(LinearQuadtree::PointID pointIndex)
LinearQuadtreeExpansion & expansions
const LinearQuadtree & tree
Multipole-to-Local functor.
LinearQuadtreeExpansion & expansions
m2l_functor(LinearQuadtreeExpansion &e)
void operator()(LinearQuadtree::NodeID nodeIndexSource, LinearQuadtree::NodeID nodeIndexReceiver)
Multipole-to-Multipole functor.
const LinearQuadtree & tree
LinearQuadtreeExpansion & expansions
m2m_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
void operator()(LinearQuadtree::NodeID nodeIndex)
void operator()(LinearQuadtree::NodeID parent, LinearQuadtree::NodeID child)
generic min max functor for an array
Point-to-Multipole functor.
p2m_functor(const LinearQuadtree &t, LinearQuadtreeExpansion &e)
const LinearQuadtree & tree
void operator()(LinearQuadtree::NodeID nodeIndex)
LinearQuadtreeExpansion & expansions
void operator()(LinearQuadtree::NodeID nodeIndexA, LinearQuadtree::NodeID nodeIndexB)
p2p_functor(const LinearQuadtree &t, float *x, float *y)
void operator()(LinearQuadtree::NodeID nodeIndex)
const LinearQuadtree & tree