DFT-EFE
 
Loading...
Searching...
No Matches
EnrichmentIdsPartition.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 */
25
26#ifndef dftefeEnrichmentIdsPartition_h
27#define dftefeEnrichmentIdsPartition_h
28
29#include <utils/Point.h>
30#include <utils/TypeConfig.h>
31#include <set>
32#include <basis/Defaults.h>
33#include <string>
34#include <vector>
38#include <utils/Exceptions.h>
39#include <utils/MPITypes.h>
40#include <utils/MPIWrapper.h>
41#include <map>
42namespace dftefe
43{
44 namespace basis
45 {
47 {
50 };
58 template <size_type dim>
60 {
61 public:
79 std::shared_ptr<const atoms::AtomSphericalDataContainer>
80 atomSphericalDataContainer,
81 std::shared_ptr<const AtomIdsPartition<dim>> atomIdsPartition,
82 const std::vector<std::string> & atomSymbol,
83 const std::vector<utils::Point> & atomCoordinates,
84 const std::string fieldName,
85 const std::vector<double> & minbound,
86 const std::vector<double> & maxbound,
87 double additionalCutoff,
88 const std::vector<utils::Point> & globalDomainBoundVec,
89 const std::vector<bool> & isPeriodicFlags,
90 const std::vector<std::vector<utils::Point>> &cellVerticesVector,
91 const utils::mpi::MPIComm & comm);
92
97
98 std::vector<global_size_type>
100
101 std::vector<std::vector<global_size_type>>
103
104 std::pair<global_size_type, global_size_type>
106
107 std::vector<global_size_type>
108 ghostEnrichmentIds() const;
109
110 // Works with the global enrichmentid
111
113 getAtomId(const global_size_type enrichmentId) const;
114
115 std::vector<size_type>
117
118 std::vector<std::string>
120
122 getEnrichmentIdAttribute(const global_size_type enrichmentId) const;
123
125 nEnrichmentIds(const size_type atomId) const;
126
129
131 nTotalEnrichmentIds() const;
132
133 std::shared_ptr<const AtomIdsPartition<dim>>
134 getAtomIdsPartition() const;
135
136 void
138 const std::vector<std::vector<global_size_type>>
140
142 nLocalEnrichmentIds() const;
143
144 std::vector<size_type>
146
147 std::vector<size_type>
149
150 std::vector<global_size_type>
152
153 std::vector<size_type>
154 cellsInLocalEIdVec() const;
155
156 private:
157 std::vector<global_size_type> d_newAtomIdToEnrichmentIdOffset;
158 std::vector<std::vector<global_size_type>>
160 std::pair<global_size_type, global_size_type> d_locallyOwnedEnrichmentIds;
161 std::vector<global_size_type> d_ghostEnrichmentIds;
162 std::unordered_map<global_size_type, size_type>
164 std::unordered_map<global_size_type, size_type>
166 std::vector<size_type> d_oldAtomIdsVec;
167 const std::shared_ptr<const AtomIdsPartition<dim>> d_atomIdsPartition;
168 const std::shared_ptr<const atoms::AtomSphericalDataContainer>
170 std::string d_fieldName;
171 const std::vector<std::string> &d_atomSymbol;
172
173 std::vector<size_type> d_atomIdsForLocalEnrichments;
174 std::vector<std::string> d_atomSymbolsForLocalEnrichments;
175
177 std::vector<size_type> d_localToCellLocalEIdsVec;
178 std::vector<global_size_type> d_localToGlobalEnrichmentIds;
179 std::vector<size_type> d_cellsInLocalEIdVec;
180
181 }; // end of class EnrichmentIdsPartition
182 } // end of namespace basis
183} // end of namespace dftefe
185#endif // dftefeEnrichement_h
Class to get the renumbered Ids of the locally owned Atom ids returns the vector of no of atoms in ea...
Definition: AtomIdsPartition.h:50
Class to get the gost and locally owned enrichment ids from the renumbered atom ids in Atom Partition...
Definition: EnrichmentIdsPartition.h:60
std::vector< size_type > cellsInLocalEIdVec() const
Definition: EnrichmentIdsPartition.t.cpp:816
std::vector< size_type > d_cellsInLocalEIdVec
Definition: EnrichmentIdsPartition.h:179
void modifyNumCellsOverlapWithEnrichments(const std::vector< std::vector< global_size_type > > &overlappingEnrichmentIdsInCells)
Definition: EnrichmentIdsPartition.t.cpp:617
std::vector< size_type > d_overlappingCellsWithLocalEnrichmentIds
Definition: EnrichmentIdsPartition.h:176
std::vector< std::string > getAtomSymbolsForLocalEnrichments() const
Definition: EnrichmentIdsPartition.t.cpp:779
std::shared_ptr< const AtomIdsPartition< dim > > getAtomIdsPartition() const
Definition: EnrichmentIdsPartition.t.cpp:757
std::vector< size_type > localToCellLocalEIdsVec() const
Definition: EnrichmentIdsPartition.t.cpp:802
std::unordered_map< global_size_type, size_type > d_enrichmentIdToOldAtomIdMap
Definition: EnrichmentIdsPartition.h:163
std::vector< size_type > d_localToCellLocalEIdsVec
Definition: EnrichmentIdsPartition.h:177
size_type getAtomId(const global_size_type enrichmentId) const
Definition: EnrichmentIdsPartition.t.cpp:680
global_size_type nTotalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:750
std::pair< global_size_type, global_size_type > locallyOwnedEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:666
std::vector< size_type > d_atomIdsForLocalEnrichments
Definition: EnrichmentIdsPartition.h:173
size_type nLocallyOwnedEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:742
std::vector< size_type > getAtomIdsForLocalEnrichments() const
Definition: EnrichmentIdsPartition.t.cpp:772
const std::shared_ptr< const AtomIdsPartition< dim > > d_atomIdsPartition
Definition: EnrichmentIdsPartition.h:167
std::vector< size_type > d_oldAtomIdsVec
Definition: EnrichmentIdsPartition.h:166
std::vector< std::vector< global_size_type > > d_overlappingEnrichmentIdsInCells
Definition: EnrichmentIdsPartition.h:159
std::vector< global_size_type > ghostEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:673
EnrichmentIdAttribute getEnrichmentIdAttribute(const global_size_type enrichmentId) const
Definition: EnrichmentIdsPartition.t.cpp:702
const std::shared_ptr< const atoms::AtomSphericalDataContainer > d_atomSphericalDataContainer
Definition: EnrichmentIdsPartition.h:169
std::vector< global_size_type > d_localToGlobalEnrichmentIds
Definition: EnrichmentIdsPartition.h:178
std::unordered_map< global_size_type, size_type > d_enrichmentIdToQuantumIdMap
Definition: EnrichmentIdsPartition.h:165
std::vector< global_size_type > newAtomIdToEnrichmentIdOffset() const
Definition: EnrichmentIdsPartition.t.cpp:652
std::vector< std::vector< global_size_type > > overlappingEnrichmentIdsInCells() const
Definition: EnrichmentIdsPartition.t.cpp:659
const std::vector< std::string > & d_atomSymbol
Definition: EnrichmentIdsPartition.h:171
size_type nLocalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:786
std::string d_fieldName
Definition: EnrichmentIdsPartition.h:170
~EnrichmentIdsPartition()=default
Destructor.
std::vector< std::string > d_atomSymbolsForLocalEnrichments
Definition: EnrichmentIdsPartition.h:174
std::vector< size_type > overlappingCellsWithLocalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:795
std::vector< global_size_type > localToGlobalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:809
std::vector< global_size_type > d_ghostEnrichmentIds
Definition: EnrichmentIdsPartition.h:161
std::vector< global_size_type > d_newAtomIdToEnrichmentIdOffset
Definition: EnrichmentIdsPartition.h:157
size_type nEnrichmentIds(const size_type atomId) const
Definition: EnrichmentIdsPartition.t.cpp:764
std::pair< global_size_type, global_size_type > d_locallyOwnedEnrichmentIds
Definition: EnrichmentIdsPartition.h:160
int MPIComm
Definition: MPITypes.h:84
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9
std::uint64_t global_size_type
Definition: TypeConfig.h:10
Definition: EnrichmentIdsPartition.h:47
size_type atomId
Definition: EnrichmentIdsPartition.h:48
size_type localIdInAtom
Definition: EnrichmentIdsPartition.h:49