Plugins
mesh_object.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014: G-CSC, Goethe University Frankfurt
3  * Author: Sebastian Reiter
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__mesh_object__
34 #define __H__UG__mesh_object__
35 
36 #include "lib_grid/grid/grid.h"
38 #include "lib_grid/selector.h"
41 
42 namespace ug{
43 namespace promesh{
44 
45 
47 {
48  public:
51 
53  typedef Grid::FaceAttachmentAccessor<normal_attachment_t> normal_accessor_t;
54 
57 
59  {
63  m_aaNorm.access(m_grid, aNormal);
70  m_pivot = vector3(0, 0, 0);
71  }
72 
73  virtual ~MeshObject() {}
74 
75  Grid& get_grid() {return m_grid;}
79 
80  Grid& grid() {return m_grid;}
84 
85  // pivot
86  void set_pivot(const vector3& pivot) {m_pivot = pivot;}
87  const vector3& get_pivot() const {return m_pivot;}
88 
89  vector3& pivot() {return m_pivot;}
90  const vector3& pivot() const {return m_pivot;}
91 
95 
99 
102  {
104  return m_aaVolumeConstraint;
105  }
106 
109  {
111  return m_aVolumeConstraint;
112  }
113 
116  {
120  }
121  }
122 
123  protected:
125  {
129  }
130  }
131 
132  protected:
142 
143 };
144 
145 
146 }}// end of namespace
147 
148 #endif
bool access(Grid &grid, TAttachment &a)
void attach_to_vertices(IAttachment &attachment)
void detach_from_volumes(IAttachment &attachment)
void attach_to_faces(IAttachment &attachment)
void attach_to_volumes(IAttachment &attachment)
void assign_grid(Grid &grid)
void enable_strict_inheritance(bool bEnable)
SubsetInfo & subset_info(int subsetIndex)
void assign_grid(Grid &grid)
Definition: mesh_object.h:47
position_accessor_t m_aaPos
Definition: mesh_object.h:137
SubsetHandler m_subsetHandler
Definition: mesh_object.h:134
vector3 & pivot()
Definition: mesh_object.h:89
volume_constraint_accessor_t & volume_constraint_accessor()
returns accessor to volume constraints.
Definition: mesh_object.h:101
ANumber volume_constraint_attachment_t
Definition: mesh_object.h:55
normal_attachment_t & normal_attachment()
Definition: mesh_object.h:98
Grid::FaceAttachmentAccessor< normal_attachment_t > normal_accessor_t
Definition: mesh_object.h:53
Grid & get_grid()
Definition: mesh_object.h:75
Grid::VolumeAttachmentAccessor< volume_constraint_attachment_t > volume_constraint_accessor_t
Definition: mesh_object.h:56
Selector & selector()
Definition: mesh_object.h:83
SubsetHandler & crease_handler()
Definition: mesh_object.h:82
vector3 m_pivot
Definition: mesh_object.h:139
const vector3 & get_pivot() const
Definition: mesh_object.h:87
position_accessor_t & position_accessor()
returns accessor to vertex positions
Definition: mesh_object.h:93
volume_constraint_attachment_t & volume_constraint_attachment()
returns the volume constraint attachment
Definition: mesh_object.h:108
Selector m_selector
Definition: mesh_object.h:136
void volume_constraints_required()
Definition: mesh_object.h:124
Grid & grid()
Definition: mesh_object.h:80
virtual ~MeshObject()
Definition: mesh_object.h:73
ANormal normal_attachment_t
Definition: mesh_object.h:52
SubsetHandler & get_subset_handler()
Definition: mesh_object.h:76
SubsetHandler & get_crease_handler()
Definition: mesh_object.h:77
void set_pivot(const vector3 &pivot)
Definition: mesh_object.h:86
Selector & get_selector()
Definition: mesh_object.h:78
position_attachment_t & position_attachment()
Definition: mesh_object.h:94
SubsetHandler & subset_handler()
Definition: mesh_object.h:81
void clear_volume_constraints()
clears the volume constraints (removes the attachment)
Definition: mesh_object.h:115
Grid::VertexAttachmentAccessor< position_attachment_t > position_accessor_t
Definition: mesh_object.h:50
volume_constraint_attachment_t m_aVolumeConstraint
Definition: mesh_object.h:140
normal_accessor_t & normal_accessor()
returns accessor to face normals
Definition: mesh_object.h:97
Grid m_grid
Definition: mesh_object.h:133
SubsetHandler m_creaseHandler
Definition: mesh_object.h:135
volume_constraint_accessor_t m_aaVolumeConstraint
Definition: mesh_object.h:141
MeshObject()
Definition: mesh_object.h:58
APosition position_attachment_t
Definition: mesh_object.h:49
const vector3 & pivot() const
Definition: mesh_object.h:90
normal_accessor_t m_aaNorm
Definition: mesh_object.h:138
REM_FIXED
REM_CREASE
SHE_EDGE
SHE_VERTEX
MathVector< 3, number > vector3
ANormal aNormal("normal", true)
APosition aPosition("position", true)
std::string name