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!";
107 template <
int elemdim,
int spacedim,
class Value>
inline 120 template <
int elemdim,
int spacedim,
class Value>
134 for (
unsigned int k=0; k<point_list.
size(); k++)
140 for (
unsigned int k=0; k<point_list.
size(); k++) {
141 Value envelope(value_list[k]);
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!";
183 template <
int spacedim,
class Value>
194 for (
unsigned int k=0; k<point_list.
size(); k++) {
195 Value envelope(value_list[k]);
198 envelope(i / envelope.n_cols(), i % envelope.n_rows()) +=
data_vec_.
get(loc_dofs[i]);
204 template <
int elemdim,
int spacedim,
class Value>
211 #define INSTANCE_VALUE_HANDLER_ALL(dim, spacedim) \ 212 template class FEValueHandler<dim, spacedim, FieldValue<0>::Enum >; \ 213 template class FEValueHandler<dim, spacedim, FieldValue<0>::Integer >; \ 214 template class FEValueHandler<dim, spacedim, FieldValue<0>::Scalar >; \ 215 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::VectorFixed >; \ 216 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::TensorFixed >; 218 #define INSTANCE_VALUE_HANDLER(dim) \ 219 INSTANCE_VALUE_HANDLER_ALL(dim,3) 228 template class FEShapeHandler<0, 3,
FieldValue<0>::Integer >;
229 template class FEShapeHandler<0, 3,
FieldValue<0>::Scalar >;
230 template class FEShapeHandler<1, 3,
FieldValue<3>::VectorFixed >;
231 template class FEShapeHandler<2, 3,
FieldValue<3>::TensorFixed >;
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.
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
unsigned int range_end
Holds end of component range of evaluation.
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.
MixedPtr< FiniteElement > mixed_fe
FiniteElement objects of all dimensions.
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_
unsigned int range_end_
End of dof range of actual component.
Basic definitions of numerical quadrature rules.
std::shared_ptr< FiniteElement< elemdim > > fe_
Pointer to FiniteElement object used to computing values.
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
double get(unsigned int pos) const
Return value on given position.
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_
unsigned int range_begin_
Begin of dof range of actual component.
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.
unsigned int range_begin
Holds begin of component range of evaluation.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)