... SolutionTransfer, FEFieldFunction, DataOut, DataOut_DoFData, DataOutFaces, DataOutRotation.
--- /dev/null
+Deprecated: The template arguments of the following classes have been
+changed to avoid the legacy argument `DoFHandlerType`:
+<ul>
+ <li> `SolutionTransfer<dim, VectorType, DoFHandlerType> -> SolutionTransfer<dim, VectorType, spacedim>`
+ <li> `parallel::distributed::SolutionTransfer<dim, VectorType, DoFHandlerType> -> parallel::distributed::SolutionTransfer<dim, VectorType, spacedim>`
+ <li> `Functions::FEFieldFunction<dim, DoFHandlerType, VectorType> -> Functions::FEFieldFunction<dim, VectorType, spacedim>`
+ <li> `DataOut<dim, DoFHandlerType> -> DataOut<dim, spacedim>`
+ <li> `DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim> -> DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>`
+ <li> `DataOutFaces<dim, DoFHandlerType> -> DataOutFaces<dim, spacedim>`
+ <li> `DataOutRotation<dim, DoFHandlerType> -> DataOutRotation<dim, spacedim>`
+</ul>
+Please change your code accordingly.
+<br>
+If for some reason, you need a code that is compatible with deal.II
+9.3 and the subsequent release, a Legacy namespace has been introduced
+with aliases of these classes with their original interface. You can
+make the following substitutions to your code for each of the affected
+classes:
+<ul>
+ <li>X → Legacy::X
+</ul>
+To perform this substitution automatically, you may use a *search and
+replace* script like the following made for the *bash* shell:
+@code{.sh}
+classes=(SolutionTransfer parallel::distributed::SolutionTransfer Functions::FEFieldFunction DataOut DataOut_DoFData DataOutFaces DataOutRotation)
+for c in \${classes[@]}; do
+ find /path/to/your/code -type f -exec sed -i -E "/(\w\${c}|\${c}[^<]|Particles::\${c}|distributed::\${c}|^\s*(\/\/|\*))/! s/\${c}/Legacy::\${c}/g" {} \;
+done
+@endcode
+(Marc Fehling, 2020/11/21)
template <int dim>
void BEMProblem<dim>::output_results(const unsigned int cycle)
{
- DataOut<dim - 1, DoFHandler<dim - 1, dim>> dataout;
+ DataOut<dim - 1, dim> dataout;
dataout.attach_dof_handler(dof_handler);
- dataout.add_data_vector(
- phi, "phi", DataOut<dim - 1, DoFHandler<dim - 1, dim>>::type_dof_data);
- dataout.add_data_vector(
- alpha,
- "alpha",
- DataOut<dim - 1, DoFHandler<dim - 1, dim>>::type_dof_data);
- dataout.build_patches(
- mapping,
- mapping.get_degree(),
- DataOut<dim - 1, DoFHandler<dim - 1, dim>>::curved_inner_cells);
+ dataout.add_data_vector(phi, "phi", DataOut<dim - 1, dim>::type_dof_data);
+ dataout.add_data_vector(alpha,
+ "alpha",
+ DataOut<dim - 1, dim>::type_dof_data);
+ dataout.build_patches(mapping,
+ mapping.get_degree(),
+ DataOut<dim - 1, dim>::curved_inner_cells);
const std::string filename = std::to_string(dim) + "d_boundary_solution_" +
std::to_string(cycle) + ".vtk";
template <int spacedim>
void LaplaceBeltramiProblem<spacedim>::output_results() const
{
- DataOut<dim, DoFHandler<dim, spacedim>> data_out;
+ DataOut<dim, spacedim> data_out;
data_out.attach_dof_handler(dof_handler);
- data_out.add_data_vector(
- solution,
- "solution",
- DataOut<dim, DoFHandler<dim, spacedim>>::type_dof_data);
+ data_out.add_data_vector(solution,
+ "solution",
+ DataOut<dim, spacedim>::type_dof_data);
data_out.build_patches(mapping, mapping.get_degree());
const std::string filename =
// embedded_mapping to the DataOut::build_patches function. The mapping will
// take care of outputting the result on the actual deformed configuration.
- DataOut<dim, DoFHandler<dim, spacedim>> embedded_out;
+ DataOut<dim, spacedim> embedded_out;
std::ofstream embedded_out_file("embedded.vtu");
*
* @ingroup distributed
*/
- template <int dim,
- typename VectorType,
- typename DoFHandlerType = DoFHandler<dim>>
+ template <int dim, typename VectorType, int spacedim = dim>
class SolutionTransfer
{
-#ifndef DEAL_II_MSVC
- static_assert(dim == DoFHandlerType::dimension,
- "The dimension explicitly provided as a template "
- "argument, and the dimension of the DoFHandlerType "
- "template argument must match.");
-#endif
public:
/**
* Constructor.
* points to the Triangulation before the refinement in question
* happens.
*/
- SolutionTransfer(const DoFHandlerType &dof);
+ SolutionTransfer(const DoFHandler<dim, spacedim> &dof);
/**
* Destructor.
/**
* Pointer to the degree of freedom handler to work with.
*/
- SmartPointer<const DoFHandlerType,
- SolutionTransfer<dim, VectorType, DoFHandlerType>>
+ SmartPointer<const DoFHandler<dim, spacedim>,
+ SolutionTransfer<dim, VectorType, spacedim>>
dof_handler;
/**
*/
std::vector<char>
pack_callback(
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell,
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- CellStatus status);
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim, spacedim>::CellStatus status);
/**
* A callback function used to unpack the data on the current mesh that
*/
void
unpack_callback(
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell,
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- CellStatus status,
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell,
+ const typename Triangulation<dim, spacedim>::CellStatus status,
const boost::iterator_range<std::vector<char>::const_iterator>
& data_range,
std::vector<VectorType *> &all_out);
template <int dim,
typename VectorType,
typename DoFHandlerType = DoFHandler<dim>>
- using SolutionTransfer DEAL_II_DEPRECATED = dealii::parallel::
- distributed::SolutionTransfer<dim, VectorType, DoFHandlerType>;
+ using SolutionTransfer DEAL_II_DEPRECATED =
+ dealii::parallel::distributed::
+ SolutionTransfer<dim, VectorType, DoFHandlerType::space_dimension>;
} // namespace distributed
} // namespace parallel
} // namespace Legacy
*
* @ingroup output
*/
-template <int dim, typename DoFHandlerType = DoFHandler<dim>>
-class DataOut : public DataOut_DoFData<DoFHandlerType,
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
+template <int dim, int spacedim = dim>
+class DataOut : public DataOut_DoFData<dim, dim, spacedim, spacedim>
{
public:
- static_assert(dim == DoFHandlerType::dimension,
- "The dimension given explicitly as a template argument to "
- "this class must match the dimension of the DoFHandler "
- "template argument");
- static constexpr unsigned int spacedim = DoFHandlerType::space_dimension;
-
/**
* Typedef to the iterator type of the dof handler class under
* consideration.
*/
using cell_iterator =
- typename DataOut_DoFData<DoFHandlerType,
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>::cell_iterator;
+ typename DataOut_DoFData<dim, dim, spacedim, spacedim>::cell_iterator;
/**
* The type of the function object returning the first cell as used in
* deformation of each vertex.
*/
virtual void
- build_patches(const Mapping<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &mapping,
- const unsigned int n_subdivisions = 0,
- const CurvedCellRegion curved_region = curved_boundary);
+ build_patches(const Mapping<dim, spacedim> &mapping,
+ const unsigned int n_subdivisions = 0,
+ const CurvedCellRegion curved_region = curved_boundary);
/**
* Same as above, but for hp::MappingCollection.
*/
virtual void
- build_patches(
- const hp::MappingCollection<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &mapping,
- const unsigned int n_subdivisions = 0,
- const CurvedCellRegion curved_region = curved_boundary);
+ build_patches(const hp::MappingCollection<dim, spacedim> &mapping,
+ const unsigned int n_subdivisions = 0,
+ const CurvedCellRegion curved_region = curved_boundary);
/**
* A function that allows selecting for which cells output should be
* reasons.
*/
void
- build_one_patch(const std::pair<cell_iterator, unsigned int> *cell_and_index,
- internal::DataOutImplementation::ParallelData<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &scratch_data,
- const unsigned int n_subdivisions,
- const CurvedCellRegion curved_cell_region);
+ build_one_patch(
+ const std::pair<cell_iterator, unsigned int> *cell_and_index,
+ internal::DataOutImplementation::ParallelData<dim, spacedim> &scratch_data,
+ const unsigned int n_subdivisions,
+ const CurvedCellRegion curved_cell_region);
};
namespace Legacy
* instead.
*/
template <int dim, typename DoFHandlerType = DoFHandler<dim>>
- using DataOut DEAL_II_DEPRECATED = dealii::DataOut<dim, DoFHandlerType>;
+ using DataOut DEAL_II_DEPRECATED =
+ dealii::DataOut<dim, DoFHandlerType::space_dimension>;
} // namespace Legacy
*
* @ingroup output
*/
-template <typename DoFHandlerType,
+template <int dim,
int patch_dim,
- int patch_space_dim = patch_dim>
-class DataOut_DoFData : public DataOutInterface<patch_dim, patch_space_dim>
+ int spacedim = dim,
+ int patch_spacedim = patch_dim>
+class DataOut_DoFData : public DataOutInterface<patch_dim, patch_spacedim>
{
public:
/**
* Typedef to the iterator type of the dof handler class under
* consideration.
*/
- using cell_iterator =
- typename Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>::cell_iterator;
+ using cell_iterator = typename Triangulation<dim, spacedim>::cell_iterator;
public:
/**
* object, then that contains all information needed to generate the output.
*/
void
- attach_dof_handler(const DoFHandlerType &);
+ attach_dof_handler(const DoFHandler<dim, spacedim> &);
/**
* Designate a triangulation to be used to extract geometry data and the
* at all, in which case it provides the geometry.
*/
void
- attach_triangulation(const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &);
+ attach_triangulation(const Triangulation<dim, spacedim> &);
/**
* Add a data vector together with its name.
template <class VectorType>
void
add_data_vector(
- const DoFHandlerType & dof_handler,
- const VectorType & data,
- const std::vector<std::string> &names,
+ const DoFHandler<dim, spacedim> &dof_handler,
+ const VectorType & data,
+ const std::vector<std::string> & names,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
&data_component_interpretation = std::vector<
DataComponentInterpretation::DataComponentInterpretation>());
template <class VectorType>
void
add_data_vector(
- const DoFHandlerType &dof_handler,
- const VectorType & data,
- const std::string & name,
+ const DoFHandler<dim, spacedim> &dof_handler,
+ const VectorType & data,
+ const std::string & name,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
&data_component_interpretation = std::vector<
DataComponentInterpretation::DataComponentInterpretation>());
*/
template <class VectorType>
void
- add_data_vector(const VectorType &data,
- const DataPostprocessor<DoFHandlerType::space_dimension>
- &data_postprocessor);
+ add_data_vector(const VectorType & data,
+ const DataPostprocessor<spacedim> &data_postprocessor);
/**
* Same function as above, but with a DoFHandler object that does not need
*/
template <class VectorType>
void
- add_data_vector(const DoFHandlerType &dof_handler,
- const VectorType & data,
- const DataPostprocessor<DoFHandlerType::space_dimension>
- &data_postprocessor);
+ add_data_vector(const DoFHandler<dim, spacedim> & dof_handler,
+ const VectorType & data,
+ const DataPostprocessor<spacedim> &data_postprocessor);
/**
* Add a multilevel data vector.
template <class VectorType>
void
add_mg_data_vector(
- const DoFHandlerType & dof_handler,
+ const DoFHandler<dim, spacedim> &dof_handler,
const MGLevelObject<VectorType> &data,
const std::vector<std::string> & names,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
*/
template <class VectorType>
void
- add_mg_data_vector(const DoFHandlerType & dof_handler,
+ add_mg_data_vector(const DoFHandler<dim, spacedim> &dof_handler,
const MGLevelObject<VectorType> &data,
const std::string & name);
* This function will fail if either this or the other object did not yet
* set up any patches.
*/
- template <typename DoFHandlerType2>
+ template <int dim2, int spacedim2>
void
merge_patches(
- const DataOut_DoFData<DoFHandlerType2, patch_dim, patch_space_dim> &source,
- const Point<patch_space_dim> &shift = Point<patch_space_dim>());
+ const DataOut_DoFData<dim2, patch_dim, spacedim2, patch_spacedim> &source,
+ const Point<patch_spacedim> &shift = Point<patch_spacedim>());
+
+ /**
+ * @deprecated Use merge_patches() without the DoFHandlerType2 template
+ * instead.
+ */
+ template <typename DoFHandlerType2>
+ DEAL_II_DEPRECATED void
+ merge_patches(const DataOut_DoFData<DoFHandlerType2::dimension,
+ patch_dim,
+ DoFHandlerType2::space_dimension,
+ patch_spacedim> &source,
+ const Point<patch_spacedim> &shift = Point<patch_spacedim>());
/**
* Release the pointers to the data vectors and the DoF handler. You have to
/**
* Abbreviate the somewhat lengthy name for the Patch class.
*/
- using Patch = dealii::DataOutBase::Patch<patch_dim, patch_space_dim>;
+ using Patch = dealii::DataOutBase::Patch<patch_dim, patch_spacedim>;
/**
* Pointer to the triangulation object.
*/
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>
- triangulation;
+ SmartPointer<const Triangulation<dim, spacedim>> triangulation;
/**
* Pointer to the optional handler object.
*/
- SmartPointer<const DoFHandlerType> dofs;
+ SmartPointer<const DoFHandler<dim, spacedim>> dofs;
/**
* List of data elements with vectors of values for each degree of freedom.
*/
- std::vector<std::shared_ptr<internal::DataOutImplementation::DataEntryBase<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>>
+ std::vector<std::shared_ptr<
+ internal::DataOutImplementation::DataEntryBase<dim, spacedim>>>
dof_data;
/**
* List of data elements with vectors of values for each cell.
*/
- std::vector<std::shared_ptr<internal::DataOutImplementation::DataEntryBase<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>>
+ std::vector<std::shared_ptr<
+ internal::DataOutImplementation::DataEntryBase<dim, spacedim>>>
cell_data;
/**
* Extracts the finite elements stored in the dof_data object, including a
* dummy object of FE_DGQ<dim>(0) in case only the triangulation is used.
*/
- std::vector<
- std::shared_ptr<dealii::hp::FECollection<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>>
+ std::vector<std::shared_ptr<dealii::hp::FECollection<dim, spacedim>>>
get_fes() const;
/**
// Make all template siblings friends. Needed for the merge_patches()
// function.
- template <class, int, int>
+ template <int, int, int, int>
friend class DataOut_DoFData;
/**
template <class VectorType>
void
add_data_vector_internal(
- const DoFHandlerType * dof_handler,
- const VectorType & data,
- const std::vector<std::string> &names,
- const DataVectorType type,
+ const DoFHandler<dim, spacedim> *dof_handler,
+ const VectorType & data,
+ const std::vector<std::string> & names,
+ const DataVectorType type,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
& data_component_interpretation,
const bool deduce_output_names);
// -------------------- template and inline functions ------------------------
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
const VectorType & vec,
const std::string & name,
const DataVectorType type,
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
const VectorType & vec,
const std::vector<std::string> &names,
const DataVectorType type,
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
- const DoFHandlerType &dof_handler,
- const VectorType & data,
- const std::string & name,
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
+ const DoFHandler<dim, spacedim> &dof_handler,
+ const VectorType & data,
+ const std::string & name,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
&data_component_interpretation)
{
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
- const DoFHandlerType & dof_handler,
- const VectorType & data,
- const std::vector<std::string> &names,
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
+ const DoFHandler<dim, spacedim> &dof_handler,
+ const VectorType & data,
+ const std::vector<std::string> & names,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
&data_component_interpretation)
{
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
- const VectorType & vec,
- const DataPostprocessor<DoFHandlerType::space_dimension> &data_postprocessor)
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
+ const VectorType & vec,
+ const DataPostprocessor<spacedim> &data_postprocessor)
{
Assert(dofs != nullptr,
Exceptions::DataOutImplementation::ExcNoDoFHandlerSelected());
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
-template <typename DoFHandlerType2>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+template <int dim2, int spacedim2>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::merge_patches(
- const DataOut_DoFData<DoFHandlerType2, patch_dim, patch_space_dim> &source,
- const Point<patch_space_dim> & shift)
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::merge_patches(
+ const DataOut_DoFData<dim2, patch_dim, spacedim2, patch_spacedim> &source,
+ const Point<patch_spacedim> & shift)
{
const std::vector<Patch> &source_patches = source.get_patches();
Assert((patches.size() != 0) && (source_patches.size() != 0),
Assert(patches[0].data.n_cols() == source_patches[0].data.n_cols(),
Exceptions::DataOutImplementation::ExcIncompatiblePatchLists());
Assert((patches[0].data.n_rows() +
- (patches[0].points_are_available ? 0 : patch_space_dim)) ==
+ (patches[0].points_are_available ? 0 : patch_spacedim)) ==
(source_patches[0].data.n_rows() +
- (source_patches[0].points_are_available ? 0 : patch_space_dim)),
+ (source_patches[0].points_are_available ? 0 : patch_spacedim)),
Exceptions::DataOutImplementation::ExcIncompatiblePatchLists());
// check equality of the vector data
patches.insert(patches.end(), source_patches.begin(), source_patches.end());
// perform shift, if so desired
- if (shift != Point<patch_space_dim>())
+ if (shift != Point<patch_spacedim>())
for (unsigned int i = old_n_patches; i < patches.size(); ++i)
for (const unsigned int v : GeometryInfo<patch_dim>::vertex_indices())
patches[i].vertices[v] += shift;
patches[i].neighbors[n] += old_n_patches;
}
+
+
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+template <typename DoFHandlerType2>
+void
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::merge_patches(
+ const DataOut_DoFData<DoFHandlerType2::dimension,
+ patch_dim,
+ DoFHandlerType2::space_dimension,
+ patch_spacedim> &source,
+ const Point<patch_spacedim> & shift)
+{
+ this->merge_patches<DoFHandlerType2::dimension,
+ DoFHandlerType2::space_dimension>(source, shift);
+}
+
+
+
namespace Legacy
{
/**
int patch_dim,
int patch_space_dim = patch_dim>
using DataOut_DoFData DEAL_II_DEPRECATED =
- dealii::DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>;
+ dealii::DataOut_DoFData<DoFHandlerType::dimension,
+ patch_dim,
+ DoFHandlerType::space_dimension,
+ patch_space_dim>;
} // namespace Legacy
&data_component_interpretation)
: dof_handler(
dofs,
- typeid(
- dealii::DataOut_DoFData<DoFHandler<dim, spacedim>, dim, spacedim>)
- .name())
+ typeid(dealii::DataOut_DoFData<dim, dim, spacedim, spacedim>).name())
, names(names_in)
, data_component_interpretation(data_component_interpretation)
, postprocessor(nullptr, typeid(*this).name())
const DataPostprocessor<spacedim> *data_postprocessor)
: dof_handler(
dofs,
- typeid(
- dealii::DataOut_DoFData<DoFHandler<dim, spacedim>, dim, spacedim>)
- .name())
+ typeid(dealii::DataOut_DoFData<dim, dim, spacedim, spacedim>).name())
, names(data_postprocessor->get_names())
, data_component_interpretation(
data_postprocessor->get_data_component_interpretation())
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::DataOut_DoFData()
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::DataOut_DoFData()
: triangulation(nullptr, typeid(*this).name())
, dofs(nullptr, typeid(*this).name())
{}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::~DataOut_DoFData()
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::~DataOut_DoFData()
{
// virtual functions called in constructors and destructors never use the
// override in a derived class for clarity be explicit on which function is
// called
- DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::clear();
+ DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::clear();
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::attach_dof_handler(
- const DoFHandlerType &d)
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::attach_dof_handler(
+ const DoFHandler<dim, spacedim> &d)
{
Assert(dof_data.size() == 0,
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
triangulation =
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>(
- &d.get_triangulation(), typeid(*this).name());
- dofs = SmartPointer<const DoFHandlerType>(&d, typeid(*this).name());
+ SmartPointer<const Triangulation<dim, spacedim>>(&d.get_triangulation(),
+ typeid(*this).name());
+ dofs =
+ SmartPointer<const DoFHandler<dim, spacedim>>(&d, typeid(*this).name());
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
- attach_triangulation(
- const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &tria)
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::attach_triangulation(
+ const Triangulation<dim, spacedim> &tria)
{
Assert(dof_data.size() == 0,
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
triangulation =
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>(
- &tria, typeid(*this).name());
+ SmartPointer<const Triangulation<dim, spacedim>>(&tria,
+ typeid(*this).name());
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_data_vector(
- const DoFHandlerType & dof_handler,
- const VectorType & vec,
- const DataPostprocessor<DoFHandlerType::space_dimension> &data_postprocessor)
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_data_vector(
+ const DoFHandler<dim, spacedim> & dof_handler,
+ const VectorType & vec,
+ const DataPostprocessor<spacedim> &data_postprocessor)
{
// this is a specialized version of the other function where we have a
// postprocessor. if we do, we know that we have type_dof_data, which makes
}
else
{
- triangulation =
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>(
- &dof_handler.get_triangulation(), typeid(*this).name());
+ triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ &dof_handler.get_triangulation(), typeid(*this).name());
}
Assert(vec.size() == dof_handler.n_dofs(),
auto new_entry = std::make_unique<
- internal::DataOutImplementation::DataEntry<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension,
- VectorType>>(
+ internal::DataOutImplementation::DataEntry<dim, spacedim, VectorType>>(
&dof_handler, &vec, &data_postprocessor);
dof_data.emplace_back(std::move(new_entry));
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <typename VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::
add_data_vector_internal(
- const DoFHandlerType * dof_handler,
- const VectorType & data_vector,
- const std::vector<std::string> &names,
- const DataVectorType type,
+ const DoFHandler<dim, spacedim> *dof_handler,
+ const VectorType & data_vector,
+ const std::vector<std::string> & names,
+ const DataVectorType type,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
& data_component_interpretation_,
const bool deduce_output_names)
if (triangulation == nullptr)
{
Assert(dof_handler != nullptr, ExcInternalError());
- triangulation =
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>(
- &dof_handler->get_triangulation(), typeid(*this).name());
+ triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ &dof_handler->get_triangulation(), typeid(*this).name());
}
if (dof_handler != nullptr)
// finally, add the data vector:
auto new_entry = std::make_unique<
- internal::DataOutImplementation::DataEntry<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension,
- VectorType>>(
+ internal::DataOutImplementation::DataEntry<dim, spacedim, VectorType>>(
dof_handler, &data_vector, deduced_names, data_component_interpretation);
if (actual_type == type_dof_data)
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <class VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_mg_data_vector(
- const DoFHandlerType & dof_handler,
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_mg_data_vector(
+ const DoFHandler<dim, spacedim> &dof_handler,
const MGLevelObject<VectorType> &data,
const std::string & name)
{
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
template <class VectorType>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::add_mg_data_vector(
- const DoFHandlerType & dof_handler,
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::add_mg_data_vector(
+ const DoFHandler<dim, spacedim> &dof_handler,
const MGLevelObject<VectorType> &data,
const std::vector<std::string> & names,
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
&data_component_interpretation_)
{
if (triangulation == nullptr)
- triangulation =
- SmartPointer<const Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>(
- &dof_handler.get_triangulation(), typeid(*this).name());
+ triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ &dof_handler.get_triangulation(), typeid(*this).name());
Assert(&dof_handler.get_triangulation() == triangulation,
ExcMessage("The triangulation attached to the DoFHandler does not "
ExcMessage(
"Invalid number of entries in data_component_interpretation."));
- auto new_entry =
- std::make_unique<internal::DataOutImplementation::MGDataEntry<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension,
- VectorType>>(&dof_handler,
- &data,
- deduced_names,
- data_component_interpretation);
+ auto new_entry = std::make_unique<
+ internal::DataOutImplementation::MGDataEntry<dim, spacedim, VectorType>>(
+ &dof_handler, &data, deduced_names, data_component_interpretation);
dof_data.emplace_back(std::move(new_entry));
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
- clear_data_vectors()
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::clear_data_vectors()
{
dof_data.erase(dof_data.begin(), dof_data.end());
cell_data.erase(cell_data.begin(), cell_data.end());
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::
clear_input_data_references()
{
for (unsigned int i = 0; i < dof_data.size(); ++i)
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
void
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::clear()
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::clear()
{
dof_data.erase(dof_data.begin(), dof_data.end());
cell_data.erase(cell_data.begin(), cell_data.end());
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
std::vector<std::string>
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::get_dataset_names()
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::get_dataset_names()
const
{
std::vector<std::string> names;
{
// It's a vector. First output all real parts, then all
// imaginary parts:
- const unsigned int size = patch_space_dim;
+ const unsigned int size = patch_spacedim;
for (unsigned int vec_comp = 0; vec_comp < size; ++vec_comp)
names.push_back(input_data->names[i + vec_comp] + "_re");
for (unsigned int vec_comp = 0; vec_comp < size; ++vec_comp)
{
// It's a tensor. First output all real parts, then all
// imaginary parts:
- const unsigned int size = patch_space_dim * patch_space_dim;
+ const unsigned int size = patch_spacedim * patch_spacedim;
for (unsigned int tensor_comp = 0; tensor_comp < size;
++tensor_comp)
names.push_back(input_data->names[i + tensor_comp] +
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
std::vector<
std::tuple<unsigned int,
unsigned int,
std::string,
DataComponentInterpretation::DataComponentInterpretation>>
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::
get_nonscalar_data_ranges() const
{
std::vector<
// ensure that there is a continuous number of next space_dim
// components that all deal with vectors
Assert(
- i + patch_space_dim <= input_data->n_output_variables,
+ i + patch_spacedim <= input_data->n_output_variables,
Exceptions::DataOutImplementation::ExcInvalidVectorDeclaration(
i, input_data->names[i]));
- for (unsigned int dd = 1; dd < patch_space_dim; ++dd)
+ for (unsigned int dd = 1; dd < patch_spacedim; ++dd)
Assert(
input_data->data_component_interpretation[i + dd] ==
DataComponentInterpretation::component_is_part_of_vector,
// name to these components. if not, leave the name empty and
// let the output format writer decide what to do here
std::string name = input_data->names[i];
- for (unsigned int dd = 1; dd < patch_space_dim; ++dd)
+ for (unsigned int dd = 1; dd < patch_spacedim; ++dd)
if (name != input_data->names[i + dd])
{
name = "";
{
ranges.emplace_back(std::forward_as_tuple(
output_component,
- output_component + patch_space_dim - 1,
+ output_component + patch_spacedim - 1,
name,
DataComponentInterpretation::component_is_part_of_vector));
// increase the 'component' counter by the appropriate amount,
// same for 'i', since we have already dealt with all these
// components
- output_component += patch_space_dim;
- i += patch_space_dim;
+ output_component += patch_spacedim;
+ i += patch_spacedim;
}
else
{
ranges.emplace_back(std::forward_as_tuple(
output_component,
- output_component + patch_space_dim - 1,
+ output_component + patch_spacedim - 1,
name + "_re",
DataComponentInterpretation::component_is_part_of_vector));
- output_component += patch_space_dim;
+ output_component += patch_spacedim;
ranges.emplace_back(std::forward_as_tuple(
output_component,
- output_component + patch_space_dim - 1,
+ output_component + patch_spacedim - 1,
name + "_im",
DataComponentInterpretation::component_is_part_of_vector));
- output_component += patch_space_dim;
+ output_component += patch_spacedim;
- i += patch_space_dim;
+ i += patch_spacedim;
}
case DataComponentInterpretation::component_is_part_of_tensor:
{
- const unsigned int size = patch_space_dim * patch_space_dim;
+ const unsigned int size = patch_spacedim * patch_spacedim;
// ensure that there is a continuous number of next
// space_dim*space_dim components that all deal with tensors
Assert(
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
-const std::vector<dealii::DataOutBase::Patch<patch_dim, patch_space_dim>> &
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::get_patches() const
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+const std::vector<dealii::DataOutBase::Patch<patch_dim, patch_spacedim>> &
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::get_patches() const
{
return patches;
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
-std::vector<
- std::shared_ptr<dealii::hp::FECollection<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>>>
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::get_fes() const
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
+std::vector<std::shared_ptr<dealii::hp::FECollection<dim, spacedim>>>
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::get_fes() const
{
- const unsigned int dhdim = DoFHandlerType::dimension;
- const unsigned int dhspacedim = DoFHandlerType::space_dimension;
- std::vector<std::shared_ptr<dealii::hp::FECollection<dhdim, dhspacedim>>>
+ std::vector<std::shared_ptr<dealii::hp::FECollection<dim, spacedim>>>
finite_elements(this->dof_data.size());
for (unsigned int i = 0; i < this->dof_data.size(); ++i)
{
}
if (duplicate == false)
finite_elements[i] =
- std::make_shared<dealii::hp::FECollection<dhdim, dhspacedim>>(
+ std::make_shared<dealii::hp::FECollection<dim, spacedim>>(
this->dof_data[i]->dof_handler->get_fe_collection());
}
if (this->dof_data.empty())
{
if (reference_cell.is_hyper_cube())
finite_elements.emplace_back(
- std::make_shared<dealii::hp::FECollection<dhdim, dhspacedim>>(
- FE_DGQ<dhdim, dhspacedim>(0)));
+ std::make_shared<dealii::hp::FECollection<dim, spacedim>>(
+ FE_DGQ<dim, spacedim>(0)));
else if (reference_cell.is_simplex())
finite_elements.emplace_back(
- std::make_shared<dealii::hp::FECollection<dhdim, dhspacedim>>(
- FE_SimplexDGP<dhdim, dhspacedim>(1)));
+ std::make_shared<dealii::hp::FECollection<dim, spacedim>>(
+ FE_SimplexDGP<dim, spacedim>(1)));
else if (reference_cell == dealii::ReferenceCells::Wedge)
finite_elements.emplace_back(
- std::make_shared<dealii::hp::FECollection<dhdim, dhspacedim>>(
- FE_WedgeDGP<dhdim, dhspacedim>(1)));
+ std::make_shared<dealii::hp::FECollection<dim, spacedim>>(
+ FE_WedgeDGP<dim, spacedim>(1)));
else if (reference_cell == dealii::ReferenceCells::Pyramid)
finite_elements.emplace_back(
- std::make_shared<dealii::hp::FECollection<dhdim, dhspacedim>>(
- FE_PyramidDGP<dhdim, dhspacedim>(1)));
+ std::make_shared<dealii::hp::FECollection<dim, spacedim>>(
+ FE_PyramidDGP<dim, spacedim>(1)));
else
Assert(false, ExcNotImplemented());
}
-template <typename DoFHandlerType, int patch_dim, int patch_space_dim>
+template <int dim, int patch_dim, int spacedim, int patch_spacedim>
std::size_t
-DataOut_DoFData<DoFHandlerType, patch_dim, patch_space_dim>::
- memory_consumption() const
+DataOut_DoFData<dim, patch_dim, spacedim, patch_spacedim>::memory_consumption()
+ const
{
- return (DataOutInterface<patch_dim, patch_space_dim>::memory_consumption() +
+ return (DataOutInterface<patch_dim, patch_spacedim>::memory_consumption() +
MemoryConsumption::memory_consumption(dofs) +
MemoryConsumption::memory_consumption(patches));
}
*
* @ingroup output
*/
-template <int dim, typename DoFHandlerType = DoFHandler<dim>>
-class DataOutFaces : public DataOut_DoFData<DoFHandlerType,
- DoFHandlerType::dimension - 1,
- DoFHandlerType::dimension>
+template <int dim, int spacedim = dim>
+class DataOutFaces : public DataOut_DoFData<dim, dim - 1, spacedim, dim>
{
public:
- /**
- * An abbreviation for the dimension of the DoFHandler object we work with.
- * Faces are then <code>dimension-1</code> dimensional objects.
- */
- static const unsigned int dimension = DoFHandlerType::dimension;
-
- /**
- * An abbreviation for the spatial dimension within which the triangulation
- * and DoFHandler are embedded in.
- */
- static const unsigned int space_dimension = DoFHandlerType::space_dimension;
-
/**
* Alias to the iterator type of the dof handler class under
* consideration.
*/
- using cell_iterator = typename DataOut_DoFData<DoFHandlerType,
- dimension - 1,
- dimension>::cell_iterator;
+ using cell_iterator =
+ typename DataOut_DoFData<dim, dim - 1, spacedim, dim>::cell_iterator;
/**
* Constructor determining whether a surface mesh (default) or the whole
* hp::MappingCollection in case of a DoFHandler with hp-capabilities.
*/
virtual void
- build_patches(const Mapping<dimension> &mapping,
- const unsigned int n_subdivisions = 0);
+ build_patches(const Mapping<dim> &mapping,
+ const unsigned int n_subdivisions = 0);
/**
* Declare a way to describe a face which we would like to generate output
*/
void
build_one_patch(
- const FaceDescriptor *cell_and_face,
- internal::DataOutFacesImplementation::ParallelData<dimension, dimension>
- & data,
- DataOutBase::Patch<dimension - 1, space_dimension> &patch);
+ const FaceDescriptor * cell_and_face,
+ internal::DataOutFacesImplementation::ParallelData<dim, dim> &data,
+ DataOutBase::Patch<dim - 1, spacedim> & patch);
};
namespace Legacy
*/
template <int dim, typename DoFHandlerType = DoFHandler<dim>>
using DataOutFaces DEAL_II_DEPRECATED =
- dealii::DataOutFaces<dim, DoFHandlerType>;
+ dealii::DataOutFaces<dim, DoFHandlerType::space_dimension>;
} // namespace Legacy
*
* @ingroup output
*/
-template <int dim, typename DoFHandlerType = DoFHandler<dim>>
-class DataOutRotation
- : public DataOut_DoFData<DoFHandlerType, DoFHandlerType::dimension + 1>
+template <int dim, int spacedim = dim>
+class DataOutRotation : public DataOut_DoFData<dim, dim + 1, spacedim, dim + 1>
{
public:
- /**
- * An abbreviation for the dimension of the DoFHandler object we work with.
- * Faces are then <code>dimension-1</code> dimensional objects.
- */
- static const unsigned int dimension = DoFHandlerType::dimension;
-
- /**
- * An abbreviation for the spatial dimension within which the triangulation
- * and DoFHandler are embedded in.
- */
- static const unsigned int space_dimension = DoFHandlerType::space_dimension;
-
/**
* Typedef to the iterator type of the dof handler class under
* consideration.
*/
using cell_iterator =
- typename DataOut_DoFData<DoFHandlerType, dimension + 1>::cell_iterator;
+ typename DataOut_DoFData<dim, dim + 1, spacedim, dim + 1>::cell_iterator;
/**
* This is the central function of this class since it builds the list of
*/
void
build_one_patch(
- const cell_iterator *cell,
- internal::DataOutRotationImplementation::ParallelData<dimension,
- space_dimension>
- &data,
- std::vector<DataOutBase::Patch<dimension + 1, space_dimension + 1>>
- &my_patches);
+ const cell_iterator * cell,
+ internal::DataOutRotationImplementation::ParallelData<dim, spacedim> &data,
+ std::vector<DataOutBase::Patch<dim + 1, spacedim + 1>> &my_patches);
};
namespace Legacy
*/
template <int dim, typename DoFHandlerType = DoFHandler<dim>>
using DataOutRotation DEAL_II_DEPRECATED =
- dealii::DataOutRotation<dim, DoFHandlerType>;
+ dealii::DataOutRotation<dim, DoFHandlerType::space_dimension>;
} // namespace Legacy
* for example, evaluating the solution at the origin (here using a parallel
* TrilinosWrappers vector to hold the solution):
* @code
- * Functions::FEFieldFunction<dim,DoFHandler<dim>,TrilinosWrappers::MPI::Vector>
+ * Functions::FEFieldFunction<dim,TrilinosWrappers::MPI::Vector>
* solution_function (dof_handler, solution);
* Point<dim> origin = Point<dim>();
*
*
* @ingroup functions
*/
- template <int dim,
- typename DoFHandlerType = DoFHandler<dim>,
- typename VectorType = Vector<double>>
+ template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
class FEFieldFunction : public Function<dim, typename VectorType::value_type>
{
public:
* lay. Otherwise the standard Q1 mapping is used.
*/
FEFieldFunction(
- const DoFHandlerType &dh,
- const VectorType & data_vector,
- const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
+ const DoFHandler<dim, spacedim> &dh,
+ const VectorType & data_vector,
+ const Mapping<dim> & mapping = StaticMappingQ1<dim>::mapping);
/**
* Set the current cell. If you know in advance where your points lie, you
*/
void
set_active_cell(
- const typename DoFHandlerType::active_cell_iterator &newcell);
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &newcell);
/**
* Get one vector value at the given point. It is inefficient to use
*/
unsigned int
compute_point_locations(
- const std::vector<Point<dim>> & points,
- std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
- std::vector<std::vector<Point<dim>>> & qpoints,
- std::vector<std::vector<unsigned int>> & maps) const;
+ const std::vector<Point<dim>> &points,
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+ & cells,
+ std::vector<std::vector<Point<dim>>> & qpoints,
+ std::vector<std::vector<unsigned int>> &maps) const;
private:
/**
* Typedef holding the local cell_hint.
*/
using cell_hint_t = Threads::ThreadLocalStorage<
- typename DoFHandlerType::active_cell_iterator>;
+ typename DoFHandler<dim, spacedim>::active_cell_iterator>;
/**
* Pointer to the dof handler.
*/
- SmartPointer<const DoFHandlerType,
- FEFieldFunction<dim, DoFHandlerType, VectorType>>
+ SmartPointer<const DoFHandler<dim, spacedim>,
+ FEFieldFunction<dim, VectorType, spacedim>>
dh;
/**
/**
* The Cache object
*/
- GridTools::Cache<dim, DoFHandlerType::space_dimension> cache;
+ GridTools::Cache<dim, spacedim> cache;
/**
* The latest cell hint.
*/
std_cxx17::optional<Point<dim>>
get_reference_coordinates(
- const typename DoFHandlerType::active_cell_iterator &cell,
- const Point<dim> & point) const;
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
+ const Point<dim> &point) const;
};
} // namespace Functions
template <int dim,
typename DoFHandlerType = DoFHandler<dim>,
typename VectorType = Vector<double>>
- using FEFieldFunction DEAL_II_DEPRECATED =
- dealii::Functions::FEFieldFunction<dim, DoFHandlerType, VectorType>;
+ using FEFieldFunction DEAL_II_DEPRECATED = dealii::Functions::
+ FEFieldFunction<dim, VectorType, DoFHandlerType::space_dimension>;
} // namespace Functions
} // namespace Legacy
namespace Functions
{
- template <int dim, typename DoFHandlerType, typename VectorType>
- FEFieldFunction<dim, DoFHandlerType, VectorType>::FEFieldFunction(
- const DoFHandlerType &mydh,
- const VectorType & myv,
- const Mapping<dim> & mymapping)
+ template <int dim, typename VectorType, int spacedim>
+ FEFieldFunction<dim, VectorType, spacedim>::FEFieldFunction(
+ const DoFHandler<dim, spacedim> &mydh,
+ const VectorType & myv,
+ const Mapping<dim> & mymapping)
: Function<dim, typename VectorType::value_type>(
mydh.get_fe(0).n_components())
, dh(&mydh, "FEFieldFunction")
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::set_active_cell(
- const typename DoFHandlerType::active_cell_iterator &newcell)
+ FEFieldFunction<dim, VectorType, spacedim>::set_active_cell(
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &newcell)
{
cell_hint.get() = newcell;
}
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_value(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_value(
const Point<dim> & p,
Vector<typename VectorType::value_type> &values) const
{
Assert(values.size() == this->n_components,
ExcDimensionMismatch(values.size(), this->n_components));
- typename DoFHandlerType::active_cell_iterator cell = cell_hint.get();
+ typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+ cell_hint.get();
if (cell == dh->end())
cell = dh->begin_active();
std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
if (!qp)
{
- const std::pair<typename dealii::internal::
- ActiveCellIterator<dim, dim, DoFHandlerType>::type,
- Point<dim>>
+ const std::pair<
+ typename dealii::internal::
+ ActiveCellIterator<dim, dim, DoFHandler<dim, spacedim>>::type,
+ Point<dim>>
my_pair = GridTools::find_active_cell_around_point(mapping, *dh, p);
AssertThrow(my_pair.first.state() == IteratorState::valid &&
!my_pair.first->is_artificial(),
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
typename VectorType::value_type
- FEFieldFunction<dim, DoFHandlerType, VectorType>::value(
+ FEFieldFunction<dim, VectorType, spacedim>::value(
const Point<dim> & p,
const unsigned int comp) const
{
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_gradient(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_gradient(
const Point<dim> & p,
std::vector<Tensor<1, dim, typename VectorType::value_type>> &gradients)
const
using number = typename VectorType::value_type;
Assert(gradients.size() == this->n_components,
ExcDimensionMismatch(gradients.size(), this->n_components));
- typename DoFHandlerType::active_cell_iterator cell = cell_hint.get();
+ typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+ cell_hint.get();
if (cell == dh->end())
cell = dh->begin_active();
std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
if (!qp)
{
- const std::pair<typename dealii::internal::
- ActiveCellIterator<dim, dim, DoFHandlerType>::type,
- Point<dim>>
+ const std::pair<
+ typename dealii::internal::
+ ActiveCellIterator<dim, dim, DoFHandler<dim, spacedim>>::type,
+ Point<dim>>
my_pair = GridTools::find_active_cell_around_point(mapping, *dh, p);
AssertThrow(my_pair.first.state() == IteratorState::valid &&
!my_pair.first->is_artificial(),
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
Tensor<1, dim, typename VectorType::value_type>
- FEFieldFunction<dim, DoFHandlerType, VectorType>::gradient(
+ FEFieldFunction<dim, VectorType, spacedim>::gradient(
const Point<dim> & p,
const unsigned int comp) const
{
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_laplacian(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_laplacian(
const Point<dim> & p,
Vector<typename VectorType::value_type> &values) const
{
Assert(values.size() == this->n_components,
ExcDimensionMismatch(values.size(), this->n_components));
- typename DoFHandlerType::active_cell_iterator cell = cell_hint.get();
+ typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+ cell_hint.get();
if (cell == dh->end())
cell = dh->begin_active();
std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
if (!qp)
{
- const std::pair<typename dealii::internal::
- ActiveCellIterator<dim, dim, DoFHandlerType>::type,
- Point<dim>>
+ const std::pair<
+ typename dealii::internal::
+ ActiveCellIterator<dim, dim, DoFHandler<dim, spacedim>>::type,
+ Point<dim>>
my_pair = GridTools::find_active_cell_around_point(mapping, *dh, p);
AssertThrow(my_pair.first.state() == IteratorState::valid &&
!my_pair.first->is_artificial(),
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
typename VectorType::value_type
- FEFieldFunction<dim, DoFHandlerType, VectorType>::laplacian(
+ FEFieldFunction<dim, VectorType, spacedim>::laplacian(
const Point<dim> & p,
const unsigned int comp) const
{
// Now the list versions
// ==============================
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_value_list(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_value_list(
const std::vector<Point<dim>> & points,
std::vector<Vector<typename VectorType::value_type>> &values) const
{
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
- std::vector<typename DoFHandlerType::active_cell_iterator> cells;
- std::vector<std::vector<Point<dim>>> qpoints;
- std::vector<std::vector<unsigned int>> maps;
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator> cells;
+ std::vector<std::vector<Point<dim>>> qpoints;
+ std::vector<std::vector<unsigned int>> maps;
const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::value_list(
+ FEFieldFunction<dim, VectorType, spacedim>::value_list(
const std::vector<Point<dim>> & points,
std::vector<typename VectorType::value_type> &values,
const unsigned int component) const
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_gradient_list(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_gradient_list(
const std::vector<Point<dim>> &points,
std::vector<std::vector<Tensor<1, dim, typename VectorType::value_type>>>
&values) const
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
- std::vector<typename DoFHandlerType::active_cell_iterator> cells;
- std::vector<std::vector<Point<dim>>> qpoints;
- std::vector<std::vector<unsigned int>> maps;
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator> cells;
+ std::vector<std::vector<Point<dim>>> qpoints;
+ std::vector<std::vector<unsigned int>> maps;
const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::gradient_list(
+ FEFieldFunction<dim, VectorType, spacedim>::gradient_list(
const std::vector<Point<dim>> & points,
std::vector<Tensor<1, dim, typename VectorType::value_type>> &values,
const unsigned int component) const
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::vector_laplacian_list(
+ FEFieldFunction<dim, VectorType, spacedim>::vector_laplacian_list(
const std::vector<Point<dim>> & points,
std::vector<Vector<typename VectorType::value_type>> &values) const
{
Assert(points.size() == values.size(),
ExcDimensionMismatch(points.size(), values.size()));
- std::vector<typename DoFHandlerType::active_cell_iterator> cells;
- std::vector<std::vector<Point<dim>>> qpoints;
- std::vector<std::vector<unsigned int>> maps;
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator> cells;
+ std::vector<std::vector<Point<dim>>> qpoints;
+ std::vector<std::vector<unsigned int>> maps;
const unsigned int n_cells =
compute_point_locations(points, cells, qpoints, maps);
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
void
- FEFieldFunction<dim, DoFHandlerType, VectorType>::laplacian_list(
+ FEFieldFunction<dim, VectorType, spacedim>::laplacian_list(
const std::vector<Point<dim>> & points,
std::vector<typename VectorType::value_type> &values,
const unsigned int component) const
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
unsigned int
- FEFieldFunction<dim, DoFHandlerType, VectorType>::compute_point_locations(
- const std::vector<Point<dim>> & points,
- std::vector<typename DoFHandlerType::active_cell_iterator> &cells,
- std::vector<std::vector<Point<dim>>> & qpoints,
- std::vector<std::vector<unsigned int>> & maps) const
+ FEFieldFunction<dim, VectorType, spacedim>::compute_point_locations(
+ const std::vector<Point<dim>> &points,
+ std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
+ & cells,
+ std::vector<std::vector<Point<dim>>> & qpoints,
+ std::vector<std::vector<unsigned int>> &maps) const
{
// Calling the GridTools routine and preparing output
auto cell_qpoint_map =
cells.resize(tria_cells.size());
unsigned int i = 0;
for (const auto &c : tria_cells)
- cells[i++] = typename DoFHandlerType::cell_iterator(*c, dh);
+ cells[i++] = typename DoFHandler<dim, spacedim>::cell_iterator(*c, dh);
qpoints = std::get<1>(cell_qpoint_map);
maps = std::get<2>(cell_qpoint_map);
}
- template <int dim, typename DoFHandlerType, typename VectorType>
+ template <int dim, typename VectorType, int spacedim>
std_cxx17::optional<Point<dim>>
- FEFieldFunction<dim, DoFHandlerType, VectorType>::get_reference_coordinates(
- const typename DoFHandlerType::active_cell_iterator &cell,
- const Point<dim> & point) const
+ FEFieldFunction<dim, VectorType, spacedim>::get_reference_coordinates(
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
+ const Point<dim> & point) const
{
try
{
* <li> If the grid will only be refined (i.e. no cells are coarsened) then
* use @p SolutionTransfer as follows:
* @code
- * SolutionTransfer<dim, double> soltrans(*dof_handler);
+ * SolutionTransfer<dim, Vector<double> > soltrans(*dof_handler);
*
* // flag some cells for refinement, e.g.
* GridRefinement::refine_and_coarsen_fixed_fraction(*tria,
* soltrans.refine_interpolate(old_solution, solution);
* @endcode
*
- * Multiple calls to the function <code>interpolate (const Vector<number> &in,
- * Vector<number> &out)</code> are NOT allowed. Interpolating several
+ * Multiple calls to the function <code>interpolate (const VectorType &in,
+ * VectorType &out)</code> are NOT allowed. Interpolating several
* functions can be performed in one step by using <tt>void interpolate (const
- * vector<Vector<number> >&all_in, vector<Vector<number> >&all_out)
+ * vector<VectorType> &all_in, vector<VectorType> &all_out)
* const</tt>, and using the respective @p
* prepare_for_coarsening_and_refinement function taking several vectors as
* input before actually refining and coarsening the triangulation (see
* For deleting all stored data in @p SolutionTransfer and reinitializing it
* use the <tt>clear()</tt> function.
*
- * The template argument @p number denotes the data type of the vectors you
+ * The template argument @p VectorType denotes the type of data container you
* want to transfer.
*
*
* will not be coarsened need to be stored according to the solution transfer
* with pure refinement (cf there). All this is performed by
* <tt>prepare_for_coarsening_and_refinement(all_in)</tt> where the
- * <tt>vector<Vector<number> > all_in</tt> includes all discrete
+ * <tt>vector<VectorType> all_in</tt> includes all discrete
* functions to be interpolated onto the new grid.
*
* As we need two different kinds of pointers (<tt>vector<unsigned int> *</tt>
- * for the Dof indices and <tt>vector<Vector<number> > *</tt> for the
+ * for the Dof indices and <tt>vector<VectorType> *</tt> for the
* interpolated DoF values) we use the @p Pointerstruct that includes both of
* these pointers and the pointer for each cell points to these @p
* Pointerstructs. On each cell only one of the two different pointers is used
* at one time hence we could use a <tt>void * pointer</tt> as
* <tt>vector<unsigned int> *</tt> at one time and as
- * <tt>vector<Vector<number> > *</tt> at the other but using this @p
+ * <tt>vector<VectorType> *</tt> at the other but using this @p
* Pointerstruct in between makes the use of these pointers more safe and
* gives better possibility to expand their usage.
*
* according to the solution transfer while pure refinement. Additionally, on
* each cell that is coarsened (hence previously was a father cell), the
* values of the discrete functions in @p all_out are set to the stored local
- * interpolated values that are accessible due to the 'vector<Vector<number> >
+ * interpolated values that are accessible due to the 'vector<VectorType>
* *' pointer in @p Pointerstruct that is pointed to by the pointer of that
* cell. It is clear that <tt>interpolate(all_in, all_out)</tt> only can be
- * called with the <tt>vector<Vector<number> > all_in</tt> that previously was
+ * called with the <tt>vector<VectorType> all_in</tt> that previously was
* the parameter of the <tt>prepare_for_coarsening_and_refinement(all_in)</tt>
* function. Hence <tt>interpolate(all_in, all_out)</tt> can (in contrast to
* <tt>refine_interpolate(in, out)</tt>) only be called once.
*
* @ingroup numerics
*/
-template <int dim,
- typename VectorType = Vector<double>,
- typename DoFHandlerType = DoFHandler<dim>>
+template <int dim, typename VectorType = Vector<double>, int spacedim = dim>
class SolutionTransfer
{
-# ifndef DEAL_II_MSVC
- static_assert(dim == DoFHandlerType::dimension,
- "The dimension explicitly provided as a template "
- "argument, and the dimension of the DoFHandlerType "
- "template argument must match.");
-# endif
public:
/**
* Constructor, takes the current DoFHandler as argument.
*/
- SolutionTransfer(const DoFHandlerType &dof);
+ SolutionTransfer(const DoFHandler<dim, spacedim> &dof);
/**
* Destructor
/**
* Pointer to the degree of freedom handler to work with.
*/
- SmartPointer<const DoFHandlerType,
- SolutionTransfer<dim, VectorType, DoFHandlerType>>
+ SmartPointer<const DoFHandler<dim, spacedim>,
+ SolutionTransfer<dim, VectorType, spacedim>>
dof_handler;
/**
typename VectorType = Vector<double>,
typename DoFHandlerType = DoFHandler<dim>>
using SolutionTransfer DEAL_II_DEPRECATED =
- dealii::SolutionTransfer<dim, VectorType, DoFHandlerType>;
+ dealii::SolutionTransfer<dim, VectorType, DoFHandlerType::space_dimension>;
} // namespace Legacy
{
namespace distributed
{
- template <int dim, typename VectorType, typename DoFHandlerType>
- SolutionTransfer<dim, VectorType, DoFHandlerType>::SolutionTransfer(
- const DoFHandlerType &dof)
+ template <int dim, typename VectorType, int spacedim>
+ SolutionTransfer<dim, VectorType, spacedim>::SolutionTransfer(
+ const DoFHandler<dim, spacedim> &dof)
: dof_handler(&dof, typeid(*this).name())
, handle(numbers::invalid_unsigned_int)
{
Assert(
- (dynamic_cast<const parallel::DistributedTriangulationBase<
- dim,
- DoFHandlerType::space_dimension> *>(
+ (dynamic_cast<
+ const parallel::DistributedTriangulationBase<dim, spacedim> *>(
&dof_handler->get_triangulation()) != nullptr),
ExcMessage(
"parallel::distributed::SolutionTransfer requires a parallel::distributed::Triangulation object."));
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::
+ SolutionTransfer<dim, VectorType, spacedim>::
prepare_for_coarsening_and_refinement(
const std::vector<const VectorType *> &all_in)
{
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::register_data_attach()
+ SolutionTransfer<dim, VectorType, spacedim>::register_data_attach()
{
// TODO: casting away constness is bad
- auto *tria = (dynamic_cast<parallel::DistributedTriangulationBase<
- dim,
- DoFHandlerType::space_dimension> *>(
- const_cast<dealii::Triangulation<dim, DoFHandlerType::space_dimension>
- *>(&dof_handler->get_triangulation())));
+ parallel::DistributedTriangulationBase<dim, spacedim> *tria =
+ (dynamic_cast<parallel::DistributedTriangulationBase<dim, spacedim> *>(
+ const_cast<dealii::Triangulation<dim, spacedim> *>(
+ &dof_handler->get_triangulation())));
Assert(tria != nullptr, ExcInternalError());
handle = tria->register_data_attach(
[this](
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell_,
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- CellStatus status) { return this->pack_callback(cell_, status); },
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell_,
+ const typename Triangulation<dim, spacedim>::CellStatus status) {
+ return this->pack_callback(cell_, status);
+ },
/*returns_variable_size_data=*/dof_handler->has_hp_capabilities());
}
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::
+ SolutionTransfer<dim, VectorType, spacedim>::
prepare_for_coarsening_and_refinement(const VectorType &in)
{
std::vector<const VectorType *> all_in(1, &in);
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::
- prepare_for_serialization(const VectorType &in)
+ SolutionTransfer<dim, VectorType, spacedim>::prepare_for_serialization(
+ const VectorType &in)
{
std::vector<const VectorType *> all_in(1, &in);
prepare_for_serialization(all_in);
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::
- prepare_for_serialization(const std::vector<const VectorType *> &all_in)
+ SolutionTransfer<dim, VectorType, spacedim>::prepare_for_serialization(
+ const std::vector<const VectorType *> &all_in)
{
prepare_for_coarsening_and_refinement(all_in);
}
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::deserialize(
- VectorType &in)
+ SolutionTransfer<dim, VectorType, spacedim>::deserialize(VectorType &in)
{
std::vector<VectorType *> all_in(1, &in);
deserialize(all_in);
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::deserialize(
+ SolutionTransfer<dim, VectorType, spacedim>::deserialize(
std::vector<VectorType *> &all_in)
{
register_data_attach();
}
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate(
+ SolutionTransfer<dim, VectorType, spacedim>::interpolate(
std::vector<VectorType *> &all_out)
{
Assert(input_vectors.size() == all_out.size(),
ExcDimensionMismatch(all_out[i]->size(), dof_handler->n_dofs()));
// TODO: casting away constness is bad
- auto *tria = (dynamic_cast<parallel::DistributedTriangulationBase<
- dim,
- DoFHandlerType::space_dimension> *>(
- const_cast<dealii::Triangulation<dim, DoFHandlerType::space_dimension>
- *>(&dof_handler->get_triangulation())));
+ parallel::DistributedTriangulationBase<dim, spacedim> *tria =
+ (dynamic_cast<parallel::DistributedTriangulationBase<dim, spacedim> *>(
+ const_cast<dealii::Triangulation<dim, spacedim> *>(
+ &dof_handler->get_triangulation())));
Assert(tria != nullptr, ExcInternalError());
tria->notify_ready_to_unpack(
handle,
[this, &all_out](
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell_,
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- CellStatus status,
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell_,
+ const typename Triangulation<dim, spacedim>::CellStatus status,
const boost::iterator_range<std::vector<char>::const_iterator>
&data_range) {
this->unpack_callback(cell_, status, data_range, all_out);
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate(
- VectorType &out)
+ SolutionTransfer<dim, VectorType, spacedim>::interpolate(VectorType &out)
{
std::vector<VectorType *> all_out(1, &out);
interpolate(all_out);
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
std::vector<char>
- SolutionTransfer<dim, VectorType, DoFHandlerType>::pack_callback(
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell_,
- const typename Triangulation<dim,
- DoFHandlerType::space_dimension>::CellStatus
- status)
+ SolutionTransfer<dim, VectorType, spacedim>::pack_callback(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell_,
+ const typename Triangulation<dim, spacedim>::CellStatus status)
{
- typename DoFHandlerType::cell_iterator cell(*cell_, dof_handler);
+ typename DoFHandler<dim, spacedim>::cell_iterator cell(*cell_,
+ dof_handler);
// create buffer for each individual object
std::vector<::dealii::Vector<typename VectorType::value_type>> dof_values(
{
switch (status)
{
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_PERSIST:
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_REFINE:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_PERSIST:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_REFINE:
{
fe_index = cell->future_fe_index();
break;
}
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_COARSEN:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_COARSEN:
{
// In case of coarsening, we need to find a suitable FE index
// for the parent cell. We choose the 'least dominant fe'
# endif
fe_index = dealii::internal::hp::DoFHandlerImplementation::
- dominated_future_fe_on_children<
- dim,
- DoFHandlerType::space_dimension>(cell);
+ dominated_future_fe_on_children<dim, spacedim>(cell);
break;
}
- template <int dim, typename VectorType, typename DoFHandlerType>
+ template <int dim, typename VectorType, int spacedim>
void
- SolutionTransfer<dim, VectorType, DoFHandlerType>::unpack_callback(
- const typename Triangulation<dim, DoFHandlerType::space_dimension>::
- cell_iterator &cell_,
- const typename Triangulation<dim,
- DoFHandlerType::space_dimension>::CellStatus
- status,
+ SolutionTransfer<dim, VectorType, spacedim>::unpack_callback(
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell_,
+ const typename Triangulation<dim, spacedim>::CellStatus status,
const boost::iterator_range<std::vector<char>::const_iterator>
& data_range,
std::vector<VectorType *> &all_out)
{
- typename DoFHandlerType::cell_iterator cell(*cell_, dof_handler);
+ typename DoFHandler<dim, spacedim>::cell_iterator cell(*cell_,
+ dof_handler);
unsigned int fe_index = 0;
if (dof_handler->has_hp_capabilities())
{
switch (status)
{
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_PERSIST:
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_COARSEN:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_PERSIST:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_COARSEN:
{
fe_index = cell->active_fe_index();
break;
}
- case parallel::distributed::Triangulation<
- dim,
- DoFHandlerType::space_dimension>::CELL_REFINE:
+ case parallel::distributed::Triangulation<dim,
+ spacedim>::CELL_REFINE:
{
// After refinement, this particular cell is no longer active,
// and its children have inherited its FE index. However, to
-for (DoFHandler : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS;
- deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
namespace parallel
\{
namespace distributed
\{
#if deal_II_dimension <= deal_II_space_dimension
- template class SolutionTransfer<
- deal_II_dimension,
- ::dealii::Vector<double>,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ template class SolutionTransfer<deal_II_dimension,
+ ::dealii::Vector<double>,
+ deal_II_space_dimension>;
template class SolutionTransfer<
deal_II_dimension,
::dealii::LinearAlgebra::distributed::Vector<double>,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ deal_II_space_dimension>;
template class SolutionTransfer<
deal_II_dimension,
::dealii::LinearAlgebra::distributed::Vector<float>,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ deal_II_space_dimension>;
template class SolutionTransfer<
deal_II_dimension,
::dealii::LinearAlgebra::distributed::BlockVector<double>,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ deal_II_space_dimension>;
template class SolutionTransfer<
deal_II_dimension,
::dealii::LinearAlgebra::distributed::BlockVector<float>,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ deal_II_space_dimension>;
# ifdef DEAL_II_WITH_PETSC
- template class SolutionTransfer<
- deal_II_dimension,
- PETScWrappers::MPI::Vector,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
- template class SolutionTransfer<
- deal_II_dimension,
- PETScWrappers::MPI::BlockVector,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ template class SolutionTransfer<deal_II_dimension,
+ PETScWrappers::MPI::Vector,
+ deal_II_space_dimension>;
+ template class SolutionTransfer<deal_II_dimension,
+ PETScWrappers::MPI::BlockVector,
+ deal_II_space_dimension>;
# endif
# ifdef DEAL_II_WITH_TRILINOS
- template class SolutionTransfer<
- deal_II_dimension,
- TrilinosWrappers::MPI::Vector,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
- template class SolutionTransfer<
- deal_II_dimension,
- TrilinosWrappers::MPI::BlockVector,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ template class SolutionTransfer<deal_II_dimension,
+ TrilinosWrappers::MPI::Vector,
+ deal_II_space_dimension>;
+ template class SolutionTransfer<deal_II_dimension,
+ TrilinosWrappers::MPI::BlockVector,
+ deal_II_space_dimension>;
# endif
#endif
(filename_without_extension + ".pvtu");
std::ofstream pvtu_output(pvtu_filename.c_str());
- DataOut<dim, DoFHandler<dim, spacedim>> data_out;
+ DataOut<dim, spacedim> data_out;
data_out.attach_triangulation(*tr);
// We need a dummy vector with the names of the data values in the
-template <int dim, typename DoFHandlerType>
-DataOut<dim, DoFHandlerType>::DataOut()
+template <int dim, int spacedim>
+DataOut<dim, spacedim>::DataOut()
{
// For the moment, just call the existing virtual functions. This
// preserves backward compatibility. When these deprecated functions are
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::build_one_patch(
- const std::pair<cell_iterator, unsigned int> *cell_and_index,
- internal::DataOutImplementation::ParallelData<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
- & scratch_data,
- const unsigned int n_subdivisions,
+DataOut<dim, spacedim>::build_one_patch(
+ const std::pair<cell_iterator, unsigned int> * cell_and_index,
+ internal::DataOutImplementation::ParallelData<dim, spacedim> &scratch_data,
+ const unsigned int n_subdivisions,
const CurvedCellRegion curved_cell_region)
{
// first create the output object that we will write into
- ::dealii::DataOutBase::Patch<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
- patch;
+
+ ::dealii::DataOutBase::Patch<dim, spacedim> patch;
patch.n_subdivisions = n_subdivisions;
patch.reference_cell = cell_and_index->first->reference_cell();
// initialize FEValues
scratch_data.reinit_all_fe_values(this->dof_data, cell_and_index->first);
- const FEValuesBase<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
- &fe_patch_values = scratch_data.get_present_fe_values(0);
+ const FEValuesBase<dim, spacedim> &fe_patch_values =
+ scratch_data.get_present_fe_values(0);
// set the vertices of the patch. if the mapping does not preserve locations
// (e.g. MappingQEulerian), we need to compute the offset of the vertex for
else
patch.vertices[vertex] =
fe_patch_values.get_mapping().transform_unit_to_real_cell(
- cell_and_index->first,
- GeometryInfo<DoFHandlerType::dimension>::unit_cell_vertex(vertex));
+ cell_and_index->first, GeometryInfo<dim>::unit_cell_vertex(vertex));
const unsigned int n_q_points = fe_patch_values.n_quadrature_points;
// note: a cell is *always* at the boundary if dim<spacedim
if (curved_cell_region == curved_inner_cells ||
(curved_cell_region == curved_boundary &&
- (cell_and_index->first->at_boundary() ||
- (DoFHandlerType::dimension != DoFHandlerType::space_dimension))) ||
+ (cell_and_index->first->at_boundary() || (dim != spacedim))) ||
(cell_and_index->first->reference_cell() !=
ReferenceCells::get_hypercube<dim>()))
{
- Assert(patch.space_dim == DoFHandlerType::space_dimension,
- ExcInternalError());
+ Assert(patch.space_dim == spacedim, ExcInternalError());
// set the flag indicating that for this cell the points are
// explicitly given
// then resize the patch.data member in order to have enough memory for
// the quadrature points as well, and copy the quadrature points there
- const std::vector<Point<DoFHandlerType::space_dimension>> &q_points =
+ const std::vector<Point<spacedim>> &q_points =
fe_patch_values.get_quadrature_points();
- patch.data.reinit(scratch_data.n_datasets +
- DoFHandlerType::space_dimension,
- n_q_points);
- for (unsigned int i = 0; i < DoFHandlerType::space_dimension; ++i)
+ patch.data.reinit(scratch_data.n_datasets + spacedim, n_q_points);
+ for (unsigned int i = 0; i < spacedim; ++i)
for (unsigned int q = 0; q < n_q_points; ++q)
- patch.data(patch.data.size(0) - DoFHandlerType::space_dimension + i,
- q) = q_points[q][i];
+ patch.data(patch.data.size(0) - spacedim + i, q) = q_points[q][i];
}
else
{
unsigned int dataset_number = 0;
for (const auto &dataset : this->dof_data)
{
- const FEValuesBase<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
- &this_fe_patch_values =
- scratch_data.get_present_fe_values(dataset_number);
+ const FEValuesBase<dim, spacedim> &this_fe_patch_values =
+ scratch_data.get_present_fe_values(dataset_number);
const unsigned int n_components =
this_fe_patch_values.get_fe().n_components();
- const DataPostprocessor<DoFHandlerType::space_dimension>
- *postprocessor = dataset->postprocessor;
+ const DataPostprocessor<spacedim> *postprocessor =
+ dataset->postprocessor;
if (postprocessor != nullptr)
{
scratch_data.patch_values_scalar.evaluation_points =
this_fe_patch_values.get_quadrature_points();
- const typename DoFHandlerType::cell_iterator dh_cell(
- &cell_and_index->first->get_triangulation(),
- cell_and_index->first->level(),
- cell_and_index->first->index(),
- dataset->dof_handler);
+ const typename DoFHandler<dim, spacedim>::cell_iterator
+ dh_cell(&cell_and_index->first->get_triangulation(),
+ cell_and_index->first->level(),
+ cell_and_index->first->index(),
+ dataset->dof_handler);
scratch_data.patch_values_scalar.template set_cell<dim>(
dh_cell);
// Now do the exact same thing for the gradients
if (update_flags & update_gradients)
{
- std::vector<std::vector<
- Tensor<1, DoFHandlerType::space_dimension>>>
- tmp(
- scratch_data.patch_values_system
- .solution_gradients.size(),
- std::vector<
- Tensor<1, DoFHandlerType::space_dimension>>(
- n_components));
+ std::vector<std::vector<Tensor<1, spacedim>>> tmp(
+ scratch_data.patch_values_system
+ .solution_gradients.size(),
+ std::vector<Tensor<1, spacedim>>(n_components));
// First the real part
dataset->get_function_gradients(
// And finally the Hessians. Same scheme as above.
if (update_flags & update_hessians)
{
- std::vector<std::vector<
- Tensor<2, DoFHandlerType::space_dimension>>>
- tmp(
- scratch_data.patch_values_system
- .solution_gradients.size(),
- std::vector<
- Tensor<2, DoFHandlerType::space_dimension>>(
- n_components));
+ std::vector<std::vector<Tensor<2, spacedim>>> tmp(
+ scratch_data.patch_values_system
+ .solution_gradients.size(),
+ std::vector<Tensor<2, spacedim>>(n_components));
// First the real part
dataset->get_function_hessians(
scratch_data.patch_values_system.evaluation_points =
this_fe_patch_values.get_quadrature_points();
- const typename DoFHandlerType::cell_iterator dh_cell(
- &cell_and_index->first->get_triangulation(),
- cell_and_index->first->level(),
- cell_and_index->first->index(),
- dataset->dof_handler);
+ const typename DoFHandler<dim, spacedim>::cell_iterator
+ dh_cell(&cell_and_index->first->get_triangulation(),
+ cell_and_index->first->level(),
+ cell_and_index->first->index(),
+ dataset->dof_handler);
scratch_data.patch_values_system.template set_cell<dim>(
dh_cell);
component_is_part_of_vector:
{
// A vector component. Put the
- // DoFHandlerType::space_dimension
+ // spacedim
// components into the next set of
// contiguous rows
// ('destination+c'); then move 'component'
// (because we're going to put the imaginary
// part of the vector into the subsequent
// spacedim slots).
- const unsigned int size =
- DoFHandlerType::space_dimension;
+ const unsigned int size = spacedim;
for (unsigned int c = 0; c < size; ++c)
for (unsigned int q = 0; q < n_q_points;
++q)
{
// Same approach as for vectors above.
const unsigned int size =
- DoFHandlerType::space_dimension *
- DoFHandlerType::space_dimension;
+ spacedim * spacedim;
for (unsigned int c = 0; c < size; ++c)
for (unsigned int q = 0; q < n_q_points;
++q)
component_is_part_of_vector:
{
// A vector component. Put the
- // DoFHandlerType::space_dimension
+ // spacedim
// components into the set of contiguous
// rows that follow the real parts
// ('destination+spacedim+c').
- const unsigned int size =
- DoFHandlerType::space_dimension;
+ const unsigned int size = spacedim;
for (unsigned int c = 0; c < size; ++c)
for (unsigned int q = 0; q < n_q_points;
++q)
{
// Same as for vectors.
const unsigned int size =
- DoFHandlerType::space_dimension *
- DoFHandlerType::space_dimension;
+ spacedim * spacedim;
for (unsigned int c = 0; c < size; ++c)
for (unsigned int q = 0; q < n_q_points;
++q)
(*scratch_data.cell_to_patch_index_map)[neighbor->level()].size()) ||
((*scratch_data.cell_to_patch_index_map)[neighbor->level()]
[neighbor->index()] ==
- dealii::DataOutBase::Patch<DoFHandlerType::dimension>::no_neighbor))
+ dealii::DataOutBase::Patch<dim>::no_neighbor))
{
patch.neighbors[f] = numbers::invalid_unsigned_int;
continue;
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::build_patches(const unsigned int n_subdivisions)
+DataOut<dim, spacedim>::build_patches(const unsigned int n_subdivisions)
{
AssertDimension(this->triangulation->get_reference_cells().size(), 1);
- build_patches(
- this->triangulation->get_reference_cells()[0]
- .template get_default_linear_mapping<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>(),
- n_subdivisions,
- no_curved_cells);
+ build_patches(this->triangulation->get_reference_cells()[0]
+ .template get_default_linear_mapping<dim, spacedim>(),
+ n_subdivisions,
+ no_curved_cells);
}
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::build_patches(
- const Mapping<DoFHandlerType::dimension, DoFHandlerType::space_dimension>
- & mapping,
- const unsigned int n_subdivisions_,
- const CurvedCellRegion curved_region)
+DataOut<dim, spacedim>::build_patches(const Mapping<dim, spacedim> &mapping,
+ const unsigned int n_subdivisions_,
+ const CurvedCellRegion curved_region)
{
- hp::MappingCollection<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
- mapping_collection(mapping);
+ hp::MappingCollection<dim, spacedim> mapping_collection(mapping);
build_patches(mapping_collection, n_subdivisions_, curved_region);
}
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::build_patches(
- const hp::MappingCollection<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &mapping,
- const unsigned int n_subdivisions_,
- const CurvedCellRegion curved_region)
+DataOut<dim, spacedim>::build_patches(
+ const hp::MappingCollection<dim, spacedim> &mapping,
+ const unsigned int n_subdivisions_,
+ const CurvedCellRegion curved_region)
{
// Check consistency of redundant template parameter
- Assert(dim == DoFHandlerType::dimension,
- ExcDimensionMismatch(dim, DoFHandlerType::dimension));
+ Assert(dim == dim, ExcDimensionMismatch(dim, dim));
Assert(this->triangulation != nullptr,
Exceptions::DataOutImplementation::ExcNoTriangulationSelected());
std::max(max_index, static_cast<unsigned int>(cell->index()));
cell_to_patch_index_map[l].resize(
- max_index + 1,
- dealii::DataOutBase::Patch<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>::no_neighbor);
+ max_index + 1, dealii::DataOutBase::Patch<dim, spacedim>::no_neighbor);
}
// will be all_cells[patch_index] = pair(cell, active_index)
"The update of normal vectors may not be requested for evaluation of "
"data on cells via DataPostprocessor."));
- internal::DataOutImplementation::ParallelData<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>
- thread_data(n_datasets,
- n_subdivisions,
- n_postprocessor_outputs,
- mapping,
- this->get_fes(),
- update_flags,
- cell_to_patch_index_map);
+ internal::DataOutImplementation::ParallelData<dim, spacedim> thread_data(
+ n_datasets,
+ n_subdivisions,
+ n_postprocessor_outputs,
+ mapping,
+ this->get_fes(),
+ update_flags,
+ cell_to_patch_index_map);
auto worker = [this, n_subdivisions, curved_cell_region](
const std::pair<cell_iterator, unsigned int> *cell_and_index,
- internal::DataOutImplementation::ParallelData<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> &scratch_data,
+ internal::DataOutImplementation::ParallelData<dim, spacedim>
+ &scratch_data,
// this function doesn't actually need a copy data object --
// it just writes everything right into the output array
int) {
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::set_cell_selection(
+DataOut<dim, spacedim>::set_cell_selection(
const std::function<cell_iterator(const Triangulation<dim, spacedim> &)>
& first_cell,
const std::function<cell_iterator(const Triangulation<dim, spacedim> &,
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOut<dim, DoFHandlerType>::set_cell_selection(
+DataOut<dim, spacedim>::set_cell_selection(
const FilteredIterator<cell_iterator> &filtered_iterator)
{
const auto first_cell =
-template <int dim, typename DoFHandlerType>
-const std::pair<typename DataOut<dim, DoFHandlerType>::FirstCellFunctionType,
- typename DataOut<dim, DoFHandlerType>::NextCellFunctionType>
-DataOut<dim, DoFHandlerType>::get_cell_selection() const
+template <int dim, int spacedim>
+const std::pair<typename DataOut<dim, spacedim>::FirstCellFunctionType,
+ typename DataOut<dim, spacedim>::NextCellFunctionType>
+DataOut<dim, spacedim>::get_cell_selection() const
{
return std::make_pair(first_cell_function, next_cell_function);
}
-template <int dim, typename DoFHandlerType>
-typename DataOut<dim, DoFHandlerType>::cell_iterator
-DataOut<dim, DoFHandlerType>::first_cell()
+template <int dim, int spacedim>
+typename DataOut<dim, spacedim>::cell_iterator
+DataOut<dim, spacedim>::first_cell()
{
return this->triangulation->begin_active();
}
-template <int dim, typename DoFHandlerType>
-typename DataOut<dim, DoFHandlerType>::cell_iterator
-DataOut<dim, DoFHandlerType>::next_cell(
- const typename DataOut<dim, DoFHandlerType>::cell_iterator &cell)
+template <int dim, int spacedim>
+typename DataOut<dim, spacedim>::cell_iterator
+DataOut<dim, spacedim>::next_cell(
+ const typename DataOut<dim, spacedim>::cell_iterator &cell)
{
// convert the iterator to an active_iterator and advance this to the next
// active cell
- typename Triangulation<DoFHandlerType::dimension,
- DoFHandlerType::space_dimension>::active_cell_iterator
- active_cell = cell;
+ typename Triangulation<dim, spacedim>::active_cell_iterator active_cell =
+ cell;
++active_cell;
return active_cell;
}
-template <int dim, typename DoFHandlerType>
-typename DataOut<dim, DoFHandlerType>::cell_iterator
-DataOut<dim, DoFHandlerType>::first_locally_owned_cell()
+template <int dim, int spacedim>
+typename DataOut<dim, spacedim>::cell_iterator
+DataOut<dim, spacedim>::first_locally_owned_cell()
{
- typename DataOut<dim, DoFHandlerType>::cell_iterator cell = first_cell();
+ typename DataOut<dim, spacedim>::cell_iterator cell = first_cell();
// skip cells if the current one has no children (is active) and is a ghost
// or artificial cell
-template <int dim, typename DoFHandlerType>
-typename DataOut<dim, DoFHandlerType>::cell_iterator
-DataOut<dim, DoFHandlerType>::next_locally_owned_cell(
- const typename DataOut<dim, DoFHandlerType>::cell_iterator &old_cell)
+template <int dim, int spacedim>
+typename DataOut<dim, spacedim>::cell_iterator
+DataOut<dim, spacedim>::next_locally_owned_cell(
+ const typename DataOut<dim, spacedim>::cell_iterator &old_cell)
{
- typename DataOut<dim, DoFHandlerType>::cell_iterator cell =
- next_cell(old_cell);
+ typename DataOut<dim, spacedim>::cell_iterator cell = next_cell(old_cell);
while ((cell != this->triangulation->end()) && cell->is_active() &&
!cell->is_locally_owned())
cell = next_cell(cell);
}
-for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS)
{
- template class DataOut<deal_II_dimension, DH<deal_II_dimension>>;
+ template class DataOut<deal_II_dimension>;
#if deal_II_dimension < 3
- template class DataOut<deal_II_dimension,
- DH<deal_II_dimension, deal_II_dimension + 1>>;
+ template class DataOut<deal_II_dimension, deal_II_dimension + 1>;
#endif
#if deal_II_dimension == 3
- template class DataOut<1, DH<1, 3>>;
+ template class DataOut<1, 3>;
#endif
}
// ---------------------------------------------------------------------
-for (VEC : VECTOR_TYPES; DH : DOFHANDLER_TEMPLATES;
- deal_II_dimension : DIMENSIONS)
+for (VEC : VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
{
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension,
- deal_II_dimension>::
+ template void DataOut_DoFData<deal_II_dimension, deal_II_dimension>::
add_data_vector_internal<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> *,
+ const DoFHandler<deal_II_dimension> *,
const VEC &,
const std::vector<std::string> &,
const DataVectorType,
DataComponentInterpretation::DataComponentInterpretation> &,
const bool);
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension,
- deal_II_dimension>::
- add_data_vector<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> &,
- const VEC &,
- const DataPostprocessor<
- DH<deal_II_dimension, deal_II_dimension>::space_dimension> &);
+ template void
+ DataOut_DoFData<deal_II_dimension, deal_II_dimension>::add_data_vector<VEC>(
+ const DoFHandler<deal_II_dimension> &,
+ const VEC &,
+ const DataPostprocessor<DoFHandler<deal_II_dimension>::space_dimension>
+ &);
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension,
- deal_II_dimension>::
- add_mg_data_vector<VEC>(const DH<deal_II_dimension, deal_II_dimension> &,
+ template void DataOut_DoFData<deal_II_dimension, deal_II_dimension>::
+ add_mg_data_vector<VEC>(const DoFHandler<deal_II_dimension> &,
const MGLevelObject<VEC> &,
const std::string &);
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension,
- deal_II_dimension>::
- add_mg_data_vector<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> &,
- const MGLevelObject<VEC> &,
- const std::vector<std::string> &,
- const std::vector<
- DataComponentInterpretation::DataComponentInterpretation> &);
+ template void
+ DataOut_DoFData<deal_II_dimension, deal_II_dimension>::add_mg_data_vector<
+ VEC>(const DoFHandler<deal_II_dimension> &,
+ const MGLevelObject<VEC> &,
+ const std::vector<std::string> &,
+ const std::vector<
+ DataComponentInterpretation::DataComponentInterpretation> &);
// stuff needed for face data
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
+ template void DataOut_DoFData<deal_II_dimension,
deal_II_dimension - 1,
+ deal_II_dimension,
deal_II_dimension>::
add_data_vector_internal<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> *,
+ const DoFHandler<deal_II_dimension> *,
const VEC &,
const std::vector<std::string> &,
const DataVectorType,
DataComponentInterpretation::DataComponentInterpretation> &,
const bool);
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
+ template void DataOut_DoFData<deal_II_dimension,
deal_II_dimension - 1,
+ deal_II_dimension,
deal_II_dimension>::
add_data_vector<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
const VEC &,
- const DataPostprocessor<
- DH<deal_II_dimension, deal_II_dimension>::space_dimension> &);
+ const DataPostprocessor<DoFHandler<deal_II_dimension>::space_dimension>
+ &);
// things for DataOutRotation
#if deal_II_dimension < 3
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension + 1,
- deal_II_dimension + 1>::
+ template void DataOut_DoFData<deal_II_dimension, deal_II_dimension + 1>::
add_data_vector_internal<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> *,
+ const DoFHandler<deal_II_dimension> *,
const VEC &,
const std::vector<std::string> &,
const DataVectorType,
DataComponentInterpretation::DataComponentInterpretation> &,
const bool);
- template void DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension>,
- deal_II_dimension + 1,
- deal_II_dimension + 1>::
+ template void DataOut_DoFData<deal_II_dimension, deal_II_dimension + 1>::
add_data_vector<VEC>(
- const DH<deal_II_dimension, deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
const VEC &,
- const DataPostprocessor<
- DH<deal_II_dimension, deal_II_dimension>::space_dimension> &);
+ const DataPostprocessor<DoFHandler<deal_II_dimension>::space_dimension>
+ &);
#endif
}
-for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS)
{
- template class DataOut_DoFData<DH<deal_II_dimension>, deal_II_dimension>;
+ template class DataOut_DoFData<deal_II_dimension, deal_II_dimension>;
#if deal_II_dimension < 3
- template class DataOut_DoFData<DH<deal_II_dimension>,
- deal_II_dimension + 1>;
- template class DataOut_DoFData<DH<deal_II_dimension>,
+ template class DataOut_DoFData<deal_II_dimension, deal_II_dimension + 1>;
+ template class DataOut_DoFData<deal_II_dimension,
+ deal_II_dimension,
deal_II_dimension,
deal_II_dimension + 1>;
#endif
#if deal_II_dimension >= 2
- template class DataOut_DoFData<DH<deal_II_dimension>,
+ template class DataOut_DoFData<deal_II_dimension,
deal_II_dimension - 1,
+ deal_II_dimension,
deal_II_dimension>;
#endif
#if deal_II_dimension == 3
- template class DataOut_DoFData<DH<1>, 1, 3>;
+ template class DataOut_DoFData<1, 1, 1, 3>;
#endif
- }
-
-for (deal_II_dimension : DIMENSIONS)
- {
namespace internal
\{
namespace DataOutImplementation
// ---------------------------------------------------------------------
-for (VEC : REAL_VECTOR_TYPES; DH : DOFHANDLER_TEMPLATES;
- deal_II_dimension : DIMENSIONS;
+for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
deal_II_space_dimension : DIMENSIONS)
{
#if deal_II_dimension < deal_II_space_dimension
- template void
- DataOut_DoFData<DH<deal_II_dimension, deal_II_space_dimension>,
- deal_II_dimension,
- deal_II_space_dimension>::
+ template void DataOut_DoFData<deal_II_dimension,
+ deal_II_dimension,
+ deal_II_space_dimension,
+ deal_II_space_dimension>::
add_data_vector_internal<VEC>(
- const DH<deal_II_dimension, deal_II_space_dimension> *,
+ const DoFHandler<deal_II_dimension, deal_II_space_dimension> *,
const VEC &,
const std::vector<std::string> &,
const DataVectorType,
DataComponentInterpretation::DataComponentInterpretation> &,
const bool);
- template void
- DataOut_DoFData<DH<deal_II_dimension, deal_II_space_dimension>,
- deal_II_dimension,
- deal_II_space_dimension>::
+ template void DataOut_DoFData<deal_II_dimension,
+ deal_II_dimension,
+ deal_II_space_dimension,
+ deal_II_space_dimension>::
add_data_vector<VEC>(
const VEC &,
const DataPostprocessor<
- DH<deal_II_dimension, deal_II_space_dimension>::space_dimension> &);
+ DoFHandler<deal_II_dimension,
+ deal_II_space_dimension>::space_dimension> &);
- template void
- DataOut_DoFData<DH<deal_II_dimension, deal_II_space_dimension>,
- deal_II_dimension,
- deal_II_space_dimension>::
+ template void DataOut_DoFData<deal_II_dimension,
+ deal_II_dimension,
+ deal_II_space_dimension,
+ deal_II_space_dimension>::
add_data_vector<VEC>(
- const DH<deal_II_dimension, deal_II_space_dimension> &,
+ const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
const VEC &,
const DataPostprocessor<
- DH<deal_II_dimension, deal_II_space_dimension>::space_dimension> &);
+ DoFHandler<deal_II_dimension,
+ deal_II_space_dimension>::space_dimension> &);
#endif
}
-for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS)
{
#if deal_II_dimension < 3
- template class DataOut_DoFData<DH<deal_II_dimension, deal_II_dimension + 1>,
+ template class DataOut_DoFData<deal_II_dimension,
deal_II_dimension,
+ deal_II_dimension + 1,
deal_II_dimension + 1>;
#endif
#if deal_II_dimension == 3
- template class DataOut_DoFData<DH<1, 3>, 1, 3>;
+ template class DataOut_DoFData<1, 1, 3, 3>;
#endif
}
-template <int dim, typename DoFHandlerType>
-DataOutFaces<dim, DoFHandlerType>::DataOutFaces(const bool so)
+template <int dim, int spacedim>
+DataOutFaces<dim, spacedim>::DataOutFaces(const bool so)
: surface_only(so)
-{
- Assert(dim == DoFHandlerType::dimension, ExcNotImplemented());
-}
+{}
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOutFaces<dim, DoFHandlerType>::build_one_patch(
- const FaceDescriptor *cell_and_face,
- internal::DataOutFacesImplementation::ParallelData<dimension, dimension>
- & data,
- DataOutBase::Patch<dimension - 1, space_dimension> &patch)
+DataOutFaces<dim, spacedim>::build_one_patch(
+ const FaceDescriptor * cell_and_face,
+ internal::DataOutFacesImplementation::ParallelData<dim, dim> &data,
+ DataOutBase::Patch<dim - 1, spacedim> & patch)
{
Assert(cell_and_face->first->is_locally_owned(), ExcNotImplemented());
// to a unit cell vertex and then, finally, that to the mapped vertex. In
// most cases this complicated procedure will be the identity.
for (unsigned int vertex = 0;
- vertex < GeometryInfo<dimension - 1>::vertices_per_cell;
+ vertex < GeometryInfo<dim - 1>::vertices_per_cell;
++vertex)
patch.vertices[vertex] =
data.mapping_collection[0].transform_unit_to_real_cell(
cell_and_face->first,
- GeometryInfo<dimension>::unit_cell_vertex(
+ GeometryInfo<dim>::unit_cell_vertex(
GeometryInfo<dim>::face_to_cell_vertices(
cell_and_face->second,
vertex,
data.reinit_all_fe_values(this->dof_data,
cell_and_face->first,
cell_and_face->second);
- const FEValuesBase<dimension> &fe_patch_values =
- data.get_present_fe_values(0);
+ const FEValuesBase<dim> &fe_patch_values = data.get_present_fe_values(0);
const unsigned int n_q_points = fe_patch_values.n_quadrature_points;
// store the intermediate points
- Assert(patch.space_dim == dimension, ExcInternalError());
- const std::vector<Point<dimension>> &q_points =
+ Assert(patch.space_dim == dim, ExcInternalError());
+ const std::vector<Point<dim>> &q_points =
fe_patch_values.get_quadrature_points();
// resize the patch.data member in order to have enough memory for the
// quadrature points as well
- patch.data.reinit(data.n_datasets + dimension, patch.data.size(1));
+ patch.data.reinit(data.n_datasets + dim, patch.data.size(1));
// set the flag indicating that for this cell the points are explicitly
// given
patch.points_are_available = true;
// copy points to patch.data
- for (unsigned int i = 0; i < dimension; ++i)
+ for (unsigned int i = 0; i < dim; ++i)
for (unsigned int q = 0; q < n_q_points; ++q)
- patch.data(patch.data.size(0) - dimension + i, q) = q_points[q][i];
+ patch.data(patch.data.size(0) - dim + i, q) = q_points[q][i];
// counter for data records
unsigned int offset = 0;
// first fill dof_data
for (unsigned int dataset = 0; dataset < this->dof_data.size(); ++dataset)
{
- const FEValuesBase<dimension> &this_fe_patch_values =
+ const FEValuesBase<dim> &this_fe_patch_values =
data.get_present_fe_values(dataset);
const unsigned int n_components =
this_fe_patch_values.get_fe().n_components();
data.patch_values_scalar.normals =
this_fe_patch_values.get_normal_vectors();
- const typename DoFHandlerType::active_cell_iterator dh_cell(
- &cell_and_face->first->get_triangulation(),
- cell_and_face->first->level(),
- cell_and_face->first->index(),
- this->dof_data[dataset]->dof_handler);
- data.patch_values_scalar.template set_cell<DoFHandlerType>(
- dh_cell);
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator
+ dh_cell(&cell_and_face->first->get_triangulation(),
+ cell_and_face->first->level(),
+ cell_and_face->first->index(),
+ this->dof_data[dataset]->dof_handler);
+ data.patch_values_scalar.template set_cell<dim>(dh_cell);
postprocessor->evaluate_scalar_field(
data.patch_values_scalar,
data.patch_values_system.normals =
this_fe_patch_values.get_normal_vectors();
- const typename DoFHandlerType::active_cell_iterator dh_cell(
- &cell_and_face->first->get_triangulation(),
- cell_and_face->first->level(),
- cell_and_face->first->index(),
- this->dof_data[dataset]->dof_handler);
- data.patch_values_system.template set_cell<DoFHandlerType>(
- dh_cell);
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator
+ dh_cell(&cell_and_face->first->get_triangulation(),
+ cell_and_face->first->level(),
+ cell_and_face->first->index(),
+ this->dof_data[dataset]->dof_handler);
+ data.patch_values_system.template set_cell<dim>(dh_cell);
postprocessor->evaluate_vector_field(
data.patch_values_system,
"The current function is trying to generate cell-data output "
"for a face that does not belong to an active cell. This is "
"not supported."));
- const unsigned int cell_number =
- std::distance(this->triangulation->begin_active(),
- typename Triangulation<dimension, space_dimension>::
- active_cell_iterator(cell_and_face->first));
+ const unsigned int cell_number = std::distance(
+ this->triangulation->begin_active(),
+ typename Triangulation<dim, spacedim>::active_cell_iterator(
+ cell_and_face->first));
const double value = this->cell_data[dataset]->get_cell_data_value(
cell_number,
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOutFaces<dim, DoFHandlerType>::build_patches(
- const unsigned int n_subdivisions_)
+DataOutFaces<dim, spacedim>::build_patches(const unsigned int n_subdivisions_)
{
- build_patches(StaticMappingQ1<dimension>::mapping, n_subdivisions_);
+ build_patches(StaticMappingQ1<dim>::mapping, n_subdivisions_);
}
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOutFaces<dim, DoFHandlerType>::build_patches(
- const Mapping<dimension> &mapping,
- const unsigned int n_subdivisions_)
+DataOutFaces<dim, spacedim>::build_patches(const Mapping<dim> &mapping,
+ const unsigned int n_subdivisions_)
{
- // Check consistency of redundant template parameter
- Assert(dim == dimension, ExcDimensionMismatch(dim, dimension));
-
const unsigned int n_subdivisions =
(n_subdivisions_ != 0) ? n_subdivisions_ : this->default_subdivisions;
this->dof_data[i]->postprocessor->get_needed_update_flags();
update_flags |= update_quadrature_points;
- internal::DataOutFacesImplementation::ParallelData<dimension, space_dimension>
- thread_data(n_datasets,
- n_subdivisions,
- n_postprocessor_outputs,
- mapping,
- this->get_fes(),
- update_flags);
- DataOutBase::Patch<dimension - 1, space_dimension> sample_patch;
+ internal::DataOutFacesImplementation::ParallelData<dim, spacedim> thread_data(
+ n_datasets,
+ n_subdivisions,
+ n_postprocessor_outputs,
+ mapping,
+ this->get_fes(),
+ update_flags);
+ DataOutBase::Patch<dim - 1, spacedim> sample_patch;
sample_patch.n_subdivisions = n_subdivisions;
- sample_patch.data.reinit(
- n_datasets, Utilities::fixed_power<dimension - 1>(n_subdivisions + 1));
+ sample_patch.data.reinit(n_datasets,
+ Utilities::fixed_power<dim - 1>(n_subdivisions + 1));
// now build the patches in parallel
WorkStream::run(
all_faces.data(),
all_faces.data() + all_faces.size(),
[this](const FaceDescriptor *cell_and_face,
- internal::DataOutFacesImplementation::ParallelData<dimension,
- dimension> &data,
- DataOutBase::Patch<dimension - 1, space_dimension> &patch) {
+ internal::DataOutFacesImplementation::ParallelData<dim, dim> &data,
+ DataOutBase::Patch<dim - 1, spacedim> &patch) {
this->build_one_patch(cell_and_face, data, patch);
},
- [this](const DataOutBase::Patch<dim - 1, space_dimension> &patch) {
- internal::DataOutFacesImplementation::
- append_patch_to_list<dim, space_dimension>(patch, this->patches);
+ [this](const DataOutBase::Patch<dim - 1, spacedim> &patch) {
+ internal::DataOutFacesImplementation::append_patch_to_list<dim, spacedim>(
+ patch, this->patches);
},
thread_data,
sample_patch);
-template <int dim, typename DoFHandlerType>
-typename DataOutFaces<dim, DoFHandlerType>::FaceDescriptor
-DataOutFaces<dim, DoFHandlerType>::first_face()
+template <int dim, int spacedim>
+typename DataOutFaces<dim, spacedim>::FaceDescriptor
+DataOutFaces<dim, spacedim>::first_face()
{
// simply find first active cell with a face on the boundary
- typename Triangulation<dimension, space_dimension>::active_cell_iterator
- cell = this->triangulation->begin_active();
- for (; cell != this->triangulation->end(); ++cell)
+ for (const auto &cell : this->triangulation->active_cell_iterators())
if (cell->is_locally_owned())
- for (const unsigned int f : GeometryInfo<dimension>::face_indices())
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!surface_only || cell->face(f)->at_boundary())
return FaceDescriptor(cell, f);
-template <int dim, typename DoFHandlerType>
-typename DataOutFaces<dim, DoFHandlerType>::FaceDescriptor
-DataOutFaces<dim, DoFHandlerType>::next_face(const FaceDescriptor &old_face)
+template <int dim, int spacedim>
+typename DataOutFaces<dim, spacedim>::FaceDescriptor
+DataOutFaces<dim, spacedim>::next_face(const FaceDescriptor &old_face)
{
FaceDescriptor face = old_face;
// first check whether the present cell has more faces on the boundary. since
// we started with this face, its cell must clearly be locally owned
Assert(face.first->is_locally_owned(), ExcInternalError());
- for (unsigned int f = face.second + 1;
- f < GeometryInfo<dimension>::faces_per_cell;
+ for (unsigned int f = face.second + 1; f < GeometryInfo<dim>::faces_per_cell;
++f)
if (!surface_only || face.first->face(f)->at_boundary())
// yup, that is so, so return it
// convert the iterator to an active_iterator and advance this to the next
// active cell
- typename Triangulation<dimension, space_dimension>::active_cell_iterator
- active_cell = face.first;
+ typename Triangulation<dim, spacedim>::active_cell_iterator active_cell =
+ face.first;
// increase face pointer by one
++active_cell;
// check all the faces of this active cell. but skip it altogether
// if it isn't locally owned
if (active_cell->is_locally_owned())
- for (const unsigned int f : GeometryInfo<dimension>::face_indices())
+ for (const unsigned int f : GeometryInfo<dim>::face_indices())
if (!surface_only || active_cell->face(f)->at_boundary())
{
face.first = active_cell;
{
// don't instantiate anything for the 1d
#if deal_II_dimension >= 2
- template class DataOutFaces<deal_II_dimension,
- DoFHandler<deal_II_dimension>>;
+ template class DataOutFaces<deal_II_dimension>;
#endif
}
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOutRotation<dim, DoFHandlerType>::build_one_patch(
- const cell_iterator * cell,
- internal::DataOutRotationImplementation::ParallelData<dimension,
- space_dimension> &data,
- std::vector<DataOutBase::Patch<dimension + 1, space_dimension + 1>>
- &my_patches)
+DataOutRotation<dim, spacedim>::build_one_patch(
+ const cell_iterator * cell,
+ internal::DataOutRotationImplementation::ParallelData<dim, spacedim> &data,
+ std::vector<DataOutBase::Patch<dim + 1, spacedim + 1>> &my_patches)
{
if (dim == 3)
{
// which we will put points in the whole domain (not the rotationally
// reduced one in which the computation took place. for simplicity add the
// initial direction at the end again
- std::vector<Point<dimension + 1>> angle_directions(n_patches_per_circle + 1);
+ std::vector<Point<dim + 1>> angle_directions(n_patches_per_circle + 1);
for (unsigned int i = 0; i <= n_patches_per_circle; ++i)
{
- angle_directions[i][dimension - 1] =
+ angle_directions[i][dim - 1] =
std::cos(2 * numbers::PI * i / n_patches_per_circle);
- angle_directions[i][dimension] =
+ angle_directions[i][dim] =
std::sin(2 * numbers::PI * i / n_patches_per_circle);
}
for (unsigned int angle = 0; angle < n_patches_per_circle; ++angle)
{
// first compute the vertices of the patch. note that they will have to
- // be computed from the vertices of the cell, which has one dimension
+ // be computed from the vertices of the cell, which has one dim
// less, however.
- switch (dimension)
+ switch (dim)
{
case 1:
{
case 2:
{
for (const unsigned int vertex :
- GeometryInfo<dimension>::vertex_indices())
+ GeometryInfo<dim>::vertex_indices())
{
- const Point<dimension> v = (*cell)->vertex(vertex);
+ const Point<dim> v = (*cell)->vertex(vertex);
// make sure that the radial variable is nonnegative
Assert(v(0) >= 0, ExcRadialVariableHasNegativeValues(v(0)));
my_patches[angle].vertices[vertex][0] = v(1);
my_patches[angle]
- .vertices[vertex +
- GeometryInfo<dimension>::vertices_per_cell] =
+ .vertices[vertex + GeometryInfo<dim>::vertices_per_cell] =
v(0) * angle_directions[angle + 1];
my_patches[angle]
- .vertices[vertex +
- GeometryInfo<dimension>::vertices_per_cell][0] =
- v(1);
+ .vertices[vertex + GeometryInfo<dim>::vertices_per_cell]
+ [0] = v(1);
}
break;
for (unsigned int dataset = 0; dataset < this->dof_data.size();
++dataset)
{
- const FEValuesBase<dimension> &fe_patch_values =
+ const FEValuesBase<dim> &fe_patch_values =
data.get_present_fe_values(dataset);
const unsigned int n_components =
fe_patch_values.get_fe().n_components();
data.patch_values_scalar.evaluation_points =
fe_patch_values.get_quadrature_points();
- const typename DoFHandlerType::active_cell_iterator
+ const typename DoFHandler<dim,
+ spacedim>::active_cell_iterator
dh_cell(&(*cell)->get_triangulation(),
(*cell)->level(),
(*cell)->index(),
this->dof_data[dataset]->dof_handler);
- data.patch_values_scalar
- .template set_cell<DoFHandlerType>(dh_cell);
+ data.patch_values_scalar.template set_cell<dim>(dh_cell);
postprocessor->evaluate_scalar_field(
data.patch_values_scalar,
data.patch_values_system.evaluation_points =
fe_patch_values.get_quadrature_points();
- const typename DoFHandlerType::active_cell_iterator
+ const typename DoFHandler<dim,
+ spacedim>::active_cell_iterator
dh_cell(&(*cell)->get_triangulation(),
(*cell)->level(),
(*cell)->index(),
this->dof_data[dataset]->dof_handler);
- data.patch_values_system
- .template set_cell<DoFHandlerType>(dh_cell);
+ data.patch_values_system.template set_cell<dim>(dh_cell);
postprocessor->evaluate_vector_field(
data.patch_values_system,
component < this->dof_data[dataset]->n_output_variables;
++component)
{
- switch (dimension)
+ switch (dim)
{
case 1:
for (unsigned int x = 0; x < n_points; ++x)
real_part,
data.patch_values_scalar.solution_values);
- switch (dimension)
+ switch (dim)
{
case 1:
for (unsigned int x = 0; x < n_points; ++x)
for (unsigned int component = 0; component < n_components;
++component)
{
- switch (dimension)
+ switch (dim)
{
case 1:
for (unsigned int x = 0; x < n_points; ++x)
ExcMessage("Cell must be active for cell data"));
const unsigned int cell_number = std::distance(
this->triangulation->begin_active(),
- typename Triangulation<dimension, space_dimension>::
- active_cell_iterator(*cell));
+ typename Triangulation<dim, spacedim>::active_cell_iterator(
+ *cell));
const double value =
this->cell_data[dataset]->get_cell_data_value(
cell_number,
internal::DataOutImplementation::ComponentExtractor::
real_part);
- switch (dimension)
+ switch (dim)
{
case 1:
for (unsigned int x = 0; x < n_points; ++x)
-template <int dim, typename DoFHandlerType>
+template <int dim, int spacedim>
void
-DataOutRotation<dim, DoFHandlerType>::build_patches(
+DataOutRotation<dim, spacedim>::build_patches(
const unsigned int n_patches_per_circle,
const unsigned int nnnn_subdivisions)
{
- // Check consistency of redundant
- // template parameter
- Assert(dim == dimension, ExcDimensionMismatch(dim, dimension));
Assert(this->triangulation != nullptr,
Exceptions::DataOutImplementation::ExcNoTriangulationSelected());
else
n_postprocessor_outputs[dataset] = 0;
- internal::DataOutRotationImplementation::ParallelData<dimension,
- space_dimension>
- thread_data(n_datasets,
+ internal::DataOutRotationImplementation::ParallelData<dim, spacedim>
+ thread_data(n_datasets,
n_subdivisions,
n_patches_per_circle,
n_postprocessor_outputs,
- StaticMappingQ1<dimension, space_dimension>::mapping,
+ StaticMappingQ1<dim, spacedim>::mapping,
this->get_fes(),
update_flags);
- std::vector<DataOutBase::Patch<dimension + 1, space_dimension + 1>>
- new_patches(n_patches_per_circle);
+ std::vector<DataOutBase::Patch<dim + 1, spacedim + 1>> new_patches(
+ n_patches_per_circle);
for (unsigned int i = 0; i < new_patches.size(); ++i)
{
new_patches[i].n_subdivisions = n_subdivisions;
new_patches[i].data.reinit(
- n_datasets, Utilities::fixed_power<dimension + 1>(n_subdivisions + 1));
+ n_datasets, Utilities::fixed_power<dim + 1>(n_subdivisions + 1));
}
// now build the patches in parallel
all_cells.data(),
all_cells.data() + all_cells.size(),
[this](const cell_iterator *cell,
- internal::DataOutRotationImplementation::
- ParallelData<dimension, space_dimension> &data,
- std::vector<DataOutBase::Patch<dimension + 1, space_dimension + 1>>
- &my_patches) { this->build_one_patch(cell, data, my_patches); },
- [this](
- const std::vector<DataOutBase::Patch<dimension + 1, space_dimension + 1>>
- &new_patches) {
- internal::DataOutRotationImplementation::
- append_patch_to_list<dimension, space_dimension>(new_patches,
- this->patches);
+ internal::DataOutRotationImplementation::ParallelData<dim, spacedim>
+ & data,
+ std::vector<DataOutBase::Patch<dim + 1, spacedim + 1>> &my_patches) {
+ this->build_one_patch(cell, data, my_patches);
+ },
+ [this](const std::vector<DataOutBase::Patch<dim + 1, spacedim + 1>>
+ &new_patches) {
+ internal::DataOutRotationImplementation::append_patch_to_list<dim,
+ spacedim>(
+ new_patches, this->patches);
},
thread_data,
new_patches);
-template <int dim, typename DoFHandlerType>
-typename DataOutRotation<dim, DoFHandlerType>::cell_iterator
-DataOutRotation<dim, DoFHandlerType>::first_cell()
+template <int dim, int spacedim>
+typename DataOutRotation<dim, spacedim>::cell_iterator
+DataOutRotation<dim, spacedim>::first_cell()
{
return this->triangulation->begin_active();
}
-template <int dim, typename DoFHandlerType>
-typename DataOutRotation<dim, DoFHandlerType>::cell_iterator
-DataOutRotation<dim, DoFHandlerType>::next_cell(const cell_iterator &cell)
+template <int dim, int spacedim>
+typename DataOutRotation<dim, spacedim>::cell_iterator
+DataOutRotation<dim, spacedim>::next_cell(const cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
// this to the next active cell
- typename Triangulation<dimension, space_dimension>::active_cell_iterator
- active_cell = cell;
+ typename Triangulation<dim, spacedim>::active_cell_iterator active_cell =
+ cell;
++active_cell;
return active_cell;
}
for (deal_II_dimension : DIMENSIONS)
{
#if deal_II_dimension < 3
- template class DataOutRotation<deal_II_dimension,
- DoFHandler<deal_II_dimension>>;
+ template class DataOutRotation<deal_II_dimension>;
#endif
}
-for (DoFHandler : DOFHANDLER_TEMPLATES; VECTOR : VECTOR_TYPES;
- deal_II_dimension : DIMENSIONS)
+for (VECTOR : VECTOR_TYPES; deal_II_dimension : DIMENSIONS)
{
namespace Functions
\{
- template class FEFieldFunction<deal_II_dimension,
- DoFHandler<deal_II_dimension>,
- VECTOR>;
+ template class FEFieldFunction<deal_II_dimension, VECTOR>;
\}
}
DEAL_II_NAMESPACE_OPEN
-template <int dim, typename VectorType, typename DoFHandlerType>
-SolutionTransfer<dim, VectorType, DoFHandlerType>::SolutionTransfer(
- const DoFHandlerType &dof)
+template <int dim, typename VectorType, int spacedim>
+SolutionTransfer<dim, VectorType, spacedim>::SolutionTransfer(
+ const DoFHandler<dim, spacedim> &dof)
: dof_handler(&dof, typeid(*this).name())
, n_dofs_old(0)
, prepared_for(none)
{
- Assert((dynamic_cast<const parallel::distributed::Triangulation<
- DoFHandlerType::dimension,
- DoFHandlerType::space_dimension> *>(
- &dof_handler->get_triangulation()) == nullptr),
- ExcMessage("You are calling the dealii::SolutionTransfer class "
- "with a DoF handler that is built on a "
- "parallel::distributed::Triangulation. This will not "
- "work for parallel computations. You probably want to "
- "use the parallel::distributed::SolutionTransfer class."));
+ Assert(
+ (dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *>(
+ &dof_handler->get_triangulation()) == nullptr),
+ ExcMessage("You are calling the dealii::SolutionTransfer class "
+ "with a DoFHandler that is built on a "
+ "parallel::distributed::Triangulation. This will not "
+ "work for parallel computations. You probably want to "
+ "use the parallel::distributed::SolutionTransfer class."));
}
-template <int dim, typename VectorType, typename DoFHandlerType>
-SolutionTransfer<dim, VectorType, DoFHandlerType>::~SolutionTransfer()
+template <int dim, typename VectorType, int spacedim>
+SolutionTransfer<dim, VectorType, spacedim>::~SolutionTransfer()
{
clear();
}
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::clear()
+SolutionTransfer<dim, VectorType, spacedim>::clear()
{
indices_on_cell.clear();
dof_values_on_cell.clear();
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::prepare_for_pure_refinement()
+SolutionTransfer<dim, VectorType, spacedim>::prepare_for_pure_refinement()
{
Assert(prepared_for != pure_refinement, ExcAlreadyPrepForRef());
Assert(prepared_for != coarsening_and_refinement,
// the current set of subdomain ids, set subdomain ids to the "true" owner of
// each cell upon construction of the TemporarilyRestoreSubdomainIds object,
// and later restore these flags when it is destroyed.
- const internal::parallel::shared::
- TemporarilyRestoreSubdomainIds<dim, DoFHandlerType::space_dimension>
- subdomain_modifier(dof_handler->get_triangulation());
+ const internal::parallel::shared::TemporarilyRestoreSubdomainIds<dim,
+ spacedim>
+ subdomain_modifier(dof_handler->get_triangulation());
const unsigned int n_active_cells =
dof_handler->get_triangulation().n_active_cells();
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::refine_interpolate(
+SolutionTransfer<dim, VectorType, spacedim>::refine_interpolate(
const VectorType &in,
VectorType & out) const
{
// the current set of subdomain ids, set subdomain ids to the "true" owner of
// each cell upon construction of the TemporarilyRestoreSubdomainIds object,
// and later restore these flags when it is destroyed.
- const internal::parallel::shared::
- TemporarilyRestoreSubdomainIds<dim, DoFHandlerType::space_dimension>
- subdomain_modifier(dof_handler->get_triangulation());
+ const internal::parallel::shared::TemporarilyRestoreSubdomainIds<dim,
+ spacedim>
+ subdomain_modifier(dof_handler->get_triangulation());
Vector<typename VectorType::value_type> local_values(0);
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::
+SolutionTransfer<dim, VectorType, spacedim>::
prepare_for_coarsening_and_refinement(const std::vector<VectorType> &all_in)
{
Assert(prepared_for != pure_refinement, ExcAlreadyPrepForRef());
// the current set of subdomain ids, set subdomain ids to the "true" owner of
// each cell upon construction of the TemporarilyRestoreSubdomainIds object,
// and later restore these flags when it is destroyed.
- const internal::parallel::shared::
- TemporarilyRestoreSubdomainIds<dim, DoFHandlerType::space_dimension>
- subdomain_modifier(dof_handler->get_triangulation());
+ const internal::parallel::shared::TemporarilyRestoreSubdomainIds<dim,
+ spacedim>
+ subdomain_modifier(dof_handler->get_triangulation());
// first count the number
// of cells that will be coarsened
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::
+SolutionTransfer<dim, VectorType, spacedim>::
prepare_for_coarsening_and_refinement(const VectorType &in)
{
std::vector<VectorType> all_in(1, in);
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate(
+SolutionTransfer<dim, VectorType, spacedim>::interpolate(
const std::vector<VectorType> &all_in,
std::vector<VectorType> & all_out) const
{
// the current set of subdomain ids, set subdomain ids to the "true" owner of
// each cell upon construction of the TemporarilyRestoreSubdomainIds object,
// and later restore these flags when it is destroyed.
- const internal::parallel::shared::
- TemporarilyRestoreSubdomainIds<dim, DoFHandlerType::space_dimension>
- subdomain_modifier(dof_handler->get_triangulation());
+ const internal::parallel::shared::TemporarilyRestoreSubdomainIds<dim,
+ spacedim>
+ subdomain_modifier(dof_handler->get_triangulation());
Vector<typename VectorType::value_type> local_values;
std::vector<types::global_dof_index> dofs;
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
void
-SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate(
- const VectorType &in,
- VectorType & out) const
+SolutionTransfer<dim, VectorType, spacedim>::interpolate(const VectorType &in,
+ VectorType &out) const
{
Assert(in.size() == n_dofs_old, ExcDimensionMismatch(in.size(), n_dofs_old));
Assert(out.size() == dof_handler->n_dofs(),
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
std::size_t
-SolutionTransfer<dim, VectorType, DoFHandlerType>::memory_consumption() const
+SolutionTransfer<dim, VectorType, spacedim>::memory_consumption() const
{
// at the moment we do not include the memory
// consumption of the cell_map as we have no
-template <int dim, typename VectorType, typename DoFHandlerType>
+template <int dim, typename VectorType, int spacedim>
std::size_t
-SolutionTransfer<dim, VectorType, DoFHandlerType>::Pointerstruct::
- memory_consumption() const
+SolutionTransfer<dim, VectorType, spacedim>::Pointerstruct::memory_consumption()
+ const
{
return sizeof(*this);
}
deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
- template class SolutionTransfer<
- deal_II_dimension,
- VEC,
- DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
- template class SolutionTransfer<
- deal_II_dimension,
- VEC,
- hp::DoFHandler<deal_II_dimension, deal_II_space_dimension>>;
+ template class SolutionTransfer<deal_II_dimension,
+ VEC,
+ deal_II_space_dimension>;
#endif
}