36 template<
int rank,
int elemdim,
int spacedim,
class Value>
40 inline static typename Value::return_type
fe_value(
FEValues<elemdim,3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
42 ASSERT(
false).error(
"Unsupported format of FieldFE!\n");
43 typename Value::return_type ret;
52 template<
int elemdim,
int spacedim,
class Value>
55 inline static typename Value::return_type
fe_value(
FEValues<elemdim,3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
63 template<
int elemdim,
int spacedim,
class Value>
66 inline static typename Value::return_type
fe_value(
FEValues<elemdim,3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
68 return fe_val.
vector_view(comp_index).value(i_dof, i_qp);
74 template<
int elemdim,
int spacedim,
class Value>
77 inline static typename Value::return_type
fe_value(
FEValues<elemdim,3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
79 return fe_val.
tensor_view(comp_index).value(i_dof, i_qp);
85 template <
int elemdim,
int spacedim,
class Value>
92 template <
int elemdim,
int spacedim,
class Value>
96 WarningOut() <<
"Multiple initialization of FEValueHandler!";
109 template <
int elemdim,
int spacedim,
class Value>
inline 113 point_list.push_back(p);
122 template <
int elemdim,
int spacedim,
class Value>
127 ASSERT_EQ( point_list.size(), value_list.size() ).error();
134 for (
unsigned int k=0; k<point_list.size(); k++) {
141 Value envelope(value_list[k]);
143 for (
unsigned int i=0; i<
dh_->fe<elemdim>(cell)->n_dofs(); i++) {
151 template <
int elemdim,
int spacedim,
class Value>
155 static const double weight_coefs[] = { 1., 1., 2., 6. };
160 for(
unsigned i=0; i<qgauss.
size(); ++i) {
161 q_weights[i] = qgauss.
weight(i)*weight_coefs[elemdim];
165 return qgauss.
size();
169 template <
int elemdim,
int spacedim,
class Value>
172 unsigned int ndofs = this->
value_.n_rows() * this->
value_.n_cols();
173 for (
unsigned int k=0; k<ndofs; k++) {
174 indices[k] = (*boundary_dofs_)[ndofs*cell.
idx()+k];
180 template <
int spacedim,
class Value>
184 WarningOut() <<
"Multiple initialization of FEValueHandler!";
193 template <
int spacedim,
class Value>
197 ASSERT_EQ( point_list.size(), value_list.size() ).error();
203 for (
unsigned int k=0; k<point_list.size(); k++) {
204 Value envelope(value_list[k]);
206 for (
unsigned int i=0; i<
dh_->fe<0>(cell)->n_dofs(); i++) {
213 template <
int spacedim,
class Value>
216 unsigned int ndofs = this->
value_.n_rows() * this->
value_.n_cols();
217 for (
unsigned int k=0; k<ndofs; k++) {
218 indices[k] = (*boundary_dofs_)[ndofs*cell.
idx()+k];
224 template <
int elemdim,
int spacedim,
class Value>
230 #define INSTANCE_VALUE_HANDLER_ALL(dim, spacedim) \ 231 template class FEValueHandler<dim, spacedim, FieldValue<0>::Enum >; \ 232 template class FEValueHandler<dim, spacedim, FieldValue<0>::Integer >; \ 233 template class FEValueHandler<dim, spacedim, FieldValue<0>::Scalar >; \ 234 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::VectorFixed >; \ 235 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::TensorFixed >; \ 236 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Enum >; \ 237 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Integer >; \ 238 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Scalar >; \ 239 template class FEShapeHandler<1, dim, spacedim, FieldValue<spacedim>::VectorFixed >; \ 240 template class FEShapeHandler<2, dim, spacedim, FieldValue<spacedim>::TensorFixed >; 242 #define INSTANCE_VALUE_HANDLER(dim) \ 243 INSTANCE_VALUE_HANDLER_ALL(dim,3) unsigned int comp_index
index of component (of vector_value/tensor_value)
Class MappingP1 implements the affine transformation of the unit cell onto the actual cell...
unsigned int comp_index_
Index of component (of vector_value/tensor_value)
RealPoint project_unit_to_real(const BaryPoint &point, const ElementMap &map) const
void initialize(FEValueInitData init_data)
Initialize data members.
BaryPoint project_real_to_unit(const RealPoint &point, const ElementMap &map) const
VectorMPI * data_vec
Store data of Field.
VectorMPI * data_vec_
Store data of Field.
Space< spacedim >::Point Point
unsigned int mesh_idx() const
Return global idx of element in full element vector.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
Class FEValues calculates finite element data on the actual cells such as shape function values...
const FEValuesViews::Tensor< dim, spacedim > & tensor_view(unsigned int i) const
Accessor to tensor values of multicomponent FE.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Returns one value in one given point.
Base class for quadrature rules on simplices in arbitrary dimensions.
Symmetric Gauss-Legendre quadrature formulae on simplices.
MappingP1< elemdim, 3 > * map_
Mapping object.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
double weight(const unsigned int i) const
Returns the ith weight.
void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
Returns std::vector of scalar values in several points at once.
Value::return_type r_value_
Basic definitions of numerical quadrature rules.
std::vector< LongIdx > dof_indices
Array of indexes to data_vec_, used for get/set values.
std::shared_ptr< DOFHandlerMultiDim > dh_
DOF handler object.
unsigned int ndofs
number of dofs
unsigned int compute_quadrature(std::vector< arma::vec::fixed< 3 >> &q_points, std::vector< double > &q_weights, const ElementAccessor< spacedim > &elm, unsigned int order=3)
Compute real coordinates and weights (use QGauss) for given element.
const FEValuesViews::Vector< dim, spacedim > & vector_view(unsigned int i) const
Accessor to vector values of multicomponent FE.
std::shared_ptr< DOFHandlerMultiDim > dh
DOF handler object.
unsigned int get_dof_indices(const ElementAccessor< 3 > &cell, std::vector< LongIdx > &indices) const
TODO: Temporary solution. Fix problem with merge new DOF handler and boundary Mesh. Will be removed in future.
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...
MappingP1< elemdim, 3 > * get_mapping()
Return mapping object.
Value value_
Last value, prevents passing large values (vectors) by value.
#define INSTANCE_VALUE_HANDLER(dim)
void set_point(const unsigned int i, const arma::vec::fixed< dim > &p)
Sets individual quadrature point coordinates.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
std::shared_ptr< std::vector< LongIdx > > boundary_dofs_
const unsigned int size() const
Returns number of quadrature points.
~FEValueHandler()
Destructor.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
const arma::vec::fixed< dim > & point(const unsigned int i) const
Returns the ith quadrature point.
Definitions of particular quadrature rules on simplices.
#define WarningOut()
Macro defining 'warning' record of log.
Calculates finite element data on the actual cell.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
FEValueHandler()
Constructor.
ElementMap element_map(ElementAccessor< 3 > elm) const
unsigned int n_comp
number of components
Initialization structure of FEValueHandler class.
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
void reinit(ElementAccessor< 3 > &cell)
Update cell-dependent data (gradients, Jacobians etc.)