Flow123d
release_3.0.0-973-g92f55e826
|
Go to the documentation of this file.
37 template<
int rank,
int elemdim,
int spacedim,
class Value>
41 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)
43 ASSERT(
false).error(
"Unsupported format of FieldFE!\n");
44 typename Value::return_type ret;
53 template<
int elemdim,
int spacedim,
class Value>
56 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)
64 template<
int elemdim,
int spacedim,
class Value>
67 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)
69 return fe_val.
vector_view(comp_index).value(i_dof, i_qp);
75 template<
int elemdim,
int spacedim,
class Value>
78 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)
80 return fe_val.
tensor_view(comp_index).value(i_dof, i_qp);
86 template <
int elemdim,
int spacedim,
class Value>
93 template <
int elemdim,
int spacedim,
class Value>
96 if (dof_indices.size() > 0)
97 WarningOut() <<
"Multiple initialization of FEValueHandler!";
102 value_.set_n_comp(init_data.
n_comp);
110 template <
int elemdim,
int spacedim,
class Value>
inline
114 point_list.push_back(p);
116 v_list.push_back(r_value_);
117 this->value_list(point_list, elm, v_list);
118 this->r_value_ = v_list[0];
119 return this->r_value_;
123 template <
int elemdim,
int spacedim,
class Value>
128 ASSERT_EQ( point_list.size(), value_list.size() ).error();
131 if (boundary_dofs_) this->get_dof_indices( elm, dof_indices);
134 arma::mat map_mat = map_->element_map(elm);
135 for (
unsigned int k=0; k<point_list.size(); k++) {
142 Value envelope(value_list[k]);
144 for (
unsigned int i=0; i<dh_->ds()->fe<elemdim>(elm)->n_dofs(); i++) {
145 value_list[k] += data_vec_[dof_indices[i]]
152 template <
int elemdim,
int spacedim,
class Value>
156 static const double weight_coefs[] = { 1., 1., 2., 6. };
159 arma::mat map_mat = map_->element_map(ele);
161 for(
unsigned i=0; i<qgauss.
size(); ++i) {
162 q_weights[i] = qgauss.
weight(i)*weight_coefs[elemdim];
166 return qgauss.
size();
170 template <
int elemdim,
int spacedim,
class Value>
173 unsigned int ndofs = this->value_.n_rows() * this->value_.n_cols();
174 for (
unsigned int k=0; k<ndofs; k++) {
175 indices[k] = (*boundary_dofs_)[ndofs*cell.
idx()+k];
181 template <
int spacedim,
class Value>
185 WarningOut() <<
"Multiple initialization of FEValueHandler!";
194 template <
int spacedim,
class Value>
204 for (
unsigned int k=0; k<point_list.size(); k++) {
207 for (
unsigned int i=0; i<
dh_->ds()->fe<0>(elm)->n_dofs(); i++) {
214 template <
int spacedim,
class Value>
217 unsigned int ndofs = this->
value_.n_rows() * this->
value_.n_cols();
218 for (
unsigned int k=0; k<ndofs; k++) {
219 indices[k] = (*boundary_dofs_)[ndofs*cell.
idx()+k];
225 template <
int elemdim,
int spacedim,
class Value>
228 if (map_ !=
nullptr)
delete map_;
233 #define INSTANCE_VALUE_HANDLER_ALL(dim, spacedim) \
234 template class FEValueHandler<dim, spacedim, FieldValue<0>::Enum >; \
235 template class FEValueHandler<dim, spacedim, FieldValue<0>::Integer >; \
236 template class FEValueHandler<dim, spacedim, FieldValue<0>::Scalar >; \
237 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::VectorFixed >; \
238 template class FEValueHandler<dim, spacedim, FieldValue<spacedim>::TensorFixed >; \
239 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Enum >; \
240 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Integer >; \
241 template class FEShapeHandler<0, dim, spacedim, FieldValue<0>::Scalar >; \
242 template class FEShapeHandler<1, dim, spacedim, FieldValue<spacedim>::VectorFixed >; \
243 template class FEShapeHandler<2, dim, spacedim, FieldValue<spacedim>::TensorFixed >;
245 #define INSTANCE_VALUE_HANDLER(dim) \
246 INSTANCE_VALUE_HANDLER_ALL(dim,3)
~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)
Space< spacedim >::Point Point
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
const unsigned int size() const
Returns number of quadrature points.
void initialize(FEValueInitData init_data)
Initialize data members.
void reinit(ElementAccessor< 3 > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
unsigned int get_loc_dof_indices(std::vector< LongIdx > &indices) const
Returns the indices of dofs associated to the cell on the local process.
Class FEValues calculates finite element data on the actual cells such as shape function values,...
void resize(unsigned int local_size)
@ update_values
Shape function values.
double weight(const unsigned int i) const
Returns the ith weight.
const arma::vec::fixed< dim > & point(const unsigned int i) const
Returns the ith quadrature point.
Calculates finite element data on the actual cell.
std::shared_ptr< DOFHandlerMultiDim > dh_
DOF handler object.
std::shared_ptr< DOFHandlerMultiDim > dh
DOF handler object.
Definitions of particular quadrature rules on simplices.
std::vector< LongIdx > dof_indices
Array of indexes to data_vec_, used for get/set values.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
std::shared_ptr< std::vector< LongIdx > > boundary_dofs_
unsigned int ndofs
number of dofs
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
VectorMPI data_vec_
Store data of Field.
const FEValuesViews::Vector< dim, spacedim > & vector_view(unsigned int i) const
Accessor to vector values of multicomponent FE.
Value value_
Last value, prevents passing large values (vectors) by value.
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.
Initialization structure of FEValueHandler class.
Symmetric Gauss-Legendre quadrature formulae on simplices.
void set_point(const unsigned int i, const arma::vec::fixed< dim > &p)
Sets individual quadrature point coordinates.
FEValueHandler()
Constructor.
static Value::return_type fe_value(FEValues< elemdim, 3 > &fe_val, unsigned int i_dof, unsigned int i_qp, unsigned int comp_index)
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.
#define WarningOut()
Macro defining 'warning' record of log.
const Value::return_type & value(const Point &p, const ElementAccessor< spacedim > &elm)
Returns one value in one given point.
Basic definitions of numerical quadrature rules.
VectorMPI data_vec
Store data of Field.
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
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)
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.
#define INSTANCE_VALUE_HANDLER(dim)
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
Base class for quadrature rules on simplices in arbitrary dimensions.
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....
const FEValuesViews::Tensor< dim, spacedim > & tensor_view(unsigned int i) const
Accessor to tensor values of multicomponent FE.
unsigned int n_comp
number of components