18 #ifndef FIELD_FE_IMPL_HH_ 19 #define FIELD_FE_IMPL_HH_ 37 template <
int spacedim,
class Value>
39 Input::register_class< FieldFE<spacedim, Value>,
unsigned int >(
"FieldFE");
43 template <
int spacedim,
class Value>
56 template <
int spacedim,
class Value>
70 unsigned int ndofs = max(
dh_->
fe<1>()->n_dofs(), max(
dh_->
fe<2>()->n_dofs(),
dh_->
fe<3>()->n_dofs()));
79 template <
int spacedim,
class Value>
87 arma::mat::fixed<1,3> im1 = pinv(m1);
97 if (
dh_->
fe<1>()->is_scalar()) {
99 for (
unsigned int i=0; i<
dh_->
fe<1>()->n_dofs(); i++)
106 for (
unsigned int i=0; i<
dh_->
fe<1>()->n_dofs(); i++)
108 for (
unsigned int i=0; i<3; i++)
112 else if (elm.
dim() == 2) {
113 arma::mat::fixed<3,2> m2;
116 arma::mat::fixed<2,3> im2 = pinv(m2);
126 if (
dh_->
fe<2>()->is_scalar()) {
128 for (
unsigned int i=0; i<
dh_->
fe<2>()->n_dofs(); i++)
135 for (
unsigned int i=0; i<
dh_->
fe<2>()->n_dofs(); i++)
137 for (
unsigned int i=0; i<3; i++)
155 if (
dh_->
fe<3>()->is_scalar()) {
157 for (
unsigned int i=0; i<
dh_->
fe<3>()->n_dofs(); i++)
164 for (
unsigned int i=0; i<
dh_->
fe<3>()->n_dofs(); i++)
166 for (
unsigned int i=0; i<3; i++)
179 template <
int spacedim,
class Value>
187 if (elm.
dim() == 1) {
189 arma::mat::fixed<1,3> im1 = pinv(m1);
193 for (
unsigned int k=0; k<point_list.size(); k++) {
201 Value envelope(value_list[k]);
203 if (
dh_->
fe<1>()->is_scalar()) {
205 for (
unsigned int i=0; i<
dh_->
fe<1>()->n_dofs(); i++)
207 envelope(0,0) =
value;
212 for (
unsigned int i=0; i<
dh_->
fe<1>()->n_dofs(); i++)
214 for (
int i=0; i<3; i++)
215 envelope(i,0) =
value(i);
219 else if (elm.
dim() == 2) {
220 arma::mat::fixed<3,2> m2;
223 arma::mat::fixed<2,3> im2 = pinv(m2);
227 for (
unsigned int k=0; k<point_list.size(); k++) {
235 Value envelope(value_list[k]);
237 if (
dh_->
fe<2>()->is_scalar()) {
239 for (
unsigned int i=0; i<
dh_->
fe<2>()->n_dofs(); i++)
241 envelope(0,0) =
value;
246 for (
unsigned int i=0; i<
dh_->
fe<2>()->n_dofs(); i++)
248 for (
int i=0; i<3; i++)
249 envelope(i,0) =
value(i);
262 for (
unsigned int k=0; k<point_list.size(); k++) {
270 Value envelope(value_list[k]);
272 if (
dh_->
fe<3>()->is_scalar()) {
274 for (
unsigned int i=0; i<
dh_->
fe<3>()->n_dofs(); i++)
276 envelope(0,0) =
value;
281 for (
unsigned int i=0; i<
dh_->
fe<3>()->n_dofs(); i++)
283 for (
int i=0; i<3; i++)
284 envelope(i,0) =
value(i);
292 template <
int spacedim,
class Value>
const Element * element() const
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
Class FEValues calculates finite element data on the actual cells such as shape function values...
Value::return_type r_value_
FiniteElement< dim, 3 > * fe() const
Returns finite element object for given space dimension.
unsigned int * dof_indices
void set_fe_data(const DOFHandlerMultiDim *dh, Mapping< 1, 3 > *map1, Mapping< 2, 3 > *map2, Mapping< 3, 3 > *map3, const Vec *data)
Provides the numbering of the finite element degrees of freedom on the computational mesh...
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
void get_loc_dof_indices(const CellIterator &cell, unsigned int indices[]) const override
Returns the indices of dofs associated to the cell on the local process.
Basic definitions of numerical quadrature rules.
Space< spacedim >::Point Point
arma::vec::fixed< spacedim > shape_vector(const unsigned int function_no, const unsigned int point_no)
Return the value of the function_no-th shape function at the point_no-th quadrature point...
double shape_value(const unsigned int function_no, const unsigned int point_no)
Return the value of the function_no-th shape function at the point_no-th quadrature point...
Value value_
Last value, prevents passing large values (vectors) by value.
void set_point(const unsigned int i, const arma::vec::fixed< dim > &p)
Sets individual quadrature point coordinates.
FieldFE(unsigned int n_comp=0)
void reinit(ElementFullIter &cell)
Update cell-dependent data (gradients, Jacobians etc.)
Calculates finite element data on the actual cell.
const DOFHandlerMultiDim * dh_
#define OLD_ASSERT_EQUAL(a, b)
Abstract class for description of finite elements.
ElementVector element
Vector of elements of the mesh.