Loading...
Searching...
No Matches
PlazaRefinementND.h
// Copyright (C) 2014 Chris Richardson
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef __PLAZA_REFINEMENT_ND_H
#define __PLAZA_REFINEMENT_ND_H
namespace dolfin
{
class Mesh;
class MeshRelation;
class ParallelRefinement;
class PlazaRefinementND
{
public:
static void refine(Mesh& new_mesh, const Mesh& mesh, bool redistribute,
bool calculate_parent_facets);
static void refine(Mesh& new_mesh, const Mesh& mesh,
const MeshFunction<bool>& refinement_marker,
bool redistribute,
bool calculate_parent_facets);
static void refine(Mesh& new_mesh, const Mesh& mesh,
const MeshFunction<bool>& refinement_marker,
bool calculate_parent_facets,
MeshRelation& mesh_relation);
static void get_simplices
(std::vector<std::size_t>& simplex_set,
const std::vector<bool>& marked_edges,
const std::vector<std::size_t>& longest_edge,
std::size_t tdim, bool uniform);
private:
// Get the longest edge of each face (using local mesh index)
static void face_long_edge(std::vector<unsigned int>& long_edge,
std::vector<bool>& edge_ratio_ok,
const Mesh& mesh);
// 2D version of subdivision allowing for uniform subdivision (flag)
static void get_triangles
(std::vector<std::size_t>& tri_set,
const std::vector<bool>& marked_edges,
const std::size_t longest_edge,
bool uniform);
// 3D version of subdivision
static void get_tetrahedra
(std::vector<std::size_t>& tet_set,
const std::vector<bool>& marked_edges,
const std::vector<std::size_t>& longest_edge);
// Convenient interface for both uniform and marker refinement
static void do_refine(Mesh& new_mesh, const Mesh& mesh,
ParallelRefinement& p_ref,
const std::vector<unsigned int>& long_edge,
const std::vector<bool>& edge_ratio_ok,
bool redistribute,
bool calculate_parent_facets,
MeshRelation& mesh_relation);
// Propagate edge markers according to rules (longest edge
// of each face must be marked, if any edge of face is marked)
static void enforce_rules(ParallelRefinement& p_ref,
const Mesh& mesh,
const std::vector<unsigned int>& long_edge);
// Add parent facet markers to new mesh, based on new vertices
// Only works in 2D at present
static void set_parent_facet_markers(const Mesh& mesh, Mesh& new_mesh,
const std::map<std::size_t, std::size_t>& new_vertex_map);
};
}
#endif
dolfin::MeshFunction
Definition MeshFunction.h:58
dolfin::MeshRelation
Definition MeshRelation.h:35
dolfin::Mesh
Definition Mesh.h:84
dolfin::ParallelRefinement
Data structure and methods for refining meshes in parallel.
Definition ParallelRefinement.h:43
dolfin::PlazaRefinementND
Definition PlazaRefinementND.h:34
dolfin::PlazaRefinementND::refine
static void refine(Mesh &new_mesh, const Mesh &mesh, bool redistribute, bool calculate_parent_facets)
Definition PlazaRefinementND.cpp:311
dolfin::PlazaRefinementND::get_simplices
static void get_simplices(std::vector< std::size_t > &simplex_set, const std::vector< bool > &marked_edges, const std::vector< std::size_t > &longest_edge, std::size_t tdim, bool uniform)
Definition PlazaRefinementND.cpp:43
dolfin
Definition adapt.h:30