dune-vtk 2.12
Loading...
Searching...
No Matches
parallelgridcreator.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>
10#include <dune/vtk/vtkreader.hh>
15
16namespace Dune::Vtk
17{
18 // create a distributed grid in parallel. Currently only supported by ALUGrid
19 template <class Grid>
21 : public DerivedGridCreator<ContinuousGridCreator<Grid>, ParallelGridCreator<Grid>>
22 {
27
28 // The GridFactory must support insertion of global vertex IDs
30
31 public:
32
33 using Super::Super;
34
37 {
38 assert(point_ids.size() == points.size());
39 for (std::size_t i = 0; i < points.size(); ++i)
40 this->factory().insertVertex(points[i], VertexId(point_ids[i]));
41 }
42
44 {
45 if (int(pieces.size()) == this->comm().size()) {
47 pieceReader.read(pieces[this->comm().rank()], true);
48 }
49 }
50 };
51
52 // deduction guides
53 template <class Grid>
56
57} // end namespace Dune::Vtk
Definition datacollector.hh:19
typename detected_or< nonesuch, Op, Args... >::value_t is_detected
virtual void insertVertex(const FieldVector< ctype, dimworld > &pos)
auto comm() const
Definition datacollectorinterface.hh:112
Implementation of DataCollector for cells, with continuous data.
Definition celltypedatacollector.hh:20
GridFactory< Grid > & factory()
Return the associated GridFactory.
Definition gridcreatorinterface.hh:77
auto comm() const
Return the mpi collective communicator.
Definition gridcreatorinterface.hh:89
Definition derivedgridcreator.hh:19
typename Super::GlobalCoordinate GlobalCoordinate
Definition derivedgridcreator.hh:23
GridCreatorInterface< typename GridCreator::Grid, Derived > Super
Definition derivedgridcreator.hh:21
Definition parallelgridcreator.hh:22
void insertPiecesImpl(std::vector< std::string > const &pieces)
Definition parallelgridcreator.hh:43
typename Super::GlobalCoordinate GlobalCoordinate
Definition parallelgridcreator.hh:25
void insertVerticesImpl(std::vector< GlobalCoordinate > const &points, std::vector< std::uint64_t > const &point_ids)
Definition parallelgridcreator.hh:35
VertexId_t< GridFactory< Grid > > VertexId
Definition parallelgridcreator.hh:26
T size(T... args)