52template <
typename TGr
idFunc>
60 std::vector<DoFIndex> ind (1);
71 sp_top_z->init (m_rt_gl, m_localTopFacesOnly);
76 iter != spLSF->template end<Vertex> (); ++iter)
82 typename raster_t::Coordinate rc;
83 for (
int i = 0; i < dim - 1; ++i)
85 number raster_val = m_raster.interpolate(rc, 1);
88 if (sp_top_z.
valid ())
91 if (sp_top_z->get_min_at (coord, m_rt_tol, top_z))
93 else if (m_bDefaultTop)
94 raster_val += m_rt_default;
96 UG_THROW (
"LSFbyRaster: Point " << coord <<
" is not covered by the top subset.");
100 spLSF->inner_dof_indices (vrt, 0, ind);
101 DoFRef (*spLSF, ind[0]) = coord [dim - 1] - raster_val;
113template <
typename TGr
idFunc>
119 init(grid_level,
false);
122template <
typename TGr
idFunc>
126 bool localTopSidesOnly
130 localTopSidesOnly =
true;
137 std::vector<side_t*> topSides;
140 if(localTopSidesOnly){
141 m_top_tracer_tree.
set_grid(*m_sp_domain->grid (), m_sp_domain->position_attachment ());
142 for (
size_t i = 0; i < m_top_ss_grp.size (); i++)
144 int si = m_top_ss_grp [i];
146 if (grid_level >= 0){
147 for (SideIterator it = sh.
begin<
side_t> (si, grid_level);
148 it != sh.
end<
side_t> (si, grid_level); ++it)
149 topSides.push_back (*it);
152 for (
int lvl = 0; lvl < (int) sh.
num_levels(); lvl++){
158 topSides.push_back (t);
166 m_top_tracer_tree.set_grid(m_top_grid, m_sp_domain->position_attachment ());
172 for (
size_t i = 0; i < m_top_ss_grp.size (); i++)
174 int si = m_top_ss_grp [i];
177 for (SideIterator it = sh.
begin<
side_t> (si, grid_level);
178 it != sh.
end<
side_t> (si, grid_level); ++it)
181 for (
int lvl = 0; lvl < (int) sh.
num_levels(); lvl++)
202 for (SideIterator it = m_top_grid.begin<
side_t> (); it != m_top_grid.end<
side_t> (); ++it)
203 topSides.push_back (*it);
212 m_top_tracer_tree.create_tree (topSides.begin (), topSides.end ());
218template <
typename TGr
idFunc>
229 up_dir [
dim - 1] = 1;
230 m_top_intersection_records.clear ();
237 if (m_top_intersection_records.size () == 0)
244 for (
size_t i = 1; i < m_top_intersection_records.size (); i++)
248 if (x [
dim - 1] < z_min)
bool is_ghost(TElem *elem) const
void add(SPVertexDataSerializer cb)
DistributedGridManager * distributed_grid_manager()
void select(GridObject *elem, byte status)
void set_grid(Grid *grid)
an auxiliary class for the computation of the relative height
Definition ls_init.h:192
void init(int grid_level)
initializer: creates the tree
Definition ls_init_impl.h:115
bool get_min_at(const MathVector< dim > &over, number tolerance, number &z)
computes the minimum z-coordiate of the top (returns true if the top found, false otherwise)
Definition ls_init_impl.h:220
domain_type::position_accessor_type position_accessor_type
type of the position accessor
Definition ls_init.h:81
static const int dim
world dimension
Definition ls_init.h:84
void interpolate_to(SmartPtr< TGridFunc > spLSF)
computes the level-set function
Definition ls_init_impl.h:54
TGridFunc::template traits< Vertex >::const_iterator VertexConstIterator
vertex base iterator
Definition ls_init.h:87
grid_dim_traits< dim-1 >::element_type side_t
side type
Definition ls_init.h:93
bool has_children(TElem *elem) const
geometry_traits< TElem >::iterator end(int subsetIndex, int level)
geometry_traits< TElem >::iterator begin(int subsetIndex, int level)
vector_t PointOnRay(const vector_t &from, const vector_t &dir, number s)
bool RayElementIntersections(std::vector< RayElemIntersectionRecord< typename tree_t::elem_t > > &intersectionsOut, const tree_t &tree, const typename tree_t::vector_t &rayFrom, const typename tree_t::vector_t &rayDir, const number small=1.e-12)
const number & DoFRef(const TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
void AllGatherGrid(Grid &gridOut, Selector &sel, GridDataSerializationHandler &serializer, GridDataSerializationHandler &deserializer, const pcl::ProcessCommunicator &procCom=pcl::ProcessCommunicator())
geometry_traits< TElem >::iterator iterator