dune-vtk 2.12
Loading...
Searching...
No Matches
derivedgridcreator.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
3#pragma once
4
5#include <cstdint>
6#include <string>
7#include <vector>
8
9#include <dune/grid/common/gridfactory.hh>
13
14namespace Dune::Vtk
15{
16 template <class GridCreator, class Derived>
18 : public GridCreatorInterface<typename GridCreator::Grid, Derived>
19 {
22 using Grid = typename GridCreator::Grid;
24
25 template <class... Args,
28 : Super(std::forward<Args>(args)...)
29 , gridCreator_(Super::factory())
30 {}
31
34 {
35 gridCreator_.insertVertices(points, point_ids);
36 }
37
39 std::vector<std::int64_t> const& offsets,
40 std::vector<std::int64_t> const& connectivity)
41 {
42 gridCreator_.insertElements(types, offsets, connectivity);
43 }
44
46 {
47 gridCreator_.insertPieces(pieces);
48 }
49
50 private:
51 GridCreator gridCreator_;
52 };
53
54} // end namespace Dune::Vtk
STL namespace.
Definition datacollector.hh:19
Implementation of DataCollector for cells, with continuous data.
Definition celltypedatacollector.hh:20
Base class for grid creators in a CRTP style.
Definition gridcreatorinterface.hh:25
GridFactory< Grid > & factory()
Return the associated GridFactory.
Definition gridcreatorinterface.hh:77
typename Grid::template Codim< 0 >::Entity::Geometry::GlobalCoordinate GlobalCoordinate
Definition gridcreatorinterface.hh:28
Definition derivedgridcreator.hh:19
typename Super::GlobalCoordinate GlobalCoordinate
Definition derivedgridcreator.hh:23
DerivedGridCreator(Args &&... args)
Definition derivedgridcreator.hh:27
void insertVerticesImpl(std::vector< GlobalCoordinate > const &points, std::vector< std::uint64_t > const &point_ids)
Definition derivedgridcreator.hh:32
void insertElementsImpl(std::vector< std::uint8_t > const &types, std::vector< std::int64_t > const &offsets, std::vector< std::int64_t > const &connectivity)
Definition derivedgridcreator.hh:38
typename GridCreator::Grid Grid
Definition derivedgridcreator.hh:22
void insertPiecesImpl(std::vector< std::string > const &pieces)
Definition derivedgridcreator.hh:45