39template <
int dim,
int spacedim>
49template <
int dim,
int spacedim>
61 for (
typename std::vector<DataVector>::const_iterator i =
dof_data.begin();
65 for (
typename std::vector<DataVector>::const_iterator i =
cell_data.begin();
72template <
int dim,
int spacedim>
81template <
int dim,
int spacedim>
86 std::vector<std::string> names;
87 names.push_back(name);
92template <
int dim,
int spacedim>
95 const std::vector<std::string> &names,
107 for (
const auto &name : names)
109 for (
const auto &data_set :
dof_data)
110 for (
const auto &data_set_name : data_set.names)
114 for (
const auto &data_set_name : data_set.names)
134template <
int dim,
int spacedim>
135template <
typename number>
138 const std::string & name)
140 const unsigned int n_components =
dof_handler->get_fe(0).n_components();
142 std::vector<std::string> names;
146 if ((n_components == 1) ||
149 names.resize(1, name);
155 names.resize(n_components);
156 for (
unsigned int i = 0; i < n_components; ++i)
158 std::ostringstream namebuf;
160 names[i] = name + namebuf.str();
168template <
int dim,
int spacedim>
169template <
typename number>
173 const std::vector<std::string> &names)
180 (names.size() == 1)) ||
182 (names.size() ==
dof_handler->get_fe(0).n_components())),
184 names.size(),
dof_handler->get_fe(0).n_components()));
185 for (
const auto &name : names)
188 Assert(name.find_first_not_of(
"abcdefghijklmnopqrstuvwxyz"
189 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
190 "0123456789_<>()") == std::string::npos,
193 name.find_first_not_of(
"abcdefghijklmnopqrstuvwxyz"
194 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
195 "0123456789_<>()")));
200 typename std::vector<DataVector>::iterator data_vector =
dof_data.begin();
201 for (; data_vector !=
dof_data.end(); ++data_vector)
202 if (data_vector->names == names)
204 data_vector->data.reinit(vec.
size());
205 std::copy(vec.
begin(), vec.
end(), data_vector->data.begin());
222 dof_handler->get_triangulation().n_active_cells()))
224 typename std::vector<DataVector>::iterator data_vector =
226 for (; data_vector !=
cell_data.end(); ++data_vector)
227 if (data_vector->names == names)
229 data_vector->data.reinit(vec.
size());
230 std::copy(vec.
begin(), vec.
end(), data_vector->data.begin());
243template <
int dim,
int spacedim>
249 unsigned int n_subdivisions =
252 Assert(n_subdivisions >= 1,
260 const unsigned int n_components =
dof_handler->get_fe(0).n_components();
261 const unsigned int n_datasets =
267 unsigned int n_patches = 0;
298 const unsigned int n_q_points = patch_points.
size();
299 std::vector<double> patch_values(n_q_points);
300 std::vector<Vector<double>> patch_values_system(n_q_points,
310 default_patch.
reference_cell = ReferenceCells::get_hypercube<dim + 1>();
311 default_patch.
data.reinit(n_datasets, n_q_points * (n_subdivisions + 1));
316 typename std::vector<
319 unsigned int cell_number = 0;
323 ++cell, ++patch, ++cell_number)
385 x_fe_patch_values.
reinit(cell);
390 for (
unsigned int dataset = 0; dataset <
dof_data.size(); ++dataset)
392 if (n_components == 1)
396 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
397 for (
unsigned int q = 0; q < n_q_points; ++q)
398 patch->data(dataset, q + n_q_points * i) =
405 patch_values_system);
406 for (
unsigned int component = 0; component < n_components;
408 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
409 for (
unsigned int q = 0; q < n_q_points; ++q)
410 patch->data(dataset * n_components + component,
411 q + n_q_points * i) =
412 patch_values_system[q](component);
417 for (
unsigned int dataset = 0; dataset <
cell_data.size(); ++dataset)
419 const double value =
cell_data[dataset].data(cell_number);
420 for (
unsigned int q = 0; q < n_q_points; ++q)
421 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
422 patch->data(dataset +
dof_data.size() * n_components,
423 q * (n_subdivisions + 1) + i) = value;
430template <
int dim,
int spacedim>
436 for (
typename std::vector<DataVector>::iterator i =
dof_data.begin();
441 for (
typename std::vector<DataVector>::iterator i =
cell_data.begin();
449template <
int dim,
int spacedim>
464template <
int dim,
int spacedim>
475template <
int dim,
int spacedim>
476std::vector<std::string>
479 std::vector<std::string> names;
480 for (
typename std::vector<DataVector>::const_iterator dataset =
484 names.insert(names.end(), dataset->names.begin(), dataset->names.end());
485 for (
typename std::vector<DataVector>::const_iterator dataset =
489 names.insert(names.end(), dataset->names.begin(), dataset->names.end());
497#include "data_out_stack.inst"
unsigned int default_subdivisions
void validate_dataset_names() const
std::size_t memory_consumption() const
void declare_data_vector(const std::string &name, const VectorType vector_type)
virtual std::vector< std::string > get_dataset_names() const override
std::vector< DataVector > cell_data
void new_parameter_value(const double parameter_value, const double parameter_step)
std::vector< DataVector > dof_data
SmartPointer< const DoFHandler< dim, spacedim >, DataOutStack< dim, spacedim > > dof_handler
void finish_parameter_value()
void attach_dof_handler(const DoFHandler< dim, spacedim > &dof_handler)
void build_patches(const unsigned int n_subdivisions=0)
std::vector<::DataOutBase::Patch< patch_dim, patch_spacedim > > patches
virtual const std::vector< ::DataOutBase::Patch< DataOutStack< dim, spacedim >::patch_dim, DataOutStack< dim, spacedim >::patch_spacedim > > & get_patches() const override
void add_data_vector(const Vector< number > &vec, const std::string &name)
void get_function_values(const InputVector &fe_function, std::vector< typename InputVector::value_type > &values) const
unsigned int size() const
const FEValuesType & get_present_fe_values() const
void reinit(const TriaIterator< DoFCellAccessor< dim, spacedim, lda > > &cell, const unsigned int q_index=numbers::invalid_unsigned_int, const unsigned int mapping_index=numbers::invalid_unsigned_int, const unsigned int fe_index=numbers::invalid_unsigned_int)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcInvalidCharacter(std::string arg1, size_t arg2)
static ::ExceptionBase & ExcInvalidNumberOfSubdivisions(int arg1)
static ::ExceptionBase & ExcDataNotCleared()
static ::ExceptionBase & ExcDataAlreadyAdded()
static ::ExceptionBase & ExcVectorNotDeclared(std::string arg1)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcInvalidNumberOfNames(int arg1, int arg2)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNoDoFHandlerSelected()
static ::ExceptionBase & ExcNameAlreadyUsed(std::string arg1)
static ::ExceptionBase & ExcInternalError()
typename ActiveSelector::active_cell_iterator active_cell_iterator
@ update_values
Shape function values.
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
ReferenceCell reference_cell
unsigned int n_subdivisions
std::size_t memory_consumption() const
std::vector< std::string > names