diff --git a/framework/include/base/AuxiliarySystem.h b/framework/include/base/AuxiliarySystem.h index 5acfdc390261..d56440f3d29d 100644 --- a/framework/include/base/AuxiliarySystem.h +++ b/framework/include/base/AuxiliarySystem.h @@ -115,6 +115,12 @@ class AuxiliarySystem : public SystemTempl */ virtual Order getMinQuadratureOrder(); + /** + * Indicated whether this system needs material properties on boundaries. + * @return Boolean if IntegratedBCs are active + */ + bool needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid); + protected: void computeScalarVars(std::vector & auxs); void computeNodalVars(std::vector & auxs); diff --git a/framework/include/base/ComputeMaterialsObjectThread.h b/framework/include/base/ComputeMaterialsObjectThread.h index b8f42617cbc5..cafe248db6ca 100644 --- a/framework/include/base/ComputeMaterialsObjectThread.h +++ b/framework/include/base/ComputeMaterialsObjectThread.h @@ -55,6 +55,7 @@ class ComputeMaterialsObjectThread : public ThreadedElementLoop MaterialPropertyStorage & _bnd_material_props; std::vector & _materials; std::vector & _assembly; + bool _need_internal_side_material; }; #endif //COMPUTERESIDUALTHREAD_H diff --git a/framework/include/base/FEProblem.h b/framework/include/base/FEProblem.h index fa8acfb3f2c1..de69d522db5a 100644 --- a/framework/include/base/FEProblem.h +++ b/framework/include/base/FEProblem.h @@ -699,6 +699,30 @@ class FEProblem : */ void setDebugTopResiduals(unsigned int n) { _dbg_top_residuals = n; } + /** + * These methods are used to determine whether stateful material properties need to be stored on + * internal sides. There are four situations where this may be the case: 1) DGKernels + * 2) IntegratedBCs 3)InternalSideUserObjects 4)ElementalAuxBCs + * + * Method 1: + * @param bnd_id the boundary id for which to see if stateful material properties need to be stored + * @param tid the THREAD_ID of the caller + * @return Boolean indicating whether material properties need to be stored + * + * Method 2: + * @param subdomain_id the subdomain id for which to see if stateful material properties need to be stored + * @param tid the THREAD_ID of the caller + * @return Boolean indicating whether material properties need to be stored + */ + bool needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid); + bool needMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid); + + /** + * Dimension of the subspace spanned by vectors with a given prefix. + * @param prefix Prefix of the vectors spanning the subspace. + */ + unsigned int subspaceDim(const std::string& prefix) const {if (_subspace_dim.count(prefix)) return _subspace_dim.find(prefix)->second; else return 0;} + protected: MooseMesh & _mesh; EquationSystems _eq; @@ -781,14 +805,13 @@ class FEProblem : /// A map of objects that consume random numbers std::map _random_data_objects; - void computeUserObjectsInternal(std::vector & user_objects, UserObjectWarehouse::GROUP group); + // Cache for calculating materials on side + std::vector > _block_mat_side_cache; -public: - /** - * Dimension of the subspace spanned by vectors with a given prefix. - * @param prefix Prefix of the vectors spanning the subspace. - */ - unsigned int subspaceDim(const std::string& prefix) const {if (_subspace_dim.count(prefix)) return _subspace_dim.find(prefix)->second; else return 0;} + // Cache for calculating materials on side + std::vector > _bnd_mat_side_cache; + + void computeUserObjectsInternal(std::vector & user_objects, UserObjectWarehouse::GROUP group); protected: void checkUserObjects(); diff --git a/framework/include/base/NonlinearSystem.h b/framework/include/base/NonlinearSystem.h index a2cf25cfab3c..48dbc42e1ec1 100644 --- a/framework/include/base/NonlinearSystem.h +++ b/framework/include/base/NonlinearSystem.h @@ -33,6 +33,8 @@ #include "libmesh/sparse_matrix.h" #include "libmesh/petsc_matrix.h" #include "libmesh/coupling_matrix.h" +#include "libmesh/libmesh_common.h" +#include LIBMESH_INCLUDE_UNORDERED_MAP class FEProblem; class MoosePreconditioner; @@ -389,9 +391,17 @@ class NonlinearSystem : public SystemTempl Moose::PCSideType getPCSide() { return _pc_side; } - bool doingDG() { return _doing_dg; } + /** + * Indicated whether this system needs material properties on boundaries. + * @return Boolean if IntegratedBCs are active + */ + bool needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid) const; - bool hasActiveIntegratedBCs(BoundaryID bnd_id, THREAD_ID tid) { return ! _bcs[tid].activeIntegrated(bnd_id).empty(); } + /** + * Indicates whether this system needs material properties on internal sides. + * @return Boolean if DGKernels are active + */ + bool needMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid) const; public: FEProblem & _fe_problem; diff --git a/framework/include/base/ProjectMaterialProperties.h b/framework/include/base/ProjectMaterialProperties.h index b74c434c7a87..74d8cb859bbe 100644 --- a/framework/include/base/ProjectMaterialProperties.h +++ b/framework/include/base/ProjectMaterialProperties.h @@ -58,6 +58,7 @@ class ProjectMaterialProperties : public ThreadedElementLoop & _materials; std::vector & _assembly; + bool _need_internal_side_material; }; #endif //PROJECTMATERIALPROPERTIES_H diff --git a/framework/include/base/ThreadedElementLoopBase.h b/framework/include/base/ThreadedElementLoopBase.h index 2cc530ca3824..cabb95d54fd9 100644 --- a/framework/include/base/ThreadedElementLoopBase.h +++ b/framework/include/base/ThreadedElementLoopBase.h @@ -17,6 +17,7 @@ #include "ParallelUniqueId.h" #include "MooseMesh.h" +#include "MooseTypes.h" /** * Base class for assembling-like calculations @@ -88,10 +89,10 @@ class ThreadedElementLoopBase THREAD_ID _tid; /// The subdomain for the current element - unsigned int _subdomain; + SubdomainID _subdomain; /// The subdomain for the last element - unsigned int _old_subdomain; + SubdomainID _old_subdomain; }; diff --git a/framework/include/bcs/BCWarehouse.h b/framework/include/bcs/BCWarehouse.h index d64001e71c4b..0187dd67310d 100644 --- a/framework/include/bcs/BCWarehouse.h +++ b/framework/include/bcs/BCWarehouse.h @@ -67,21 +67,21 @@ class BCWarehouse * @param boundary_id Boundary ID * @return Set of active integrated BCs */ - std::vector activeIntegrated(BoundaryID boundary_id); + std::vector activeIntegrated(BoundaryID boundary_id) const; /** * Get active nodal boundary conditions * @param boundary_id Boundary ID * @return Set of active nodal BCs */ - std::vector activeNodal(BoundaryID boundary_id); + std::vector activeNodal(BoundaryID boundary_id) const; /** * Get active preset nodal boundary conditions * @param boundary_id Boundary ID * @return Set of active preset nodal BCs */ - std::vector activePresetNodal(BoundaryID boundary_id); + std::vector activePresetNodal(BoundaryID boundary_id) const; protected: /// integrated boundary conditions on a boundary diff --git a/framework/src/base/AuxiliarySystem.C b/framework/src/base/AuxiliarySystem.C index 796f7c44fe02..047554472637 100644 --- a/framework/src/base/AuxiliarySystem.C +++ b/framework/src/base/AuxiliarySystem.C @@ -418,3 +418,14 @@ AuxiliarySystem::getMinQuadratureOrder() return order; } + +bool +AuxiliarySystem::needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid) +{ + for (unsigned int i=0; i < Moose::exec_types.size(); ++i) + if (!_auxs(Moose::exec_types[i])[0].activeBCs(bnd_id).empty() || + !_auxs(Moose::exec_types[i])[0].activeBCs(Moose::ANY_BOUNDARY_ID).empty()) + return true; + + return false; +} diff --git a/framework/src/base/ComputeMaterialsObjectThread.C b/framework/src/base/ComputeMaterialsObjectThread.C index bfc08127a45b..ef1505f1961a 100644 --- a/framework/src/base/ComputeMaterialsObjectThread.C +++ b/framework/src/base/ComputeMaterialsObjectThread.C @@ -37,7 +37,8 @@ ThreadedElementLoop(fe_problem, sys), _material_props(material_props), _bnd_material_props(bnd_material_props), _materials(materials), - _assembly(assembly) + _assembly(assembly), + _need_internal_side_material(false) { } @@ -51,7 +52,8 @@ ComputeMaterialsObjectThread::ComputeMaterialsObjectThread(ComputeMaterialsObjec _material_props(x._material_props), _bnd_material_props(x._bnd_material_props), _materials(x._materials), - _assembly(x._assembly) + _assembly(x._assembly), + _need_internal_side_material(x._need_internal_side_material) { } @@ -62,6 +64,8 @@ ComputeMaterialsObjectThread::~ComputeMaterialsObjectThread() void ComputeMaterialsObjectThread::subdomainChanged() { + _need_internal_side_material = _fe_problem.needMaterialOnSide(_subdomain, _tid); + mooseAssert(_materials[_tid].hasMaterials(_subdomain), "No materials on subdomain block"); _fe_problem.subdomainSetup(_subdomain, _tid); } @@ -78,25 +82,25 @@ ComputeMaterialsObjectThread::onElement(const Elem *elem) void ComputeMaterialsObjectThread::onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id) { -// if (!_sys.hasActiveIntegratedBCs(bnd_id, _tid) && !_sys.doingDG()) -// return; - - _fe_problem.setCurrentBoundaryID(bnd_id); - _assembly[_tid]->reinit(elem, side); - unsigned int n_points = _assembly[_tid]->qRuleFace()->n_points(); - _bnd_material_props.initStatefulProps(*_bnd_material_data[_tid], _materials[_tid].getFaceMaterials(_subdomain), n_points, *elem, side); - _fe_problem.setCurrentBoundaryID(Moose::INVALID_BOUNDARY_ID); + if (_fe_problem.needMaterialOnSide(bnd_id, _tid)) + { + _fe_problem.setCurrentBoundaryID(bnd_id); + _assembly[_tid]->reinit(elem, side); + unsigned int n_points = _assembly[_tid]->qRuleFace()->n_points(); + _bnd_material_props.initStatefulProps(*_bnd_material_data[_tid], _materials[_tid].getFaceMaterials(_subdomain), n_points, *elem, side); + _fe_problem.setCurrentBoundaryID(Moose::INVALID_BOUNDARY_ID); + } } void ComputeMaterialsObjectThread::onInternalSide(const Elem *elem, unsigned int side) { - if (!_sys.doingDG()) - return; - - _assembly[_tid]->reinit(elem, side); - unsigned int n_points = _assembly[_tid]->qRuleFace()->n_points(); - _bnd_material_props.initStatefulProps(*_bnd_material_data[_tid], _materials[_tid].getFaceMaterials(_subdomain), n_points, *elem, side); + if (_need_internal_side_material) + { + _assembly[_tid]->reinit(elem, side); + unsigned int n_points = _assembly[_tid]->qRuleFace()->n_points(); + _bnd_material_props.initStatefulProps(*_bnd_material_data[_tid], _materials[_tid].getFaceMaterials(_subdomain), n_points, *elem, side); + } } void diff --git a/framework/src/base/FEProblem.C b/framework/src/base/FEProblem.C index a82406377472..d7de3e1af503 100644 --- a/framework/src/base/FEProblem.C +++ b/framework/src/base/FEProblem.C @@ -206,6 +206,9 @@ FEProblem::FEProblem(const std::string & name, InputParameters parameters) : _active_elemental_moose_variables.resize(n_threads); + _block_mat_side_cache.resize(n_threads); + _bnd_mat_side_cache.resize(n_threads); + _resurrector = new Resurrector(*this); _eq.parameters.set("_fe_problem") = this; @@ -1894,7 +1897,8 @@ FEProblem::addUserObject(std::string user_object_name, const std::string & name, // Set a pointer to the correct material data; assume that it is a non-boundary material unless proven // to be otherwise MaterialData * mat_data = _material_data[tid]; - if (parameters.have_parameter >("boundary") && !parameters.have_parameter("block_restricted_nodal")) + if ((parameters.isParamValid("use_bnd_material") && parameters.get("use_bnd_material")) || + (parameters.have_parameter >("boundary") && !parameters.have_parameter("block_restricted_nodal"))) mat_data = _bnd_material_data[tid]; if (_displaced_problem != NULL && parameters.get("use_displaced_mesh")) @@ -3743,3 +3747,51 @@ FEProblem::registerRandomInterface(RandomInterface & random_interface, const std else random_interface.setRandomDataPointer(_random_data_objects[name]); } + +bool +FEProblem::needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid) +{ + if (_bnd_mat_side_cache[tid].find(bnd_id) == _bnd_mat_side_cache[tid].end()) + { + _bnd_mat_side_cache[tid][bnd_id] = false; + + if (_nl.needMaterialOnSide(bnd_id, tid) || _aux.needMaterialOnSide(bnd_id, tid)) + _bnd_mat_side_cache[tid][bnd_id] = true; + else + { + for (unsigned int i=0; i < Moose::exec_types.size(); ++i) + if (!_user_objects(Moose::exec_types[i])[tid].sideUserObjects(bnd_id).empty() || + !_user_objects(Moose::exec_types[i])[tid].sideUserObjects(Moose::ANY_BOUNDARY_ID).empty()) + { + _bnd_mat_side_cache[tid][bnd_id] = true; + break; + } + } + } + + return _bnd_mat_side_cache[tid][bnd_id]; +} + +bool +FEProblem::needMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid) +{ + if (_block_mat_side_cache[tid].find(subdomain_id) == _block_mat_side_cache[tid].end()) + { + _block_mat_side_cache[tid][subdomain_id] = false; + + if (_nl.needMaterialOnSide(subdomain_id, tid)) + _block_mat_side_cache[tid][subdomain_id] = true; + else + { + for (unsigned int i=0; i < Moose::exec_types.size(); ++i) + if (!_user_objects(Moose::exec_types[i])[tid].internalSideUserObjects(subdomain_id).empty() || + !_user_objects(Moose::exec_types[i])[tid].internalSideUserObjects(Moose::ANY_BLOCK_ID).empty()) + { + _block_mat_side_cache[tid][subdomain_id] = true; + break; + } + } + } + + return _block_mat_side_cache[tid][subdomain_id]; +} diff --git a/framework/src/base/NonlinearSystem.C b/framework/src/base/NonlinearSystem.C index 1b1525730eb6..03ef9208a042 100644 --- a/framework/src/base/NonlinearSystem.C +++ b/framework/src/base/NonlinearSystem.C @@ -2215,3 +2215,15 @@ NonlinearSystem::setPCSide(MooseEnum pcs) else mooseError("Unknown PC side specified."); } + +bool +NonlinearSystem::needMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid) const +{ + return !_bcs[tid].activeIntegrated(bnd_id).empty(); +} + +bool +NonlinearSystem::needMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid) const +{ + return _doing_dg; +} diff --git a/framework/src/base/ProjectMaterialProperties.C b/framework/src/base/ProjectMaterialProperties.C index f8c609a98fad..8def82de72ba 100644 --- a/framework/src/base/ProjectMaterialProperties.C +++ b/framework/src/base/ProjectMaterialProperties.C @@ -40,7 +40,8 @@ ProjectMaterialProperties::ProjectMaterialProperties(bool refine, _material_props(material_props), _bnd_material_props(bnd_material_props), _materials(materials), - _assembly(assembly) + _assembly(assembly), + _need_internal_side_material(false) { } @@ -55,7 +56,8 @@ ProjectMaterialProperties::ProjectMaterialProperties(ProjectMaterialProperties & _material_props(x._material_props), _bnd_material_props(x._bnd_material_props), _materials(x._materials), - _assembly(x._assembly) + _assembly(x._assembly), + _need_internal_side_material(x._need_internal_side_material) { } @@ -66,6 +68,7 @@ ProjectMaterialProperties::~ProjectMaterialProperties() void ProjectMaterialProperties::subdomainChanged() { + _need_internal_side_material = _fe_problem.needMaterialOnSide(_subdomain, _tid); } void @@ -102,56 +105,53 @@ ProjectMaterialProperties::onElement(const Elem *elem) void ProjectMaterialProperties::onBoundary(const Elem *elem, unsigned int side, BoundaryID bnd_id) { - // Set the active boundary id so that BoundaryRestrictable::_boundary_id is correct - _fe_problem.setCurrentBoundaryID(bnd_id); - - if (!_sys.hasActiveIntegratedBCs(bnd_id, _tid)) - return; + if (_fe_problem.needMaterialOnSide(bnd_id, _tid)) + { + // Set the active boundary id so that BoundaryRestrictable::_boundary_id is correct + _fe_problem.setCurrentBoundaryID(bnd_id); - _assembly[_tid]->reinit(elem, side); + _assembly[_tid]->reinit(elem, side); - if (_refine) - { - const std::vector > & refinement_map = _mesh.getRefinementMap(*elem, side, -1, side); - - _bnd_material_props.prolongStatefulProps(refinement_map, - *_assembly[_tid]->qRule(), - *_assembly[_tid]->qRuleFace(), - _bnd_material_props, // Passing in the same properties to do side_to_side projection - *_bnd_material_data[_tid], - *elem, - side,-1,side); // Gets us side to side projection - } - else - { - const std::vector > & coarsening_map = _mesh.getCoarseningMap(*elem, side); - - _bnd_material_props.restrictStatefulProps(coarsening_map, - _mesh.coarsenedElementChildren(elem), - *_assembly[_tid]->qRule(), - *_assembly[_tid]->qRuleFace(), - *_material_data[_tid], - *elem, side); - } + if (_refine) + { + const std::vector > & refinement_map = _mesh.getRefinementMap(*elem, side, -1, side); + + _bnd_material_props.prolongStatefulProps(refinement_map, + *_assembly[_tid]->qRule(), + *_assembly[_tid]->qRuleFace(), + _bnd_material_props, // Passing in the same properties to do side_to_side projection + *_bnd_material_data[_tid], + *elem, + side,-1,side); // Gets us side to side projection + } + else + { + const std::vector > & coarsening_map = _mesh.getCoarseningMap(*elem, side); + + _bnd_material_props.restrictStatefulProps(coarsening_map, + _mesh.coarsenedElementChildren(elem), + *_assembly[_tid]->qRule(), + *_assembly[_tid]->qRuleFace(), + *_material_data[_tid], + *elem, side); + } - // Set the active boundary id to invalid - _fe_problem.setCurrentBoundaryID(Moose::INVALID_BOUNDARY_ID); + // Set the active boundary id to invalid + _fe_problem.setCurrentBoundaryID(Moose::INVALID_BOUNDARY_ID); + } } void ProjectMaterialProperties::onInternalSide(const Elem *elem, unsigned int /*side*/) { - if (!_sys.doingDG()) - return; - - if (_refine) // If we're refining then we need to also project "internal" child sides. + if (_need_internal_side_material && _refine) // If we're refining then we need to also project "internal" child sides. { - for(unsigned int child=0; childn_children(); child++) + for (unsigned int child=0; childn_children(); child++) { Elem * child_elem = elem->child(child); - for(unsigned int side=0; siden_sides(); side++) + for (unsigned int side=0; siden_sides(); side++) { if (!elem->is_child_on_side(child, side)) // Otherwise we already projected it { diff --git a/framework/src/bcs/BCWarehouse.C b/framework/src/bcs/BCWarehouse.C index 91d5d95c5e77..d626c24ac428 100644 --- a/framework/src/bcs/BCWarehouse.C +++ b/framework/src/bcs/BCWarehouse.C @@ -130,31 +130,40 @@ BCWarehouse::activeBoundaries(std::set & bnds) const } std::vector -BCWarehouse::activeIntegrated(BoundaryID boundary_id) +BCWarehouse::activeIntegrated(BoundaryID boundary_id) const { std::vector active; - for (std::vector::iterator it = _bcs[boundary_id].begin(); it != _bcs[boundary_id].end(); ++it) - if ((*it)->isActive()) - active.push_back(*it); + + if (_bcs.find(boundary_id) != _bcs.end()) + for (std::vector::const_iterator it = _bcs.at(boundary_id).begin(); it != _bcs.at(boundary_id).end(); ++it) + if ((*it)->isActive()) + active.push_back(*it); + return active; } std::vector -BCWarehouse::activeNodal(BoundaryID boundary_id) +BCWarehouse::activeNodal(BoundaryID boundary_id) const { std::vector active; - for (std::vector::iterator it = _nodal_bcs[boundary_id].begin(); it != _nodal_bcs[boundary_id].end(); ++it) - if ((*it)->isActive()) - active.push_back(*it); + + if (_nodal_bcs.find(boundary_id) != _nodal_bcs.end()) + for (std::vector::const_iterator it = _nodal_bcs.at(boundary_id).begin(); it != _nodal_bcs.at(boundary_id).end(); ++it) + if ((*it)->isActive()) + active.push_back(*it); + return active; } std::vector -BCWarehouse::activePresetNodal(BoundaryID boundary_id) +BCWarehouse::activePresetNodal(BoundaryID boundary_id) const { std::vector active; - for (std::vector::iterator it = _preset_nodal_bcs[boundary_id].begin(); it != _preset_nodal_bcs[boundary_id].end(); ++it) - if ((*it)->isActive()) - active.push_back(*it); + + if (_preset_nodal_bcs.find(boundary_id) != _preset_nodal_bcs.end()) + for (std::vector::const_iterator it = _preset_nodal_bcs.at(boundary_id).begin(); it != _preset_nodal_bcs.at(boundary_id).end(); ++it) + if ((*it)->isActive()) + active.push_back(*it); + return active; } diff --git a/framework/src/userobject/InternalSideUserObject.C b/framework/src/userobject/InternalSideUserObject.C index a46c8b48bcbe..98b65237b17a 100644 --- a/framework/src/userobject/InternalSideUserObject.C +++ b/framework/src/userobject/InternalSideUserObject.C @@ -19,7 +19,7 @@ InputParameters validParams() { InputParameters params = validParams(); params += validParams(); - //params.addParam( + params.addPrivateParam("use_bnd_material", true); return params; } diff --git a/test/include/userobjects/InsideUserObject.h b/test/include/userobjects/InsideUserObject.h index 5cd2a7b135ca..099ed2b6a724 100644 --- a/test/include/userobjects/InsideUserObject.h +++ b/test/include/userobjects/InsideUserObject.h @@ -43,6 +43,8 @@ class InsideUserObject : public InternalSideUserObject VariableValue & _u_neighbor; Real _value; + std::string _diffusivity; + MaterialProperty * _diffusivity_prop; }; #endif /* INSIDEUSEROBJECT_H */ diff --git a/test/src/userobjects/InsideUserObject.C b/test/src/userobjects/InsideUserObject.C index ee44b4311f95..db865acccd2b 100644 --- a/test/src/userobjects/InsideUserObject.C +++ b/test/src/userobjects/InsideUserObject.C @@ -18,6 +18,8 @@ template<> InputParameters validParams() { InputParameters params = validParams(); + params.addParam("diffusivity", "The name of the diffusivity material property that will be used in the flux computation."); + params.addParam("use_old_prop", false, "A Boolean to indicate whether the current or old value of a material prop should be used."); params.addRequiredCoupledVar("variable", "the variable name"); return params; @@ -27,7 +29,9 @@ InsideUserObject::InsideUserObject(const std::string & name, InputParameters par InternalSideUserObject(name, parameters), _u(coupledValue("variable")), _u_neighbor(coupledNeighborValue("variable")), - _value(0.) + _value(0.), + _diffusivity(parameters.get("diffusivity")), + _diffusivity_prop(isParamValid("diffusivity") ? (getParam("use_old_prop") ? &getMaterialPropertyOld(_diffusivity) : &getMaterialProperty(_diffusivity)) : NULL) { } @@ -45,7 +49,7 @@ void InsideUserObject::execute() { for (unsigned int qp = 0; qp < _q_point.size(); ++qp) - _value += std::pow(_u[qp] - _u_neighbor[qp], 2); + _value += std::pow(_u[qp] - _u_neighbor[qp], 2) + (_diffusivity_prop ? (*_diffusivity_prop)[qp] : 0); } void diff --git a/test/tests/materials/stateful_internal_side_uo/gold/internal_side_uo_stateful_out.e b/test/tests/materials/stateful_internal_side_uo/gold/internal_side_uo_stateful_out.e new file mode 100644 index 000000000000..7f16620967c8 Binary files /dev/null and b/test/tests/materials/stateful_internal_side_uo/gold/internal_side_uo_stateful_out.e differ diff --git a/test/tests/materials/stateful_internal_side_uo/internal_side_uo_stateful.i b/test/tests/materials/stateful_internal_side_uo/internal_side_uo_stateful.i new file mode 100644 index 000000000000..d06d5511f04c --- /dev/null +++ b/test/tests/materials/stateful_internal_side_uo/internal_side_uo_stateful.i @@ -0,0 +1,96 @@ +[Mesh] + type = GeneratedMesh + dim = 2 + xmin = -1 + ymin = -1 + xmax = 1 + ymax = 1 + nx = 2 + ny = 2 + elem_type = QUAD4 +[] + +[Functions] + [./fn_exact] + type = ParsedFunction + value = 'x*x+y*y' + [../] + + [./ffn] + type = ParsedFunction + value = -4 + [../] +[] + +[UserObjects] + [./isuo] + type = InsideUserObject + variable = u + diffusivity = diffusivity +# use_old_prop = true # Access a stateful material on an internal side + [../] +[] + +[Variables] + [./u] + family = LAGRANGE + order = FIRST + [../] +[] + +[Kernels] + [./diff] + type = Diffusion + variable = u + [../] + + [./ffn] + type = UserForcingFunction + variable = u + function = ffn + [../] + + [./time] + type = TimeDerivative + variable = u + [../] +[] + +[BCs] + [./all] + type = FunctionDirichletBC + variable = u + boundary = '0 1 2 3' + function = fn_exact + [../] +[] + +[Postprocessors] + [./value] + type = InsideValuePPS + user_object = isuo + [../] +[] + +[Executioner] + type = Transient + dt = 0.1 + num_steps = 5 +[] + +[Materials] + [./stateful] + type = StatefulMaterial + block = 0 + [../] +[] + +[Outputs] + output_initial = true + exodus = true + [./console] + type = Console + perf_log = true + linear_residuals = true + [../] +[] diff --git a/test/tests/materials/stateful_internal_side_uo/tests b/test/tests/materials/stateful_internal_side_uo/tests new file mode 100644 index 000000000000..21b9d7c19b63 --- /dev/null +++ b/test/tests/materials/stateful_internal_side_uo/tests @@ -0,0 +1,7 @@ +[Tests] + [./test] + type = 'Exodiff' + input = 'internal_side_uo_stateful.i' + exodiff = 'internal_side_uo_stateful_out.e' + [../] +[]