48 enum { dim = GridView::dimension };
49 using ctype =
typename GridView::ctype;
50 using Element =
typename GridView::template Codim<0>::Entity;
52 using TensorBuffer = BaseOutputWriter::TensorBuffer;
56 const GridView& gridView,
58 const TensorBuffer&
buf,
67 {
assert(
int(buf_.size()) ==
int(mapper_.size())); }
69 virtual std::string name()
const
72 virtual int ncomps()
const
73 {
return static_cast<int>(buf_[0].M()); }
75 virtual double evaluate(
int mycomp,
77 const Dune::FieldVector<ctype, dim>&
xi)
const
82 idx =
static_cast<size_t>(mapper_.index(
e));
84 else if (codim_ == dim) {
89 Dune::GeometryType
gt =
e.type();
90 int n =
static_cast<int>(
e.subEntities(dim));
91 for (
int i = 0; i <
n; ++i) {
92 Dune::FieldVector<ctype, dim> local =
93 Dune::ReferenceElements<ctype, dim>::general(
gt).position(i, dim);
96 if (local.infinity_norm() <
min) {
97 min = local.infinity_norm();
103 idx =
static_cast<size_t>(mapper_.subIndex(
e,
imin, codim_));
106 throw std::logic_error(
"Only element and vertex based tensor fields are supported so far.");
108 unsigned i =
static_cast<unsigned>(
mycomp);
109 unsigned j =
static_cast<unsigned>(matrixColumnIdx_);
111 return static_cast<double>(
static_cast<float>(buf_[
idx][i][j]));
115 const std::string name_;
116 const GridView gridView_;
117 const Mapper& mapper_;
118 const TensorBuffer& buf_;
120 unsigned matrixColumnIdx_;
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242