37 template<
int rank,
int spacedim,
class Value>
41 inline static typename Value::return_type
fe_value(
FEValues<spacedim> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
43 ASSERT(
false).error(
"Unsupported format of FieldFE!\n");
44 typename Value::return_type ret;
53 template<
int spacedim,
class Value>
58 return fe_val.
scalar_view(comp_index).value(i_dof, i_qp);
64 template<
int spacedim,
class Value>
67 inline static typename Value::return_type
fe_value(
FEValues<3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
69 return fe_val.
vector_view(comp_index).value(i_dof, i_qp);
75 template<
int spacedim,
class Value>
78 inline static typename Value::return_type
fe_value(
FEValues<3> &fe_val,
unsigned int i_dof,
unsigned int i_qp,
unsigned int comp_index)
80 return fe_val.
tensor_view(comp_index).value(i_dof, i_qp);
86 template <
int elemdim,
int spacedim,
class Value>
92 template <
int elemdim,
int spacedim,
class Value>
96 WarningOut() <<
"Multiple initialization of FEValueHandler!";
105 template <
int elemdim,
int spacedim,
class Value>
inline 118 template <
int elemdim,
int spacedim,
class Value>
132 for (
unsigned int k=0; k<point_list.
size(); k++)
136 std::shared_ptr<FiniteElement<elemdim>> fe_ptr = fe_mixed_ptr[
Dim<elemdim>{}];
140 for (
unsigned int k=0; k<point_list.
size(); k++) {
141 Value envelope(value_list[k]);
143 for (
unsigned int i=0; i<loc_dofs.n_elem; i++) {
151 template <
int elemdim,
int spacedim,
class Value>
155 static const double weight_coefs[] = { 1., 1., 2., 6. };
157 QGauss qgauss(elemdim, order);
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 spacedim,
class Value>
173 WarningOut() <<
"Multiple initialization of FEValueHandler!";
181 template <
int spacedim,
class Value>
192 for (
unsigned int k=0; k<point_list.
size(); k++) {
193 Value envelope(value_list[k]);
195 for (
unsigned int i=0; i<loc_dofs.n_elem; i++) {
196 envelope(i / envelope.n_cols(), i % envelope.n_rows()) +=
data_vec_[loc_dofs[i]];
202 template <
int elemdim,
int spacedim,
class Value>
209 #define INSTANCE_VALUE_HANDLER_ALL(dim, spacedim) \ 210 template class FEValueHandler<dim, spacedim, FieldValue<0>::Enum >; \ 211 template class FEValueHandler<dim, spacedim, FieldValue<0>::Integer >; \ 212 template class FEValueHandler<dim, spacedim, FieldValue<0>::Scalar >; \ 213 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::VectorFixed >; \ 214 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::TensorFixed >; 216 #define INSTANCE_VALUE_HANDLER(dim) \ 217 INSTANCE_VALUE_HANDLER_ALL(dim,3) 226 template class FEShapeHandler<0, 3,
FieldValue<0>::Integer >;
227 template class FEShapeHandler<0, 3,
FieldValue<0>::Scalar >;
228 template class FEShapeHandler<1, 3,
FieldValue<3>::VectorFixed >;
229 template class FEShapeHandler<2, 3,
FieldValue<3>::TensorFixed >;
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 size() const
Armor::Array< double >::ArrayMatSet set(uint i)
static Value::return_type fe_value(FEValues< 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, FMT_UNUSED unsigned int comp_index)
const FEValuesViews::Vector< spacedim > & vector_view(unsigned int i) const
Accessor to vector values of multicomponent FE.
unsigned int comp_index_
Index of component (of vector_value/tensor_value)
arma::Col< IntIdx > LocDofVec
Armor::ArmaVec< double, point_dim > point(unsigned int i) const
Returns the ith quadrature point.
void initialize(FEValueInitData init_data)
Initialize data members.
LocDofVec get_loc_dof_indices(unsigned int cell_idx) const
TODO: Temporary solution. Fix problem with merge new DOF handler and boundary Mesh. Will be removed in future.
Space< spacedim >::Point Point
double weight(unsigned int i) const
Returns the ith weight.
Cell accessor allow iterate over DOF handler cells.
Class FEValues calculates finite element data on the actual cells such as shape function values...
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
ArmaVec< Type, nr > vec(uint mat_index) const
Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Returns one value in one given point.
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
Base class for quadrature rules on simplices in arbitrary dimensions.
Symmetric Gauss-Legendre quadrature formulae on simplices.
static LocalPoint bary_to_local(const BaryPoint &bp)
Converts from barycentric to local coordinates.
ArmaMat< double, N, M > mat
static Value::return_type fe_value(FEValues< 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
Value::return_type r_value_
Basic definitions of numerical quadrature rules.
ArrayMatSet set(uint index)
Affine mapping between reference and actual cell.
std::shared_ptr< DOFHandlerMultiDim > dh_
DOF handler object.
static Value::return_type fe_value(FEValues< spacedim > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
static Value::return_type fe_value(FEValues< 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
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.
std::shared_ptr< DOFHandlerMultiDim > dh
DOF handler object.
const FEValuesViews::Tensor< spacedim > & tensor_view(unsigned int i) const
Accessor to tensor values of multicomponent FE.
typename arma::Col< Type >::template fixed< nr > ArmaVec
Value value_
Last value, prevents passing large values (vectors) by value.
#define INSTANCE_VALUE_HANDLER(dim)
void value_list(const Armor::array &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.
VectorMPI data_vec_
Store data of Field.
~FEValueHandler()
Destructor.
Definitions of particular quadrature rules on simplices.
#define WarningOut()
Macro defining 'warning' record of log.
Calculates finite element data on the actual cell.
std::shared_ptr< std::vector< IntIdx > > boundary_dofs_
VectorMPI data_vec
Store data of Field.
static ElementMap element_map(ElementAccessor< 3 > elm)
FEValueHandler()
Constructor.
static RealPoint project_unit_to_real(const BaryPoint &point, const ElementMap &map)
unsigned int n_comp
number of components
unsigned int size() const
Returns number of quadrature points.
Initialization structure of FEValueHandler class.
const FEValuesViews::Scalar< spacedim > & scalar_view(unsigned int i) const
Accessor to scalar values of multicomponent FE.
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)