Chombo + EB + MF  3.2
BlockBoundary.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 // bvs 06/06/06
12 
13 #ifndef _BLOCKBOUNDARY_H_
14 #define _BLOCKBOUNDARY_H_
15 
16 
17 #include <iostream>
18 #include "IntVect.H"
19 #include "Box.H"
20 #include "Misc.H"
21 #include "SPACE.H"
22 #include <map>
23 #include <string>
24 #include "IndicesTransformation.H"
25 
26 #include "NamespaceHeader.H"
27 
28 // ---------------------------------------------------------
29 /// Class to describe the multi-block topology between 2 blocks, or placehold a BC
31 {
32 public:
33 
34  /// null constructor leaves object in type=UNKNOWN state. It can be overridden by MappedDomain
35  BlockBoundary();
36 
37  /// the boundary is an external boundary condition.
38  /**
39  Boundary condition label. Application is responsible for interpreting
40  the pointer.
41  */
42  // BlockBoundary(void* a_boundaryClass);
43  BlockBoundary(int a_boundaryClass);
44 
45  ///
46  /*
47  Same as constructor.
48  */
49  // void define(void* a_boundaryClass);
50  void define(int a_boundaryClass);
51 
52  /// the boundary is a conformal connection between two blocks.
53  /**
54  The BlockMap between these two MappedBlocks are conformal, hence no spatial
55  interpolation needs to be performed. However, the index spaces may require a
56  transform.
57 
58  these topological connections are redundant between two blocks. the user
59  can choose to specify all connections, and have MappedDomain verify the
60  topology, or the user can provide just the sufficient non-redundant set
61  and have MappedDomain construct the mirrors.
62  */
63  BlockBoundary(const IndicesTransformation& a_transformation,
64  int a_neighbor);
65 
66  ///
67  /*
68  Same as constructor.
69  */
70  void define(const IndicesTransformation& a_transformation,
71  int a_neighbor);
72 
73  ///
74  /**
75  conformal mapping with unchanged coordinate system
76  */
77  void defineConformal(int a_neighbor);
78 
79  ///
80  /**
81  Returns true if boundary is an interface between two blocks or false
82  otherwise (e.g., a domain boundary)
83  */
84  bool isInterface() const
85  {
86  return ( (type() == BlockBoundary::CONFORMAL) ||
87  (type() == BlockBoundary::MAPPED) );
88  }
89 
90  friend BlockBoundary coarsen(const BlockBoundary& a_bb,
91  int a_refinement_ratio);
92 
93  friend BlockBoundary refine(const BlockBoundary& a_bb,
94  int a_refinement_ratio);
95 
96 
97  int neighbor() const
98  {
99  return m_neighbor;
100  }
101 
103  {
104  return m_transformation;
105  }
106 
107  bool isDomainBoundary() const
108  {
109  return (m_type == BOUNDARY);
110  }
111 
112  bool isConformal() const
113  {
114  return (m_type == CONFORMAL);
115  }
116 
117  bool isMapped() const
118  {
119  return (m_type == MAPPED);
120  }
121 
122  ///
123  /**
124  Returns 1 if flux in direction a_dir points the same way on the
125  other side of the block boundary, or -1 if it points the opposite way.
126  */
127  int reorientFace(int a_dir) const;
128 
129  ///
130  /**
131  Returns the direction in the block on the other side of the
132  block boundary corresponding to a_dir in this block.
133  */
134  int dirOther(int a_dir) const;
135 
136  enum btype
137  {
139  };
140 
141  btype type() const
142  {
143  return m_type;
144  }
145 
146 protected:
147 
149 
150  // void* m_bc;
151  int m_bc;
154 
155 };
156 
157 #include "NamespaceFooter.H"
158 
159 #endif // include guard
BlockBoundary()
null constructor leaves object in type=UNKNOWN state. It can be overridden by MappedDomain ...
IndicesTransformation getTransformation() const
Definition: BlockBoundary.H:102
Definition: BlockBoundary.H:138
bool isConformal() const
Definition: BlockBoundary.H:112
friend BlockBoundary coarsen(const BlockBoundary &a_bb, int a_refinement_ratio)
btype type() const
Definition: BlockBoundary.H:141
int m_bc
Definition: BlockBoundary.H:151
bool isMapped() const
Definition: BlockBoundary.H:117
btype
Definition: BlockBoundary.H:136
bool isDomainBoundary() const
Definition: BlockBoundary.H:107
Class to describe the multi-block topology between 2 blocks, or placehold a BC.
Definition: BlockBoundary.H:30
int neighbor() const
Definition: BlockBoundary.H:97
Definition: BlockBoundary.H:138
int m_neighbor
Definition: BlockBoundary.H:152
Definition: BlockBoundary.H:138
friend BlockBoundary refine(const BlockBoundary &a_bb, int a_refinement_ratio)
int dirOther(int a_dir) const
bool isInterface() const
Definition: BlockBoundary.H:84
void define(int a_boundaryClass)
IndicesTransformation m_transformation
Definition: BlockBoundary.H:148
btype m_type
Definition: BlockBoundary.H:153
Class to describe transformation of indices from one block to another.
Definition: IndicesTransformation.H:25
void defineConformal(int a_neighbor)
int reorientFace(int a_dir) const
Definition: BlockBoundary.H:138