27 #ifndef MESQUITE_PATCHDATA_HPP
28 #define MESQUITE_PATCHDATA_HPP
53 #ifndef MSQ_USE_OLD_C_HEADERS
61 #ifdef MSQ_USE_OLD_STD_HEADERS
69 #ifdef MSQ_USE_OLD_IO_HEADERS
78 class PatchDataVerticesMemento;
147 size_t element_count,
148 size_t vertex_use_count,
228 msq_std::vector<Vector3D> &coords,
232 msq_std::vector<size_t> &vertex_indices,
236 msq_std::vector<size_t> &elem_indices,
241 size_t& array_len_out,
248 msq_std::vector<size_t> &vert_indices,
259 msq_std::vector<size_t> &adj_ents,
374 bool include_higher_order =
false );
380 bool include_higher_order =
false );
616 bool include_higher_order)
642 bool include_higher_order)
648 || num_verts < memento->arraySize/10)
674 MSQ_SETERR(err)(
"Memento may only be used to restore the PatchData "
675 "object from which it was created.",
683 MSQ_SETERR(err)(
"Unable to restore patch coordinates. Number of "
684 "vertices in PatchData has changed.",
void update_mesh(MsqError &err)
Updates the underlying mesh (the Mesquite::Mesh implementation) with new node coordinates and flag va...
void set_free_vertices_soft_fixed(MsqError &err)
Add a soft_fixed flag to all free vertices in the patch.
PatchDataVerticesMemento()
double get_max_vertex_movement_squared(PatchDataVerticesMemento *memento, MsqError &err)
Calculates the distance each vertex has moved from its original position as defined by the PatchDataV...
~PatchDataVerticesMemento()
PatchDataMem< MsqVertex > vertexArray
void set_all_vertices_soft_free(MsqError &err)
Remove the soft_fixed flag from all vertices in the patch.
MsqVertex & vertex_by_index(size_t index)
Returns the start of the vertex->element array.
CornerTag< TargetMatrix > targetMatrices
Target matrix data.
Used to hold the error state and return it to the application.
void get_domain_normals_at_corners(size_t element_index, Vector3D normals_out[], MsqError &err)
Get surface normal at a point where the surface is the domain of an element and the point is the loca...
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
void recreate_vertices_memento(PatchDataVerticesMemento *memento, MsqError &err, bool include_higher_order=false)
reinstantiates a memento to holds the current state of the PatchData coordinates. ...
DomainHint
A hint on the characteristics of the domain that Mesquite may use to determine what, if any, scheme to use to cache characteristics of the geometric domain.
void allocate_storage(size_t vertex_count, size_t element_count, size_t vertex_use_count, MsqError &err)
Used by test code when creating a PatchData directly.
size_t * get_connectivity_array()
void get_vertex_element_indices(size_t vertex_index, msq_std::vector< size_t > &elem_indices, MsqError &err)
const Mesh::ElementHandle * get_element_handles_array() const
EntityHandle ElementHandle
MsqMeshEntity is the Mesquite object that stores information about the elements in the mesh...
This file contains the Mesquite mesh interface. Many users will want to implement a concrete class de...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
void note_have_info(ComputedInfo info)
PatchDataMem< size_t > elemConnectivityArray
void set_to_vertices_memento(PatchDataVerticesMemento *memento, MsqError &err)
Restore the PatchData coordinates to the state contained in the memento.
int num_free_vertices(MsqError &err) const
Returns the number of elements in the current patch who are free to move.
double computedInfos[MAX_COMPUTED_INFO_ENUM]
void initialize_data(size_t *elem_offset_array, MsqError &err)
Call after filling vertex handle and connectivity arrays to finish initializing the PatchData...
PatchDataVerticesMemento * create_vertices_memento(MsqError &err, bool include_higher_order=false)
Creates a memento that holds the current state of the PatchData coordinates.
void get_minmax_element_unsigned_area(double &min, double &max, MsqError &err)
Returns the maximum volume or area out of all the elements in the patch This information is stored in...
void generate_vertex_to_element_data()
average corner determinant out of all elements in the patch
void get_adjacent_entities_via_n_dim(int n, size_t ent_ind, msq_std::vector< size_t > &adj_ents, MsqError &err)
Get the indices of entities attached to entity (given by ent_ind). adj_ents is filled with the indice...
void get_domain_normal_at_element(size_t elem_index, Vector3D &surf_norm, MsqError &err) const
PatchData & operator=(const PatchData &pd)
Doesn't allow a PatchData object to be assigned to another.
invalid function argument passed
size_t num_elements() const
number of elements in the Patch.
void clear()
Removes data.
void get_subpatch(size_t center_vertex_index, PatchData &pd_to_fill, MsqError &err)
Fills a PatchData with the elements attached to a center vertex.
double get_barrier_delta(MsqError &err)
Returns delta based on the minimum and maximum corner determinant over all elements in the patch This...
void set_vertex_coordinates(const Vector3D &coords, size_t index, MsqError &err)
set the coordinates of a vertex in the raw array
size_t get_element_index(MsqMeshEntity *element)
bool have_computed_info(ComputedInfo info) const
size_t get_vertex_index(MsqVertex *vertex)
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
minimum and maximum corner area out of all elements in the patch
void snap_vertex_to_domain(size_t vertex_index, MsqError &err)
Adjust the position of the specified vertex so that it lies on its constraining domain.
void get_element_vertex_indices(size_t elem_index, msq_std::vector< size_t > &vertex_indices, MsqError &err)
void get_adjacent_vertex_indices(size_t vertex_index, msq_std::vector< size_t > &vert_indices, MsqError &err)
void update_cached_normals(MsqError &)
void clear_computed_info()
This function clears the patch information such as maximum volume, etc ...
PatchType
Tells MeshSet how to retrieve the mesh entities that will be stored in PatchData. ...
size_t num_nodes() const
Get number of nodes (vertex + higher-order nodes)
PatchDataMem< Vector3D > vertexNormals
double get_average_Lambda_3d(MsqError &err)
Returns average corner determinant over all corners in the patch This information is stored in the pa...
maximum edge length in the patch
size_t num_vertices() const
number of vertices in the patch.
MsqMeshEntity & element_by_index(size_t index)
PatchDataMem< size_t > vertAdjacencyOffsets
size_t num_corners()
number of elements corners in the Patch.
A class for caching and managing Tags on element corners.
PatchDataMem< MsqMeshEntity > elementArray
void move_free_vertices_constrained(Vector3D dk[], size_t nb_vtx, double step_size, MsqError &err)
Moves free vertices and then snaps the free vertices to the domain.
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
unsigned haveComputedInfos
const MsqVertex * get_vertex_array(MsqError &err) const
Returns a pointer to the start of the vertex array.
void get_domain_normal_at_element(MsqMeshEntity *elem_ptr, Vector3D &surf_norm, MsqError &err) const
Alternative signature. Same functionality.
void set_free_vertices_constrained(PatchDataVerticesMemento *memento, Vector3D dk[], size_t nb_vtx, double step_size, MsqError &err)
void get_domain_normal_at_vertex(size_t vertex_index, bool normalize, Vector3D &surf_norm, MsqError &err)
friend msq_stdio::ostream & operator<<(msq_stdio::ostream &, const PatchData &)
Display the coordinates and connectivity information.
object is in an invalid state
MeshSet * get_mesh_set()
Returns the originating meshSet.
void reorder()
Reorders the mesh data.
PatchDataMem< Mesh::ElementHandle > elementHandlesArray
Contains a copy of the coordinates of a PatchData.
PatchDataMem< Mesh::VertexHandle > vertexHandlesArray
const MsqMeshEntity * get_element_array(MsqError &err) const
Returns a pointer to the start of the element array.
minimum and maximum corner volume out of all elements in the patch
minimum volume or area out of all elements in the patch
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
PatchData * originator
PatchData whose state is kept.
size_t * get_vertex_element_adjacencies(size_t vertex_index, size_t &array_len_out, MsqError &err)
maximum volume or area out of all elements in the patch
void set_all_vertices_soft_fixed(MsqError &err)
Add a soft_fixed flag to all vertices in the patch.
PatchDataMem< size_t > vertAdjacencyArray
MsqVertex * vertices
array of vertices
void set_mesh_set(MeshSet *ms)
Sets the originating meshSet.
void info()
Print informations about CImg environement variables.
minimum edge length in the patch
The MeshSet class stores one or more Mesquite::Mesh pointers and manages access to the mesh informati...
void get_element_vertex_coordinates(size_t elem_index, msq_std::vector< Vector3D > &coords, MsqError &err)
Get the coordinates of vertices attached to the specified element.
unsigned num_free_nodes(MsqError &err) const