Loading...
Searching...
No Matches
pod_voloctree.hpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#ifndef __BITPIT_POD_VOLOCTREE_HPP__
26#define __BITPIT_POD_VOLOCTREE_HPP__
27
28#if BITPIT_ENABLE_MPI
29# include <mpi.h>
30#endif
31#include <string>
32#include <vector>
33#include <unordered_map>
34
35#include "pod_kernel.hpp"
36#include "bitpit_voloctree.hpp"
37
38namespace bitpit {
39
40class PODVolOctree: public PODKernel {
41
42 friend class POD;
43
44public:
45# if BITPIT_ENABLE_MPI
46 PODVolOctree(MPI_Comm comm = MPI_COMM_WORLD);
47# else
49# endif
50
51 ~PODVolOctree() override;
52
57 PODVolOctree(PODVolOctree&& other) = default;
58
59private:
60
61 std::unique_ptr<VolumeKernel> createMesh() override;
62
63 std::unique_ptr<VolumeMapper> _computeMapper(const VolumeKernel * mesh, bool fillInv) override;
64
66 void mapMeshSamePartition(bitpit::VolOctree * mesh, bitpit::PiercedStorage<bitpit::adaption::Info> & mapper);
67
68 pod::PODField mapPODFieldToPOD(const pod::PODField & field, const std::unordered_set<long> * targetCells) override;
69 void mapPODFieldFromPOD(pod::PODField & field, const std::unordered_set<long> * targetCells, const pod::PODField & mappedField) override;
70
71 PiercedStorage<double> mapFieldsToPOD(const PiercedStorage<double> & fields, const VolumeKernel * mesh, const std::unordered_set<long> * targetCells,
72 const std::vector<std::size_t> &scalarIds, const std::vector<std::array<std::size_t, 3>> &vectorIds) override;
73 void mapFieldsFromPOD(PiercedStorage<double> & fields, const VolumeKernel * mesh, const std::unordered_set<long> * targetCells,
74 const PiercedStorage<double> & mappedFields,
75 const std::vector<std::size_t> &scalarIds, const std::vector<std::array<std::size_t, 3>> &vectorIds) override;
76
77 PiercedStorage<bool> mapBoolFieldToPOD(const PiercedStorage<bool> & field, const VolumeKernel * mesh, const std::unordered_set<long> * targetCells) override;
78 void mapBoolFieldToPOD(const PiercedStorage<bool> & field, const VolumeKernel * mesh, const std::unordered_set<long> * targetCells, PiercedStorage<bool> & mappedField) override;
79
80 std::unordered_set<long> mapCellsToPOD(const std::unordered_set<long> * targetCells) override;
81
82 void adaptMeshToMesh(const VolumeKernel* meshToAdapt, const VolumeKernel * meshReference) override;
83
84# if BITPIT_ENABLE_MPI
85 void communicatePODField(const pod::PODField & field, std::map<int, std::map<long, bool> > & dataBrec, std::map<int, std::map<long, std::vector<double> > > & dataSrec, std::map<int, std::map<long, std::vector<std::array<double,3> > > > & dataVrec, std::map<int, std::map<long, double> > & volrec);
86 void communicatePODFieldFromPOD(const pod::PODField & field, std::map<int, std::map<long, bool> > & dataBrec, std::map<int, std::map<long, std::vector<double> > > & dataSrec, std::map<int, std::map<long, std::vector<std::array<double,3> > > > & dataVrec, std::map<int, std::map<long, double> > & volrec);
87 void communicateBoolField(const PiercedStorage<bool> & field, std::map<int, std::map<long, bool> > & dataBrec);
88 void communicateField(const PiercedStorage<double> & field, const VolumeKernel * mesh, std::map<int, std::map<long, std::vector<double> > > & datarec, std::map<int, std::map<long, double> > & volrec);
89 void communicateFieldFromPOD(const PiercedStorage<double> & field, const VolumeKernel * mesh, std::map<int, std::map<long, std::vector<double> > > & datarec, std::map<int, std::map<long, double> > & volrec);
90#endif
91
92};
93
94}
95#endif
The PODKernel class provides an interface to manage the mesh dependent members and functions of a POD...
The PODVolOctree is the specialized class of PODKernel for VolOctree meshes.
PODVolOctree(MPI_Comm comm=MPI_COMM_WORLD)
PODVolOctree(PODVolOctree &&other)=default
The POD (Proper Orthogonal Decomposition) class provides an interface for defining POD object.
Definition pod.hpp:41
Metafunction for generating a pierced storage.
The VolOctree defines a Octree patch.
Definition voloctree.hpp:37
The VolumeKernel class provides an interface for defining volume patches.
The PODfield structure is used to store the fields inside POD classes.
--- layout: doxygen_footer ---