www.mooseframework.org
InterfaceUserObject.C
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 #include "InterfaceUserObject.h"
11 #include "SubProblem.h"
12 #include "MooseTypes.h"
13 #include "Assembly.h"
14 
15 template <>
18 {
23  params.addClassDescription("Basic UO class to perform computation across an interface");
24 
25  // Need one layer of ghosting
26  params.addRelationshipManager("ElementSideNeighborLayers",
29  return params;
30 }
31 
33  : UserObject(parameters),
34  BoundaryRestrictableRequired(this, false), // false for applying to sidesets
35  TwoMaterialPropertyInterface(this, Moose::EMPTY_BLOCK_IDS, boundaryIDs()),
36  NeighborCoupleable(this, false, false),
38  UserObjectInterface(this),
39  TransientInterface(this),
41  _mesh(_subproblem.mesh()),
42  _q_point(_assembly.qPointsFace()),
43  _qrule(_assembly.qRuleFace()),
44  _JxW(_assembly.JxWFace()),
45  _coord(_assembly.coordTransformation()),
46  _normals(_assembly.normals()),
47  _current_elem(_assembly.elem()),
48  _current_side(_assembly.side()),
49  _current_side_elem(_assembly.sideElem()),
50  _current_side_volume(_assembly.sideElemVolume()),
51  _neighbor_elem(_assembly.neighbor()),
52  _current_neighbor_volume(_assembly.neighborVolume())
53 {
54  // Keep track of which variables are coupled so we know what we depend on
55  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
56  for (const auto & var : coupled_vars)
58 }
59 
60 const Real &
62 {
63  return _assembly.neighborVolume();
64 }
A class for requiring an object to be boundary restricted.
Assembly & _assembly
Definition: UserObject.h:145
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< InterfaceUserObject >()
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
Interface for objects that needs transient capabilities.
InputParameters validParams< UserObject >()
Definition: UserObject.C:18
Interface for objects that need to use UserObjects.
InterfaceUserObject(const InputParameters &parameters)
const std::set< SubdomainID > EMPTY_BLOCK_IDS
Definition: MooseTypes.h:451
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:90
InputParameters validParams< TwoMaterialPropertyInterface >()
InputParameters validParams< BoundaryRestrictableRequired >()
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const Real & neighborVolume() const
Returns the reference to the current neighbor volume.
Definition: Assembly.C:480
Definition: Moose.h:112
InputParameters validParams< TransientInterface >()
Base class for user-specific data.
Definition: UserObject.h:37
const Real & getNeighborElemVolume()
The volume (or length) of the current neighbor.
Enhances Coupleable interface to also couple the values from neighbor elements.
Interface class for classes which interact with Postprocessors.