www.mooseframework.org
OrientedBoxInterface.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef ORIENTEDBOXINTERFACE_H
16 #define ORIENTEDBOXINTERFACE_H
17 
18 // MOOSE includes
19 #include "MooseTypes.h"
20 
21 #include "libmesh/bounding_box.h" // For destructor
22 #include "libmesh/vector_value.h"
23 #include "libmesh/tensor_value.h"
24 
25 // Forward declarations
26 class InputParameters;
28 
29 template <typename T>
31 
32 template <>
34 
35 /*
36  * An interface class for testing if a point is within a bounding box with arbitrary orientation
37  *
38  * This constructor does most of the work.
39  * The overall strategy is to create a box of the required size which is centered at the origin,
40  * with
41  * the width along the x axis, the length along the y axis, and the height along the z axis
42  *
43  * Then create the transformation from real space into this box, which is:
44  * a translation from center to the origin, then
45  * a rotation from the oriented box frame to this frame
46  *
47  * see OrientedBoxMarker OrientedSubdomainBoundingBox
48  */
50 {
51 public:
55  OrientedBoxInterface(const InputParameters & parameters);
56 
60  virtual ~OrientedBoxInterface() = default;
61 
62 protected:
68  bool containsPoint(const Point & point);
69 
70 private:
72  Point _center;
73 
75  std::unique_ptr<RealTensorValue> _rot_matrix;
76 
78  std::unique_ptr<BoundingBox> _bounding_box;
79 };
80 
81 #endif // ORIENTEDBOXINTERFACE_H
bool containsPoint(const Point &point)
Test if the supplied point is within the defined oriented bounding box.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams()
Point _center
Center of the defined bounding box.
std::unique_ptr< RealTensorValue > _rot_matrix
Rotation matrix for transforming the bounding box.
std::unique_ptr< BoundingBox > _bounding_box
The bounding box used to test if the point is contained within.
OrientedBoxInterface(const InputParameters &parameters)
Class constructor.
virtual ~OrientedBoxInterface()=default
Class destructor.
InputParameters validParams< OrientedBoxInterface >()