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 <string>
33#include <vector>
37#include <utils/Exceptions.h>
38#include <utils/MPITypes.h>
39#include <utils/MPIWrapper.h>
40#include <map>
41namespace dftefe
42{
43 namespace basis
44 {
46 {
49 };
57 template <unsigned int dim>
59 {
60 public:
78 std::shared_ptr<const atoms::AtomSphericalDataContainer>
79 atomSphericalDataContainer,
80 std::shared_ptr<const AtomIdsPartition<dim>> atomIdsPartition,
81 const std::vector<std::string> & atomSymbol,
82 const std::vector<utils::Point> & atomCoordinates,
83 const std::string fieldName,
84 const std::vector<double> & minbound,
85 const std::vector<double> & maxbound,
86 double additionalCutoff,
87 const std::vector<utils::Point> & globalDomainBoundVec,
88 const std::vector<bool> & isPeriodicFlags,
89 const std::vector<std::vector<utils::Point>> &cellVerticesVector,
90 const utils::mpi::MPIComm & comm);
91
96
97 std::vector<global_size_type>
99
100 std::vector<std::vector<global_size_type>>
102
103 std::pair<global_size_type, global_size_type>
105
106 std::vector<global_size_type>
107 ghostEnrichmentIds() const;
108
109 // Works with the global enrichmentid
110
112 getAtomId(const global_size_type enrichmentId) const;
113
114 std::vector<size_type>
116
117 std::vector<std::string>
119
121 getEnrichmentIdAttribute(const global_size_type enrichmentId) const;
122
124 nEnrichmentIds(const size_type atomId) const;
125
128
130 nLocalEnrichmentIds() const;
131
133 nTotalEnrichmentIds() const;
134
135 std::shared_ptr<const AtomIdsPartition<dim>>
136 getAtomIdsPartition() const;
137
138 void
140 const std::vector<std::vector<global_size_type>>
142
143 // std::map<size_type, size_type>
144 // enrichmentIdToNewAtomIdMap() const;
145
146 // std::map<size_type, size_type>
147 // enrichmentIdToQuantumIdMap() const;
148
152 private:
153 std::vector<global_size_type> d_newAtomIdToEnrichmentIdOffset;
154 std::vector<std::vector<global_size_type>>
156 std::vector<global_size_type> d_enrichmentIdsInProcessor;
157 std::pair<global_size_type, global_size_type> d_locallyOwnedEnrichmentIds;
158 std::vector<global_size_type> d_ghostEnrichmentIds;
159 std::unordered_map<global_size_type, size_type>
161 std::unordered_map<global_size_type, size_type>
163 std::vector<size_type> d_oldAtomIdsVec;
164 const std::shared_ptr<const AtomIdsPartition<dim>> d_atomIdsPartition;
165 const std::shared_ptr<const atoms::AtomSphericalDataContainer>
167 std::string d_fieldName;
168 const std::vector<std::string> &d_atomSymbol;
169
170 std::vector<size_type> d_atomIdsForLocalEnrichments;
171 std::vector<std::string> d_atomSymbolsForLocalEnrichments;
172
173 // std::vector<global_size_type> d_enrichmentIdsVec;
174 // std::vector<size_type> d_oldAtomIdsFromEnrichIdsVec;
175 // std::vector<size_type> d_quantumIdsFromEnrichIdsVec;
176
177 }; // end of class EnrichmentIdsPartition
178 } // end of namespace basis
179} // end of namespace dftefe
181#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:49
Class to get the gost and locally owned enrichment ids from the renumbered atom ids in Atom Partition...
Definition: EnrichmentIdsPartition.h:59
void modifyNumCellsOverlapWithEnrichments(const std::vector< std::vector< global_size_type > > &overlappingEnrichmentIdsInCells)
Definition: EnrichmentIdsPartition.t.cpp:581
std::vector< std::string > getAtomSymbolsForLocalEnrichments() const
Definition: EnrichmentIdsPartition.t.cpp:748
std::shared_ptr< const AtomIdsPartition< dim > > getAtomIdsPartition() const
Definition: EnrichmentIdsPartition.t.cpp:726
std::vector< global_size_type > d_enrichmentIdsInProcessor
Definition: EnrichmentIdsPartition.h:156
std::unordered_map< global_size_type, size_type > d_enrichmentIdToOldAtomIdMap
Definition: EnrichmentIdsPartition.h:160
size_type getAtomId(const global_size_type enrichmentId) const
Definition: EnrichmentIdsPartition.t.cpp:641
global_size_type nTotalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:719
std::pair< global_size_type, global_size_type > locallyOwnedEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:627
std::vector< size_type > d_atomIdsForLocalEnrichments
Definition: EnrichmentIdsPartition.h:170
size_type nLocallyOwnedEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:702
std::vector< size_type > getAtomIdsForLocalEnrichments() const
Definition: EnrichmentIdsPartition.t.cpp:741
const std::shared_ptr< const AtomIdsPartition< dim > > d_atomIdsPartition
Definition: EnrichmentIdsPartition.h:164
std::vector< size_type > d_oldAtomIdsVec
Definition: EnrichmentIdsPartition.h:163
std::vector< std::vector< global_size_type > > d_overlappingEnrichmentIdsInCells
Definition: EnrichmentIdsPartition.h:155
std::vector< global_size_type > ghostEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:634
EnrichmentIdAttribute getEnrichmentIdAttribute(const global_size_type enrichmentId) const
Definition: EnrichmentIdsPartition.t.cpp:662
const std::shared_ptr< const atoms::AtomSphericalDataContainer > d_atomSphericalDataContainer
Definition: EnrichmentIdsPartition.h:166
std::unordered_map< global_size_type, size_type > d_enrichmentIdToQuantumIdMap
Definition: EnrichmentIdsPartition.h:162
std::vector< global_size_type > newAtomIdToEnrichmentIdOffset() const
Definition: EnrichmentIdsPartition.t.cpp:613
std::vector< std::vector< global_size_type > > overlappingEnrichmentIdsInCells() const
Definition: EnrichmentIdsPartition.t.cpp:620
const std::vector< std::string > & d_atomSymbol
Definition: EnrichmentIdsPartition.h:168
size_type nLocalEnrichmentIds() const
Definition: EnrichmentIdsPartition.t.cpp:710
std::string d_fieldName
Definition: EnrichmentIdsPartition.h:167
~EnrichmentIdsPartition()=default
Destructor.
std::vector< std::string > d_atomSymbolsForLocalEnrichments
Definition: EnrichmentIdsPartition.h:171
std::vector< global_size_type > d_ghostEnrichmentIds
Definition: EnrichmentIdsPartition.h:158
std::vector< global_size_type > d_newAtomIdToEnrichmentIdOffset
Definition: EnrichmentIdsPartition.h:153
size_type nEnrichmentIds(const size_type atomId) const
Definition: EnrichmentIdsPartition.t.cpp:733
std::pair< global_size_type, global_size_type > d_locallyOwnedEnrichmentIds
Definition: EnrichmentIdsPartition.h:157
int MPIComm
Definition: MPITypes.h:83
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8
unsigned long int global_size_type
Definition: TypeConfig.h:9
Definition: EnrichmentIdsPartition.h:46
size_type atomId
Definition: EnrichmentIdsPartition.h:47
size_type localIdInAtom
Definition: EnrichmentIdsPartition.h:48