DFT-EFE
 
Loading...
Searching...
No Matches
AtomSuperpositionFunction.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 dftefeAtomSuperpositionFunction_h
27#define dftefeAtomSuperpositionFunction_h
28
30#include <utils/TypeConfig.h>
31#include <utils/Point.h>
33#include <utils/MemoryStorage.h>
36#include <memory>
40
41namespace dftefe
42{
43 namespace atoms
44 {
46 {
48 Grad,
49 IdentitySq, // for the adaptive quadrature builfing
51 };
52
53 template <utils::MemorySpace memorySpace>
55 {
56 public:
58 std::shared_ptr<const AtomSphericalDataContainer>
59 atomSphericalDataContainer,
60 const std::vector<std::string> & atomSymbol,
61 const std::vector<utils::Point> & atomCoordinates,
62 const std::string fieldName,
63 linearAlgebra::LinAlgOpContext<memorySpace> *linAlgOpContext = nullptr);
64
65 void
66 evaluate(const size_type numPoints,
67 const AtomSuperpositionFuncType atomSupType,
68 const double * t,
69 double * q,
70 const double constant = 1.0) const
71 {
72#ifdef DFTEFE_WITH_DEVICE
73 if (memorySpace == utils::MemorySpace::DEVICE)
74 evalDevice(numPoints, atomSupType, constant, t, q);
75 else
76#endif
77 evalHost(numPoints, atomSupType, constant, t, q);
78 }
79
80 protected:
81 void
82 evalHost(size_type numPoints,
83 const AtomSuperpositionFuncType atomSupType,
84 const double constant,
85 const double * t,
86 double * q) const;
87
88#ifdef DFTEFE_WITH_DEVICE
89 void
90 evalDevice(size_type numPoints,
91 const AtomSuperpositionFuncType atomSupType,
92 const double constant,
93 const double * t,
94 double * q) const;
95#endif
96
97 private:
98 const std::shared_ptr<const AtomSphericalDataContainer>
100 const std::vector<std::string> d_atomSymbolVec;
101 std::vector<utils::Point> d_atomCoordinatesVec;
102 const std::string d_fieldName;
105
106 std::vector<std::shared_ptr<SphericalData>> d_sphericalDataVecAll;
108
111 // mutable utils::MemoryStorage<double, memorySpace> d_values;
112 };
113
114 } // namespace atoms
115} // namespace dftefe
116
118
119#endif // dftefeAtomSuperpositionFunction_h
Definition: AtomSuperpositionFunction.h:55
const std::shared_ptr< const AtomSphericalDataContainer > d_atomSphericalDataContainer
Definition: AtomSuperpositionFunction.h:99
size_type d_numEnrichmentFuncTotal
Definition: AtomSuperpositionFunction.h:107
void evaluate(const size_type numPoints, const AtomSuperpositionFuncType atomSupType, const double *t, double *q, const double constant=1.0) const
Definition: AtomSuperpositionFunction.h:66
utils::MemoryStorage< double, memorySpace > d_originsFlat
Definition: AtomSuperpositionFunction.h:110
size_type d_numAtoms
Definition: AtomSuperpositionFunction.h:103
const std::vector< std::string > d_atomSymbolVec
Definition: AtomSuperpositionFunction.h:100
const std::string d_fieldName
Definition: AtomSuperpositionFunction.h:102
size_type d_dim
Definition: AtomSuperpositionFunction.h:104
linearAlgebra::LinAlgOpContext< memorySpace > * d_linAlgOpContext
Definition: AtomSuperpositionFunction.h:109
std::vector< std::shared_ptr< SphericalData > > d_sphericalDataVecAll
Definition: AtomSuperpositionFunction.h:106
void evalHost(size_type numPoints, const AtomSuperpositionFuncType atomSupType, const double constant, const double *t, double *q) const
Definition: AtomSuperpositionFunction.t.cpp:68
std::vector< utils::Point > d_atomCoordinatesVec
Definition: AtomSuperpositionFunction.h:101
Definition: LinAlgOpContext.h:52
Definition: MemoryStorage.h:38
AtomSuperpositionFuncType
Definition: AtomSuperpositionFunction.h:46
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
std::uint64_t size_type
Definition: TypeConfig.h:9