https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseFunctorArguments.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 <tuple>
13
14#include "Limiter.h"
15#include "FaceInfo.h"
16#include "MooseTypes.h"
17#include "libmesh/elem.h"
18#include "libmesh/point.h"
19#include "libmesh/quadrature.h"
20
21#include <set>
22
23namespace Moose
24{
28struct ElemArg
29{
32
36 Point getPoint() const { return elem->vertex_average(); }
37
42 friend bool operator<(const ElemArg & l, const ElemArg & r)
43 {
44 return std::make_tuple(l.elem, l.correct_skewness) <
45 std::make_tuple(r.elem, r.correct_skewness);
46 }
47};
48
54{
58
62 Point getPoint() const { return point; }
63
68 friend bool operator<(const ElemPointArg & l, const ElemPointArg & r)
69 {
70 return std::make_tuple(l.elem, l.point, l.correct_skewness) <
71 std::make_tuple(r.elem, r.point, r.correct_skewness);
72 }
73
77 ElemArg makeElem() const { return {elem, correct_skewness}; }
78};
79
90{
93
95 unsigned int side;
96
98 unsigned int qp;
99
102
104 Point point;
105
109 Point getPoint() const { return point; }
110};
111
122{
127 StateArg(bool) = delete;
128
129 StateArg(unsigned int state_in) : state(state_in), iteration_type(SolutionIterationType::Time) {}
130
131 StateArg(unsigned int state_in, SolutionIterationType iteration_type_in)
132 : state(state_in), iteration_type(iteration_type_in)
133 {
134 }
135
136 bool operator==(const StateArg & other) const
137 {
138 return state == other.state && iteration_type == other.iteration_type;
139 }
140
144 unsigned int state;
145
148
149private:
151
152 friend StateArg currentState();
153};
154
155inline StateArg
157{
158 return {};
159}
160
161inline StateArg
163{
164 return {(unsigned int)1};
165}
166
167inline StateArg
169{
170 return {(unsigned int)1, SolutionIterationType::Nonlinear};
171}
172
173inline StateArg
178
179inline StateArg
184
189{
191 const FaceInfo * fi;
192
196
199
202
213
216
220 libMesh::Point getPoint() const { return fi->faceCentroid(); }
221
225 ElemArg makeElem() const { return {&fi->elem(), correct_skewness}; }
226
231
236 friend bool operator<(const FaceArg & l, const FaceArg & r)
237 {
238 return std::make_tuple(
240 std::make_tuple(r.fi, r.limiter_type, r.elem_is_upwind, r.correct_skewness, r.face_side);
241 }
242};
243
245{
248
256 const std::set<SubdomainID> * subdomain_ids;
257
258 libMesh::Point getPoint() const { return *node; }
259
263 static const std::set<SubdomainID> undefined_subdomain_connection;
264
269 friend bool operator<(const NodeArg & l, const NodeArg & r)
270 {
271 return std::make_tuple(l.node, l.subdomain_ids) < std::make_tuple(r.node, r.subdomain_ids);
272 }
273};
274
284{
287
289 unsigned int qp;
290
293
296
300 libMesh::Point getPoint() const { return point; }
301
306 friend bool operator<(const ElemQpArg & l, const ElemQpArg & r)
307 {
308 return std::make_tuple(l.elem, l.qp, l.qrule, l.point) <
309 std::make_tuple(r.elem, r.qp, r.qrule, r.point);
310 }
311};
312}
void ErrorVector unsigned int
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
const Elem & elem() const
Definition FaceInfo.h:85
const Elem * neighborPtr() const
Definition FaceInfo.h:88
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Definition FaceInfo.h:75
Point vertex_average() const
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
StateArg previousMultiSystemFixedPointState()
StateArg previousNonlinearState()
StateArg oldState()
SolutionIterationType
Definition MooseTypes.h:270
StateArg currentState()
StateArg previousMultiAppFixedPointState()
A structure that is used to evaluate Moose functors logically at an element/cell center.
friend bool operator<(const ElemArg &l, const ElemArg &r)
friend function that allows this structure to be used as keys in ordered containers like sets and map...
const libMesh::Elem * elem
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
ElemArg makeElem() const
Make a ElemArg from our data.
const libMesh::Elem * elem
friend bool operator<(const ElemPointArg &l, const ElemPointArg &r)
friend function that allows this structure to be used as keys in ordered containers like sets and map...
Argument for requesting functor evaluation at a quadrature point location in an element.
const libMesh::Elem * elem
The element.
const libMesh::QBase * qrule
The quadrature rule.
unsigned int qp
The quadrature point index.
libMesh::Point point
The physical location of the quadrature point.
friend bool operator<(const ElemQpArg &l, const ElemQpArg &r)
Friend function that allows this structure to be used as keys in ordered containers like sets and map...
libMesh::Point getPoint() const
Argument for requesting functor evaluation at quadrature point locations on an element side.
const libMesh::Elem * elem
The element.
unsigned int qp
The quadrature point index.
unsigned int side
The local side index.
const libMesh::QBase * qrule
The quadrature rule.
Point point
The physical location of the quadrature point.
A structure defining a "face" evaluation calling argument for Moose functors.
friend bool operator<(const FaceArg &l, const FaceArg &r)
friend function that allows this structure to be used as keys in ordered containers like sets and map...
ElemArg makeNeighbor() const
Make a ElemArg from our data using the face information neighbor.
bool elem_is_upwind
a boolean which states whether the face information element is upwind of the face
ElemArg makeElem() const
Make a ElemArg from our data using the face information element.
bool correct_skewness
Whether to perform skew correction.
Moose::FV::LimiterType limiter_type
a limiter which defines how the functor evaluated on either side of the face should be interpolated t...
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
const FaceInfo * fi
a face information object which defines our location in space
const Moose::StateArg * state_limiter
A member that can be used to define the instance in which the limiters are executed.
libMesh::Point getPoint() const
static const std::set< SubdomainID > undefined_subdomain_connection
A static member that can be used when the connection of a node to subdomains is unknown.
const libMesh::Node * node
The node which defines our location in space.
libMesh::Point getPoint() const
friend bool operator<(const NodeArg &l, const NodeArg &r)
Friend function that allows this structure to be used as keys in ordered containers like sets and map...
const std::set< SubdomainID > * subdomain_ids
Indicates what subdomains this argument should be associated with.
State argument for evaluating functors.
SolutionIterationType iteration_type
The solution iteration type, e.g. time or nonlinear.
StateArg(bool)=delete
Prevent implicit conversions from boolean to avoid users accidentally constructing a time argument wh...
unsigned int state
The state.
StateArg(unsigned int state_in, SolutionIterationType iteration_type_in)
friend StateArg currentState()
StateArg(unsigned int state_in)
bool operator==(const StateArg &other) const