SpatialOps
FVStaggeredBCOp.h
1 /*
2  * Copyright (c) 2014 The University of Utah
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to
6  * deal in the Software without restriction, including without limitation the
7  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8  * sell copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20  * IN THE SOFTWARE.
21  */
22 
23 #ifndef SpatialOps_FVStaggeredStencilBCOp_h
24 #define SpatialOps_FVStaggeredStencilBCOp_h
25 
26 #include <spatialops/structured/stencil/FVStaggeredOperatorTypes.h>
27 #include <spatialops/NeboStencilBuilder.h>
28 
29 namespace SpatialOps{
30 
31  template< typename CellT > class BCOpTypesGeneral
32  {
33  typedef BasicOpTypes<CellT> OpT;
34  public:
38 
42  };
43 
70  template<typename FieldT> struct BCOpTypes : public BCOpTypesGeneral<FieldT>{};
71 
72  template<> struct BCOpTypes<SSurfXField> {
75  };
76 
77  template<> struct BCOpTypes<SSurfYField> {
80  };
81 
82  template<> struct BCOpTypes<SSurfZField> {
85  };
86 
87  // partial specialization with inheritance for XVolFields
88  template<> struct BCOpTypes<XVolField> : public BCOpTypesGeneral<XVolField>{
90  };
91 
92  // partial specialization with inheritance for YVolFields
93  template<> struct BCOpTypes<YVolField> : public BCOpTypesGeneral<YVolField>{
95  };
96 
97  // partial specialization with inheritance for ZVolFields
98  template<> struct BCOpTypes<ZVolField> : public BCOpTypesGeneral<ZVolField> {
100  };
101 
102  template<> struct BCOpTypes< FaceTypes<XVolField>::XFace >{
105  };
106 
107  template<> struct BCOpTypes<FaceTypes<YVolField>::YFace>{
110  };
111 
112  template<> struct BCOpTypes<FaceTypes<ZVolField>::ZFace>
113  {
116  };
117 
118 
145  template< typename FieldT, typename DirT> struct BCOpTypesFromDirection;
146 
147  template< typename FieldT > struct BCOpTypesFromDirection<FieldT,XDIR>{
148  typedef typename BCOpTypes<FieldT>::DirichletX Dirichlet;
149  typedef typename BCOpTypes<FieldT>::NeumannX Neumann;
150  };
151  template< typename FieldT > struct BCOpTypesFromDirection<FieldT,YDIR>{
152  typedef typename BCOpTypes<FieldT>::DirichletY Dirichlet;
153  typedef typename BCOpTypes<FieldT>::NeumannY Neumann;
154  };
155  template< typename FieldT > struct BCOpTypesFromDirection<FieldT,ZDIR>{
156  typedef typename BCOpTypes<FieldT>::DirichletZ Dirichlet;
157  typedef typename BCOpTypes<FieldT>::NeumannZ Neumann;
158  };
159 
160 } // namespace SpatialOps
161 
162 #endif // SpatialOps_FVStaggeredStencilBCOp_h
Given a field type and direction type, this provides type inference to obtain BC operator types to ac...
Provides typedefs for common operator types on a given volume.
Supports definition of new Nebo boundary condition.
Provides type inference to obtain BC operator types for a field type.
Defines a type for the x-direction.
Defines a type for the y-direction.
Define Face field types in terms of a cell field type.
Defines a type for the z-direction.
Abstracts a field.
Definition: SpatialField.h:132