OPAL (Object Oriented Parallel Accelerator Library)
2022.1
OPAL
src
src
Solvers
AMR_MG
AmrDirichletBoundary.h
Go to the documentation of this file.
1
//
2
// Class AmrDirichletBoundary
3
// Dirichlet boundary is on faces of physical domain the boundary
4
// value would be at different locations depending on the level.
5
//
6
// Copyright (c) 2017 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
7
// All rights reserved
8
//
9
// Implemented as part of the PhD thesis
10
// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
11
//
12
// This file is part of OPAL.
13
//
14
// OPAL is free software: you can redistribute it and/or modify
15
// it under the terms of the GNU General Public License as published by
16
// the Free Software Foundation, either version 3 of the License, or
17
// (at your option) any later version.
18
//
19
// You should have received a copy of the GNU General Public License
20
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21
//
22
#ifndef AMR_DIRICHLET_BOUNDARY_H
23
#define AMR_DIRICHLET_BOUNDARY_H
24
25
#include "
AmrBoundary.h
"
26
27
template
<
class
Level>
28
class
AmrDirichletBoundary
:
public
AmrBoundary
<Level> {
29
30
public
:
31
typedef
typename
Level::umap_t
umap_t
;
32
typedef
typename
Level::lo_t
lo_t
;
33
typedef
typename
Level::go_t
go_t
;
34
typedef
typename
Level::scalar_t
scalar_t
;
35
typedef
amr::AmrIntVect_t
AmrIntVect_t
;
36
37
public
:
38
39
AmrDirichletBoundary
() :
AmrBoundary
<Level>(1) { }
40
41
void
apply
(
const
AmrIntVect_t
& iv,
42
const
lo_t
& dir,
43
umap_t
& map,
44
const
scalar_t
& value,
45
Level* mglevel,
46
const
go_t
*
/*nr*/
);
47
};
48
49
50
template
<
class
Level>
51
void
AmrDirichletBoundary<Level>::apply
(
const
AmrIntVect_t
& iv,
52
const
lo_t
& dir,
53
umap_t
& map,
54
const
scalar_t
& value,
55
Level* mglevel,
56
const
go_t
*
/*nr*/
)
57
{
58
// find interior neighbour cell
59
AmrIntVect_t
niv = iv;
60
niv[dir] = (iv[dir] == -1) ? iv[dir] + 1 : iv[dir] - 1;
61
map[mglevel->serialize(niv)] -= value;
62
}
63
64
65
66
67
#endif
AmrBoundary.h
amr::AmrIntVect_t
amrex::IntVect AmrIntVect_t
Definition:
AmrDefs.h:48
amr::scalar_t
double scalar_t
Definition:
AmrMultiGridDefs.h:37
AmrBoundary
Definition:
AmrBoundary.h:29
AmrBoundary::umap_t
Level::umap_t umap_t
Definition:
AmrBoundary.h:32
AmrBoundary::scalar_t
Level::scalar_t scalar_t
Definition:
AmrBoundary.h:35
AmrBoundary::lo_t
Level::lo_t lo_t
Definition:
AmrBoundary.h:33
AmrBoundary::go_t
Level::go_t go_t
Definition:
AmrBoundary.h:34
AmrBoundary::AmrIntVect_t
amr::AmrIntVect_t AmrIntVect_t
Definition:
AmrBoundary.h:37
AmrDirichletBoundary
Definition:
AmrDirichletBoundary.h:28
AmrDirichletBoundary::scalar_t
Level::scalar_t scalar_t
Definition:
AmrDirichletBoundary.h:34
AmrDirichletBoundary::AmrIntVect_t
amr::AmrIntVect_t AmrIntVect_t
Definition:
AmrDirichletBoundary.h:35
AmrDirichletBoundary::lo_t
Level::lo_t lo_t
Definition:
AmrDirichletBoundary.h:32
AmrDirichletBoundary::AmrDirichletBoundary
AmrDirichletBoundary()
Definition:
AmrDirichletBoundary.h:39
AmrDirichletBoundary::umap_t
Level::umap_t umap_t
Definition:
AmrDirichletBoundary.h:31
AmrDirichletBoundary::go_t
Level::go_t go_t
Definition:
AmrDirichletBoundary.h:33
AmrDirichletBoundary::apply
void apply(const AmrIntVect_t &iv, const lo_t &dir, umap_t &map, const scalar_t &value, Level *mglevel, const go_t *)
Definition:
AmrDirichletBoundary.h:51
Generated on Thu Oct 20 2022 17:40:11 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.3