Represents a mesh vertex (a point). More...
#include <Block.hpp>
Classes | |
| class | Shared_value |
Accesses a double value used for transmitting shared data between elements. More... | |
| struct | Snap_result |
Public Member Functions | |
| Vertex (Mat< 3 > pos, int row_size) | |
Constructs a Vertex and initializes its position. | |
| Vertex (Vertex &&)=default | |
| Vertex & | operator= (Vertex &&)=default |
| void | pair (mutual::Base< Edge, Vertex > &ptr) |
Adds ptr to a Reciprocal_list<Vertex, Edge> with this as its mine. | |
| void | pair (mutual::Base< Element_shape, Vertex > &ptr) |
Adds ptr to a Reciprocal_list<Vertex, Element_shape> with this as its mine. | |
| bool | alive () const |
Returns true iff this has at least one Element_shape pointing to it. | |
| double | nominal_size () const |
| Maximum nominal size of connected elements. | |
| Sequence< Edge & > | edges () |
Access the list of edges that have this as an endpoint. | |
| Sequence< Element_shape & > | elements () |
| bool | glued () const |
| Mat< 3 > | unwarped_point (bool orig=false) const |
| Computes the position of the vertex without any face/edge warping. | |
| void | eat (Vertex &that) |
Combines this vertex with that and steals its resources. | |
| void | glue (Element_shape &to, std::vector< double > coords) |
Glues this vertex to a point on an Element_shape. | |
| void | set_pos (Mat< 3 > p) |
set the point({}) of this to p, if possible | |
| void | remember_pos () |
if this is glued(), sets it to remember its current point({}) after the element it's glued to is destroyed. | |
| void | add_size_constraint (double) |
add a constraint that the nominal_size() of this must be smaller than the supplied value | |
| void | remove_size_constraints () |
removes all size constraints set with add_size_constraint(double) | |
| Mat< 3 > | nominal_position () const |
| bool | mobile () const |
| void | init_improve () |
| void | compute_gradient (std::function< Mat< 3 >(Mat< 3 >)> get_target) |
| void | compute_improve (std::function< Mat< 3 >(Mat< 3 >)> get_target) |
| void | force_continue_improve () |
| bool | check_improve (bool updated_neighbors) |
| void | init_snap (std::function< Mat< 3 >(Mat< 3 >)> get_target) |
| int | last_improve_iters () const |
| void | compute_snap () |
| Snap_result | check_snap (bool updated_neighbors) |
| bool | last_snap_failed () const |
| bool | last_step_rejected () const |
| Mat< 3 > | last_grad () const |
| bool | snap_to (Mat< 3 > target) |
| bool | snap_to (std::function< Mat< 3 >(Mat< 3 >)> target) |
| int | n_elements () const |
| The number of elements sharing this vertex. | |
| bool | is_surface () const |
| std::vector< Vertex * > | neighbors () |
The list of vertices that share an edge with this. | |
| std::vector< const Vertex * > | neighbors () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| int | get_index (const Element_shape &) const |
Public Member Functions inherited from hexed::next::Block | |
| Block (int n_dim, int row_size) | |
| int | n_dim () const |
| number of topological dimensions. | |
| int | row_size () const |
| number nodes along each dimension | |
| Mat< 3 > | point (const std::vector< int > &node_coords, Int recursion_depth=0) const |
Obtains the node with array indices specified by node_coords. | |
| Mat< 3 > | point (int i_point, Int recursion_depth=0) const |
Obtains the node with flat index i_point | |
| virtual Array< double > | points () const |
| Obtains all the nodes as a multidimensional array. | |
| void | visualize (std::string format, std::string file_name, double time=0.) const |
Visualizes the nodes of a single Block. | |
Public Member Functions inherited from hexed::mutual::Multiple< void, void > | |
| Multiple (const Multiple &)=delete | |
| Multiple (Multiple &&that) | |
steals all of that's partners, leaving that unconnected | |
| Multiple & | operator= (const Multiple &)=delete |
| Multiple & | operator= (Multiple &&that) |
steals all of that's partners, leaving that unconnected | |
| next::Sequence< Base< void, void > & > | partners () |
| provides access to the list of partners | |
| next::Sequence< const Base< void, void > & > | partners () const |
| provides access to the list of partners | |
Public Member Functions inherited from hexed::mutual::Base< void, void > | |
| virtual void * | _mine () |
| virtual const void * | _mine () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Static Public Member Functions | |
| static double | objective (Element_shape &elem) |
Static Public Member Functions inherited from hexed::next::Block | |
| static void | visualize (std::string format, std::string file_name, next::Sequence< const Block & >, double time=0.) |
Visualizes the nodes of a set of Blocks. | |
Public Attributes | |
| std::vector< Int > | record |
| current position of this vertex | |
| Mat< 3 > | offset |
| Int | snapped_point |
| Int | snapped_edge |
| Int | snapped_endpoint |
| Mat< 3 > | dijkstra_point |
| nominal location of this vertex used in Dijkstra's algorithm | |
| double | dijkstra_dist |
| the "distance" from the start node to this node in Dijkstra's algorithm | |
| int | dijkstra_updates |
number of times dijkstra_dist has been updated in Dijkstra's algorithm | |
| Vertex * | dijkstra_prev_vert |
| holds the previous node in the shortest path to this node in Dijkstra's algorithm | |
| Edge * | dijkstra_prev_edge |
| holds the previous node in the shortest path to this node in Dijkstra's algorithm | |
| double | dijkstra_curve_dist_sq |
| squared distance from the curve | |
| double | dijkstra_arc_len |
| arc length of the nearest point on the curve | |
| bool | incompatible_snap |
| double | wall_distance |
Additional Inherited Members | |
Static Public Attributes inherited from hexed::next::Block | |
| static constexpr Int | max_recursion_depth = 100 |
Protected Member Functions inherited from hexed::mutual::Base< void, void > | |
| void | _connect (Base< void, void > &that) |
may be overridden by derived classes to provide partners to data of some arbitrary type T | |
| void | _disconnect (Base< void, void > &that) |
mutually disconnects this and that by calling both of their _unset() member functions | |
Static Protected Member Functions inherited from hexed::mutual::Base< void, void > | |
| static void * | _yours (Base< void, void > &that) |
Accesses the _mine() of that | |
| static const void * | _yours (const Base< void, void > &that) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Protected Attributes inherited from hexed::mutual::Base< void, void > | |
| Lock | _lock |
Represents a mesh vertex (a point).
A Vertex has n_dim() 0. The row_size() is arbitrary, but may as well be set to the same as other mesh Blocks for consistency. Thus its position should be obtained as point({}).
| void hexed::next::Vertex::add_size_constraint | ( | double | sz | ) |
add a constraint that the nominal_size() of this must be smaller than the supplied value
inherited by vertices that eat() this.
| void hexed::next::Vertex::eat | ( | Vertex & | that | ) |
Combines this vertex with that and steals its resources.
All Edges and Element_shapes that currently have pointers to that will be redirected to point to this. The position of this will be set to the average of this and that's positions, weighted by the numbers of elements pointing to each of them before eating. that will no longer be alive, as it no longer has any element pointers. The fact that "eat" seemed like the natural word for this may be a sign that I've read too much SnK...
Both vertices must be alive() before calling eat(), or else an exception is thrown. Autocannibalism is allowed and simply does nothing (as long as the vertex is alive()).
| void hexed::next::Vertex::glue | ( | Element_shape & | to, |
| std::vector< double > | coords ) |
Glues this vertex to a point on an Element_shape.
Calls to Block::point will now return the position of to at the reference coordinates coords, making pos irrelevant. pos can still be modified, but it will have no effect on Block::point. If to is destroyed, pos will be set to the current instantaneous value of point({}), and then this will no longer be glued. Thus subsequent calls to point({}) will once again return pos.
| std::vector< Vertex * > hexed::next::Vertex::neighbors | ( | ) |
The list of vertices that share an edge with this.
By "share an edge" I mean that they are connected by a geometric edge of an element, not necessarily and actual Edge object. The latter would only ever be true for boundary vertices, whereas the former can be true in the interior.
|
inline |
Adds ptr to a Reciprocal_list<Vertex, Element_shape> with this as its mine.
If this was not previously alive(), it will be now.
| std::vector<Int> hexed::next::Vertex::record |
current position of this vertex
Block::point will return this value, unless the vertes is currently glue()d. for algorithms to keep notes as they please