forked from dftfeDevelopers/dftfe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poisson.h
88 lines (69 loc) · 2.57 KB
/
poisson.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// ---------------------------------------------------------------------
//
// Copyright (c) 2017 The Regents of the University of Michigan and DFT-FE authors.
//
// This file is part of the DFT-FE code.
//
// The DFT-FE code is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the DFT-FE distribution.
//
// ---------------------------------------------------------------------
//
// @author Shiva Rudraraju (2016), Phani Motamarri (2016)
//
#ifndef poisson_H_
#define poisson_H_
#include "headers.h"
#include "dft.h"
typedef double dataType;
typedef dealii::parallel::distributed::Vector<double> vectorType;
template <unsigned int T>
class dftClass;
//
//Define poisson class
//
template <unsigned int FEOrder>
class poissonClass
{
template <unsigned int T>
friend class dftClass;
public:
poissonClass(dftClass<FEOrder>* _dftPtr);
void vmult(vectorType &dst, const vectorType &src) const;
void precondition_Jacobi(vectorType& dst, const vectorType& src, const double omega) const;
void subscribe (const char *identifier=0) const{}; //function needed to mimic SparseMatrix for Jacobi preconditioning
void unsubscribe (const char *identifier=0) const{}; //function needed to mimic SparseMatrix for Jacobi preconditioning
bool operator!= (double val) const {return true;}; //function needed to mimic SparseMatrix
typedef unsigned int size_type; //add this line
private:
void init ();
void computeRHS(std::map<dealii::CellId,std::vector<double> >* rhoValues);
void computeRHS2();
void solve(vectorType& phi,
int constraintMatrixId,
std::map<dealii::CellId,std::vector<double> >* rhoValues=0);
void AX(const dealii::MatrixFree<3,double> &data,
vectorType &dst,
const vectorType &src,
const std::pair<unsigned int,unsigned int> &cell_range) const;
//pointer to dft class
dftClass<FEOrder> * dftPtr;
//FE data structres
dealii::FE_Q<3> FE;
int d_constraintMatrixId;
//data structures
vectorType rhs, rhs2, jacobianDiagonal;
vectorType phiTotRhoIn, phiTotRhoOut, phiExt, vselfBinScratch;
//parallel objects
MPI_Comm mpi_communicator;
const unsigned int n_mpi_processes;
const unsigned int this_mpi_process;
dealii::ConditionalOStream pcout;
//compute-time logger
dealii::TimerOutput computing_timer;
};
#endif