https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SelfShadowSideUserObject.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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#include "SideUserObject.h"
13#include <vector>
14#include "libmesh/data_type.h"
15
22{
23public:
24 using SideIDType = std::pair<dof_id_type, unsigned int>;
25
27
29
30 virtual void initialize() override;
31 virtual void execute() override;
32 virtual void finalize() override;
33
35 virtual void threadJoin(const UserObject & y) override;
36
37 // API to check if a QP is illuminated
38 unsigned int illumination(const SideIDType & id) const;
39
41 bool useDisplacedMesh() const { return getParam<bool>("use_displaced_mesh"); }
42
43 using Triangle = std::tuple<Point, Point, Point, SideIDType>;
44 using LineSegment = std::tuple<Point, Point, SideIDType>;
45
46protected:
48 const unsigned int _dim;
49
51 std::vector<const PostprocessorValue *> _raw_direction;
52
54 RealTensorValue _rotation;
55
57 std::map<SideIDType, unsigned int> & _illumination_status;
58
60 std::vector<Triangle> _triangles;
61
63 std::vector<LineSegment> _lines;
64
66 std::vector<std::pair<SideIDType, MooseArray<Point>>> _local_qps;
67
68private:
69 void addLines(const SideIDType & id);
70 void addTriangles(const SideIDType & id);
71 bool check2DIllumination(const Point & qp, const SideIDType & id);
72 bool check3DIllumination(const Point & qp, const SideIDType & id);
73
75 void rotate(MooseArray<Point> & points);
76 void rotate(Triangle & triangle);
77 void rotate(LineSegment & line);
78};
const std::vector< double > y
const InputParameters & parameters() const
Given a radiation direction vector this user object computes the illumination state of each side QP o...
std::map< SideIDType, unsigned int > & _illumination_status
illumination status data (partition local), we use a bit for each QP
void addTriangles(const SideIDType &id)
std::vector< LineSegment > _lines
global line segment data (2D)
unsigned int illumination(const SideIDType &id) const
virtual void threadJoin(const UserObject &y) override
only needed for ElementUserObjects and NodalUseroObjects
void rotate(MooseArray< Point > &points)
rotate all points in the given container
std::vector< Triangle > _triangles
global triange data (3D)
virtual void finalize() override
bool check2DIllumination(const Point &qp, const SideIDType &id)
bool check3DIllumination(const Point &qp, const SideIDType &id)
RealTensorValue _rotation
matrix that rotates the direction onto the z-axis
virtual void execute() override
static InputParameters validParams()
void addLines(const SideIDType &id)
virtual void initialize() override
const unsigned int _dim
problem dimension
std::pair< dof_id_type, unsigned int > SideIDType
void rotate(LineSegment &line)
std::vector< const PostprocessorValue * > _raw_direction
raw illumination vector data (direction the radiation is propagating in)
bool useDisplacedMesh() const
API to chek if the UO runs on the displaced mesh.
std::vector< std::pair< SideIDType, MooseArray< Point > > > _local_qps
local QP data