38template <
int dim,
int spacedim>
48template <
int dim,
int spacedim>
60 for (
typename std::vector<DataVector>::const_iterator i =
dof_data.begin();
64 for (
typename std::vector<DataVector>::const_iterator i =
cell_data.begin();
71template <
int dim,
int spacedim>
80template <
int dim,
int spacedim>
85 std::vector<std::string> names;
86 names.push_back(name);
91template <
int dim,
int spacedim>
94 const std::vector<std::string> &names,
106 for (
const auto &name : names)
108 for (
const auto &data_set :
dof_data)
109 for (
const auto &data_set_name : data_set.names)
113 for (
const auto &data_set_name : data_set.names)
133template <
int dim,
int spacedim>
134template <
typename number>
137 const std::string &name)
139 const unsigned int n_components =
dof_handler->get_fe(0).n_components();
141 std::vector<std::string> names;
145 if ((n_components == 1) ||
148 names.resize(1, name);
154 names.resize(n_components);
155 for (
unsigned int i = 0; i < n_components; ++i)
157 std::ostringstream namebuf;
159 names[i] = name + namebuf.str();
167template <
int dim,
int spacedim>
168template <
typename number>
172 const std::vector<std::string> &names)
179 (names.size() == 1)) ||
181 (names.size() ==
dof_handler->get_fe(0).n_components())),
183 names.size(),
dof_handler->get_fe(0).n_components()));
184 for (
const auto &name : names)
187 Assert(name.find_first_not_of(
"abcdefghijklmnopqrstuvwxyz"
188 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
189 "0123456789_<>()") == std::string::npos,
192 name.find_first_not_of(
"abcdefghijklmnopqrstuvwxyz"
193 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
194 "0123456789_<>()")));
199 typename std::vector<DataVector>::iterator data_vector =
dof_data.begin();
200 for (; data_vector !=
dof_data.end(); ++data_vector)
201 if (data_vector->names == names)
203 data_vector->data.reinit(vec.
size());
204 std::copy(vec.
begin(), vec.
end(), data_vector->data.begin());
221 dof_handler->get_triangulation().n_active_cells()))
223 typename std::vector<DataVector>::iterator data_vector =
225 for (; data_vector !=
cell_data.end(); ++data_vector)
226 if (data_vector->names == names)
228 data_vector->data.reinit(vec.
size());
229 std::copy(vec.
begin(), vec.
end(), data_vector->data.begin());
242template <
int dim,
int spacedim>
248 unsigned int n_subdivisions =
251 Assert(n_subdivisions >= 1,
259 const unsigned int n_components =
dof_handler->get_fe(0).n_components();
260 const unsigned int n_datasets =
266 unsigned int n_patches = 0;
297 const unsigned int n_q_points = patch_points.size();
298 std::vector<double> patch_values(n_q_points);
299 std::vector<Vector<double>> patch_values_system(n_q_points,
310 default_patch.
data.reinit(n_datasets, n_q_points * (n_subdivisions + 1));
315 typename std::vector<
318 unsigned int cell_number = 0;
322 ++cell, ++patch, ++cell_number)
384 x_fe_patch_values.
reinit(cell);
389 for (
unsigned int dataset = 0; dataset <
dof_data.size(); ++dataset)
391 if (n_components == 1)
395 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
396 for (
unsigned int q = 0; q < n_q_points; ++q)
397 patch->data(dataset, q + n_q_points * i) =
404 patch_values_system);
405 for (
unsigned int component = 0; component < n_components;
407 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
408 for (
unsigned int q = 0; q < n_q_points; ++q)
409 patch->data(dataset * n_components + component,
410 q + n_q_points * i) =
411 patch_values_system[q](component);
416 for (
unsigned int dataset = 0; dataset <
cell_data.size(); ++dataset)
418 const double value =
cell_data[dataset].data(cell_number);
419 for (
unsigned int q = 0; q < n_q_points; ++q)
420 for (
unsigned int i = 0; i < n_subdivisions + 1; ++i)
421 patch->data(dataset +
dof_data.size() * n_components,
422 q * (n_subdivisions + 1) + i) = value;
429template <
int dim,
int spacedim>
435 for (
typename std::vector<DataVector>::iterator i =
dof_data.begin();
440 for (
typename std::vector<DataVector>::iterator i =
cell_data.begin();
448template <
int dim,
int spacedim>
463template <
int dim,
int spacedim>
474template <
int dim,
int spacedim>
475std::vector<std::string>
478 std::vector<std::string> names;
479 for (
typename std::vector<DataVector>::const_iterator dataset =
483 names.insert(names.end(), dataset->names.begin(), dataset->names.end());
484 for (
typename std::vector<DataVector>::const_iterator dataset =
488 names.insert(names.end(), dataset->names.begin(), dataset->names.end());
496#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 ReadVector< Number > &fe_function, std::vector< Number > &values) const
virtual size_type size() const override
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.
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
constexpr const ReferenceCell & get_hypercube()
ReferenceCell reference_cell
unsigned int n_subdivisions
std::size_t memory_consumption() const
std::vector< std::string > names