DFT-FE 1.3.0-pre
Density Functional Theory With Finite-Elements
Loading...
Searching...
No Matches
MatrixFreeDevice.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (c) 2017-2022 The Regents of the University of Michigan and DFT-FE
4// authors.
5//
6// This file is part of the DFT-FE code.
7//
8// The DFT-FE code is free software; you can use it, redistribute
9// it, and/or modify it under the terms of the GNU Lesser General
10// Public License as published by the Free Software Foundation; either
11// version 2.1 of the License, or (at your option) any later version.
12// The full text of the license can be found in the file LICENSE at
13// the top level of the DFT-FE distribution.
14//
15// ---------------------------------------------------------------------
16//
17
18/**
19 * @author Gourab Panigrahi
20 *
21 */
22
23#ifndef matrixFreeDevice_H_
24#define matrixFreeDevice_H_
25#include <cstdint>
26#include <stdexcept>
27#include <TypeConfig.h>
28#include <MemoryStorage.h>
29#include <DeviceTypeConfig.h>
30#include <DeviceExceptions.h>
32
33namespace dftfe
34{
35 // List of operators
37 {
40 LDA = 2,
41 GGA = 3,
43 };
44
45 /**
46 * @brief MatrixFreeDevice class template. template parameter nDofsPerDim
47 * is the finite element polynomial order. nQuadPointsPerDim is the order of
48 * the Gauss quadrature rule. batchSize is the size of batch tuned to hardware
49 *
50 * @author Gourab Panigrahi
51 *
52 */
53 template <typename T,
54 dftfe::operatorList operatorID,
55 std::uint32_t nDofsPerDim,
56 std::uint32_t nQuadPointsPerDim,
57 std::uint32_t batchSize>
59 {
60 static inline void
61 init(T *constMemDataHost, std::size_t constMemDataSize);
62
63 static inline void
65 T *src,
66 T *jacobianFactor,
67 dftfe::uInt *map,
68 T *shapeBuffer,
69 dftfe::uInt nCells,
70 dftfe::uInt nBatch);
71
72 static inline void
74 T *src,
75 T *jacobianFactor,
76 dftfe::uInt *map,
77 T *shapeBuffer,
78 T coeffHelmholtz,
79 dftfe::uInt nCells,
80 dftfe::uInt nBatch);
81
82 static inline void
84 const dftfe::uInt *constrainingNodeBuckets,
85 const dftfe::uInt *constrainingNodeOffset,
86 const dftfe::uInt *constrainedNodeBuckets,
87 const dftfe::uInt *constrainedNodeOffset,
88 const T *weightMatrixList,
89 const dftfe::uInt *weightMatrixOffset,
90 const T *inhomogenityList,
91 const dftfe::uInt *ghostMap,
92 const dftfe::uInt inhomogenityListSize,
93 const dftfe::uInt nBatch,
94 const dftfe::uInt nOwnedDofs,
95 const dftfe::uInt nGhostDofs);
96
97 static inline void
99 T *src,
100 const dftfe::uInt *constrainingNodeBuckets,
101 const dftfe::uInt *constrainingNodeOffset,
102 const dftfe::uInt *constrainedNodeBuckets,
103 const dftfe::uInt *constrainedNodeOffset,
104 const T *weightMatrixList,
105 const dftfe::uInt *weightMatrixOffset,
106 const dftfe::uInt *ghostMap,
107 const dftfe::uInt inhomogenityListSize,
108 const dftfe::uInt nBatch,
109 const dftfe::uInt nOwnedDofs,
110 const dftfe::uInt nGhostDofs);
111 };
112
113} // namespace dftfe
114#endif // matrixFreeDevice_H_
Definition pseudoPotentialToDftfeConverter.cc:34
std::uint32_t uInt
Definition TypeConfig.h:10
operatorList
Definition MatrixFreeDevice.h:37
@ Laplace
Definition MatrixFreeDevice.h:38
@ GGA
Definition MatrixFreeDevice.h:41
@ LDA
Definition MatrixFreeDevice.h:40
@ Count
Definition MatrixFreeDevice.h:42
@ Helmholtz
Definition MatrixFreeDevice.h:39
MatrixFreeDevice class template. template parameter nDofsPerDim is the finite element polynomial orde...
Definition MatrixFreeDevice.h:59
static void constraintsDistributeTranspose(T *dst, T *src, const dftfe::uInt *constrainingNodeBuckets, const dftfe::uInt *constrainingNodeOffset, const dftfe::uInt *constrainedNodeBuckets, const dftfe::uInt *constrainedNodeOffset, const T *weightMatrixList, const dftfe::uInt *weightMatrixOffset, const dftfe::uInt *ghostMap, const dftfe::uInt inhomogenityListSize, const dftfe::uInt nBatch, const dftfe::uInt nOwnedDofs, const dftfe::uInt nGhostDofs)
static void constraintsDistribute(T *src, const dftfe::uInt *constrainingNodeBuckets, const dftfe::uInt *constrainingNodeOffset, const dftfe::uInt *constrainedNodeBuckets, const dftfe::uInt *constrainedNodeOffset, const T *weightMatrixList, const dftfe::uInt *weightMatrixOffset, const T *inhomogenityList, const dftfe::uInt *ghostMap, const dftfe::uInt inhomogenityListSize, const dftfe::uInt nBatch, const dftfe::uInt nOwnedDofs, const dftfe::uInt nGhostDofs)
static void init(T *constMemDataHost, std::size_t constMemDataSize)
static void computeHelmholtzX(T *dst, T *src, T *jacobianFactor, dftfe::uInt *map, T *shapeBuffer, T coeffHelmholtz, dftfe::uInt nCells, dftfe::uInt nBatch)
static void computeLaplaceX(T *dst, T *src, T *jacobianFactor, dftfe::uInt *map, T *shapeBuffer, dftfe::uInt nCells, dftfe::uInt nBatch)