18 #ifndef __GENERIC_DOF_MAP_H 19 #define __GENERIC_DOF_MAP_H 25 #include <unordered_map> 26 #include <unordered_set> 27 #include <Eigen/Dense> 29 #include <dolfin/common/types.h> 30 #include <dolfin/common/Variable.h> 31 #include <dolfin/la/IndexMap.h> 32 #include <dolfin/log/log.h> 58 virtual bool is_view()
const = 0;
62 virtual std::size_t global_dimension()
const = 0;
69 return num_element_dofs(index);
77 return max_element_dofs();
82 virtual std::size_t num_element_dofs(std::size_t index)
const = 0;
86 virtual std::size_t max_element_dofs()
const = 0;
89 virtual std::size_t num_entity_dofs(std::size_t entity_dim)
const = 0;
92 virtual std::size_t num_entity_closure_dofs(std::size_t entity_dim)
const = 0;
95 virtual std::size_t num_facet_dofs()
const = 0;
99 virtual std::pair<std::size_t, std::size_t> ownership_range()
const = 0;
103 virtual const std::vector<int>& off_process_owner()
const = 0;
106 virtual Eigen::Map<const Eigen::Array<dolfin::la_index, Eigen::Dynamic, 1>>
107 cell_dofs(std::size_t cell_index)
const = 0;
110 virtual std::vector<dolfin::la_index>
111 entity_dofs(
const Mesh& mesh, std::size_t entity_dim,
112 const std::vector<std::size_t> & entity_indices)
const = 0;
115 virtual std::vector<dolfin::la_index>
116 entity_dofs(
const Mesh& mesh, std::size_t entity_dim)
const = 0;
120 virtual std::vector<dolfin::la_index>
121 entity_closure_dofs(
const Mesh& mesh, std::size_t entity_dim,
122 const std::vector<std::size_t> & entity_indices)
const = 0;
126 virtual std::vector<dolfin::la_index>
127 entity_closure_dofs(
const Mesh& mesh, std::size_t entity_dim)
const = 0;
130 virtual void tabulate_facet_dofs(std::vector<std::size_t>& element_dofs,
131 std::size_t cell_facet_index)
const = 0;
135 virtual void tabulate_entity_dofs(std::vector<std::size_t>& element_dofs,
136 std::size_t entity_dim,
137 std::size_t cell_entity_index)
const = 0;
141 virtual void tabulate_entity_closure_dofs(std::vector<std::size_t>& element_dofs,
142 std::size_t entity_dim,
143 std::size_t cell_entity_index)
const = 0;
146 virtual void tabulate_global_dofs(std::vector<std::size_t>& dofs)
const = 0;
149 virtual std::shared_ptr<GenericDofMap> copy()
const = 0;
152 virtual std::shared_ptr<GenericDofMap>
153 create(
const Mesh& new_mesh)
const = 0;
156 virtual std::shared_ptr<GenericDofMap>
157 extract_sub_dofmap(
const std::vector<std::size_t>& component,
158 const Mesh& mesh)
const = 0;
161 virtual std::shared_ptr<GenericDofMap>
162 collapse(std::unordered_map<std::size_t, std::size_t>& collapsed_map,
163 const Mesh& mesh)
const = 0;
167 virtual std::vector<dolfin::la_index> dofs(
const Mesh& mesh,
168 std::size_t dim)
const = 0;
171 virtual std::vector<dolfin::la_index> dofs()
const = 0;
181 virtual const std::vector<std::size_t>& local_to_global_unowned()
const = 0;
184 virtual std::shared_ptr<const IndexMap> index_map()
const = 0;
187 virtual void tabulate_local_to_global_dofs(std::vector<std::size_t>& local_to_global_map)
const = 0;
190 virtual std::size_t local_to_global_index(
int local_index)
const = 0;
194 virtual const std::unordered_map<int, std::vector<int>>&
195 shared_nodes()
const = 0;
198 virtual const std::set<int>& neighbours()
const = 0;
202 virtual void clear_sub_map_data() = 0;
205 virtual std::string str(
bool verbose)
const = 0;
208 virtual int block_size()
const = 0;
Common base class for DOLFIN variables.
Definition: Variable.h:35
GenericDofMap()
Constructor.
Definition: GenericDofMap.h:54
This class provides a generic interface for dof maps.
Definition: GenericDofMap.h:49
Definition: Extrapolation.h:34
std::size_t max_cell_dimension() const
Definition: GenericDofMap.h:74
std::shared_ptr< const SubDomain > constrained_domain
Definition: GenericDofMap.h:212
std::size_t cell_dimension(std::size_t index) const
Definition: GenericDofMap.h:66
This class defines a common interface for vectors.
Definition: GenericVector.h:47