www.mooseframework.org
OrientedBoxInterface.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // MOOSE includes
13 #include "MooseTypes.h"
14 
15 #include "libmesh/bounding_box.h" // For destructor
16 #include "libmesh/vector_value.h"
17 #include "libmesh/tensor_value.h"
18 
19 // Forward declarations
20 class InputParameters;
21 template <typename T>
23 
24 /*
25  * An interface class for testing if a point is within a bounding box with arbitrary orientation
26  *
27  * This constructor does most of the work.
28  * The overall strategy is to create a box of the required size which is centered at the origin,
29  * with
30  * the width along the x axis, the length along the y axis, and the height along the z axis
31  *
32  * Then create the transformation from real space into this box, which is:
33  * a translation from center to the origin, then
34  * a rotation from the oriented box frame to this frame
35  *
36  * see OrientedBoxMarker OrientedSubdomainBoundingBox
37  */
39 {
40 public:
45 
46  OrientedBoxInterface(const InputParameters & parameters);
47 
51  virtual ~OrientedBoxInterface() = default;
52 
53 protected:
59  bool containsPoint(const Point & point);
60 
61 private:
63  Point _center;
64 
66  std::unique_ptr<RealTensorValue> _rot_matrix;
67 
69  std::unique_ptr<BoundingBox> _bounding_box;
70 };
bool containsPoint(const Point &point)
Test if the supplied point is within the defined oriented bounding box.
static InputParameters validParams()
Class constructor.
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)
virtual ~OrientedBoxInterface()=default
Class destructor.