Line data Source code
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 "MooseTypes.h" 13 : #include "FaceInfo.h" 14 : #include "MooseFunctorArguments.h" 15 : #include "libmesh/elem.h" 16 : 17 : /** 18 : * A base class interface for both producers and consumers of functor face arguments, e.g. residual 19 : * objects/postprocessors and functors respectively 20 : */ 21 : class FaceArgInterface 22 : { 23 : public: 24 1143238 : virtual ~FaceArgInterface() = default; 25 : virtual bool hasFaceSide(const FaceInfo & fi, const bool fi_elem_side) const = 0; 26 : }; 27 : 28 : /** 29 : * An interface for producers of functor face arguments, e.g. objects such as residual objects and 30 : * postprocessors 31 : */ 32 : class FaceArgProducerInterface : public FaceArgInterface 33 : { 34 : public: 35 : /** 36 : * Create a functor face argument from provided component arguments 37 : * @param fi the face information object 38 : * @param limiter_type the limiter that defines how to perform interpolations to the faces 39 : * @param elem_is_upwind whether the face information element is the upwind element (the value 40 : * of this doesn't matter when the limiter type is CentralDifference) 41 : * @param correct_skewness whether to apply skew correction 42 : * @return the functor face argument 43 : */ 44 : Moose::FaceArg makeFace(const FaceInfo & fi, 45 : const Moose::FV::LimiterType limiter_type, 46 : const bool elem_is_upwind, 47 : const bool correct_skewness = false, 48 : const Moose::StateArg * state_limiter = nullptr) const; 49 : 50 : /** 51 : * Make a functor face argument with a central differencing limiter, e.g. compose a face 52 : * argument that will tell functors to perform (possibly skew-corrected) linear interpolations 53 : * from cell center values to faces 54 : * @param fi the face information 55 : * @param correct_skewness whether to apply skew correction 56 : * @return a face argument for functors 57 : */ 58 : Moose::FaceArg makeCDFace(const FaceInfo & fi, const bool correct_skewness = false) const; 59 : }; 60 : 61 : inline Moose::FaceArg 62 1435326 : FaceArgProducerInterface::makeCDFace(const FaceInfo & fi, const bool correct_skewness) const 63 : { 64 1435326 : return makeFace(fi, Moose::FV::LimiterType::CentralDifference, true, correct_skewness); 65 : }