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