OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ippl
src
Meshes
CartesianStencilSetup.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
/***************************************************************************
3
*
4
* The IPPL Framework
5
*
6
*
7
* Visit http://people.web.psi.ch/adelmann/ for more details
8
*
9
***************************************************************************/
10
11
#ifndef CARTESIAN_STENCIL_SETUP_H
12
#define CARTESIAN_STENCIL_SETUP_H
13
14
// CartesianStencilSetup.h
15
// Common stencil setup header for Cartesian and UniformCartesian classes
16
17
//----------------------------------------------------------------------
18
//
19
// Define the operator class types for the stencils.
20
//
21
// These get plugged into UnaryElem as the operator to indicate
22
// what kind of operation is to be done.
23
//
24
//----------------------------------------------------------------------
25
template
<
unsigned
Dim>
struct
Divergence
{};
26
template
<
unsigned
Dim>
struct
Gradient
{};
27
28
//----------------------------------------------------------------------
29
//
30
// Define the return types.
31
//
32
// These are the element by element return types. They just encode
33
// the fact that divergence of a Vektor is a scalar, and gradient of
34
// a scalar is a Vektor. As such they are independent of centering
35
// and use the tag base classes.
36
//
37
// These need to be filled out with specializations for Tenzors...
38
//
39
//----------------------------------------------------------------------
40
template
<>
struct
PETEUnaryReturn
<
Divergence
<1>,
Vektor
<double,1> >
41
{
typedef
double
type
; };
42
template
<>
struct
PETEUnaryReturn
<
Divergence
<2>,
Vektor
<double,2> >
43
{
typedef
double
type
; };
44
template
<>
struct
PETEUnaryReturn
<
Divergence
<3>,
Vektor
<double,3> >
45
{
typedef
double
type
; };
46
47
template
<>
struct
PETEUnaryReturn
<
Divergence
<1>,
Vektor
<float,1> >
48
{
typedef
float
type
; };
49
template
<>
struct
PETEUnaryReturn
<
Divergence
<2>,
Vektor
<float,2> >
50
{
typedef
float
type
; };
51
template
<>
struct
PETEUnaryReturn
<
Divergence
<3>,
Vektor
<float,3> >
52
{
typedef
float
type
; };
53
54
template
<>
struct
PETEUnaryReturn
<
Gradient
<1>, double >
55
{
typedef
Vektor<double,1>
type
; };
56
template
<>
struct
PETEUnaryReturn
<
Gradient
<2>, double >
57
{
typedef
Vektor<double,2>
type
; };
58
template
<>
struct
PETEUnaryReturn
<
Gradient
<3>, double >
59
{
typedef
Vektor<double,3>
type
; };
60
61
template
<>
struct
PETEUnaryReturn
<
Gradient
<1>, float >
62
{
typedef
Vektor<float,1>
type
; };
63
template
<>
struct
PETEUnaryReturn
<
Gradient
<2>, float >
64
{
typedef
Vektor<float,2>
type
; };
65
template
<>
struct
PETEUnaryReturn
<
Gradient
<3>, float >
66
{
typedef
Vektor<float,3>
type
; };
67
68
//----------------------------------------------------------------------
69
//
70
// Now derive from these general tags specific ones that include
71
// the mesh and centerings.
72
//
73
// These define operator_type internally instead of using
74
// the OperatorClass external polymorphism because that would require
75
// partial specialization.
76
//
77
//----------------------------------------------------------------------
78
79
template
<
unsigned
Dim,
class
Mesh,
class
From,
class
To>
80
struct
CenteredDivergence
81
{
82
typedef
Divergence<Dim>
operator_type
;
83
};
84
85
template
<
unsigned
Dim,
class
Mesh,
class
From,
class
To>
86
class
CenteredGradient
87
{
88
typedef
Gradient<Dim>
operator_type
;
89
};
90
91
#endif // CARTESIAN_STENCIL_SETUP_H
92
93
/***************************************************************************
94
* $RCSfile: CartesianStencilSetup.h,v $ $Author: adelmann $
95
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
96
* IPPL_VERSION_ID: $Id: CartesianStencilSetup.h,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
97
***************************************************************************/
98
PETEUnaryReturn
Definition:
TypeComputations.h:145
PETEUnaryReturn< Gradient< 2 >, float >::type
Vektor< float, 2 > type
Definition:
CartesianStencilSetup.h:64
Gradient
Definition:
CartesianStencilSetup.h:26
Vektor
Definition:
TSVMeta.h:24
PETEUnaryReturn< Divergence< 3 >, Vektor< double, 3 > >::type
double type
Definition:
CartesianStencilSetup.h:45
PETEUnaryReturn< Divergence< 1 >, Vektor< double, 1 > >::type
double type
Definition:
CartesianStencilSetup.h:41
CenteredGradient
Definition:
CartesianStencilSetup.h:86
CenteredDivergence
Definition:
CartesianStencilSetup.h:80
CenteredGradient::operator_type
Gradient< Dim > operator_type
Definition:
CartesianStencilSetup.h:88
PETEUnaryReturn< Gradient< 1 >, float >::type
Vektor< float, 1 > type
Definition:
CartesianStencilSetup.h:62
CenteredDivergence::operator_type
Divergence< Dim > operator_type
Definition:
CartesianStencilSetup.h:82
PETEUnaryReturn< Divergence< 1 >, Vektor< float, 1 > >::type
float type
Definition:
CartesianStencilSetup.h:48
PETEUnaryReturn< Divergence< 2 >, Vektor< float, 2 > >::type
float type
Definition:
CartesianStencilSetup.h:50
PETEUnaryReturn< Gradient< 3 >, double >::type
Vektor< double, 3 > type
Definition:
CartesianStencilSetup.h:59
PETEUnaryReturn< Divergence< 3 >, Vektor< float, 3 > >::type
float type
Definition:
CartesianStencilSetup.h:52
PETEUnaryReturn< Divergence< 2 >, Vektor< double, 2 > >::type
double type
Definition:
CartesianStencilSetup.h:43
PETEUnaryReturn< Gradient< 3 >, float >::type
Vektor< float, 3 > type
Definition:
CartesianStencilSetup.h:66
PETEUnaryReturn< Gradient< 1 >, double >::type
Vektor< double, 1 > type
Definition:
CartesianStencilSetup.h:55
Divergence
Definition:
CartesianStencilSetup.h:25
PETEUnaryReturn< Gradient< 2 >, double >::type
Vektor< double, 2 > type
Definition:
CartesianStencilSetup.h:57
Generated on Tue Jul 2 2024 15:05:14 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5