forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement variable check for some boundary restricted objects
Makes sure that variable dependencies have degrees of freedom on all nodes along the boundaries of a boundary restricted object Closes idaholab#9734
- Loading branch information
Showing
11 changed files
with
348 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
framework/include/loops/BoundaryNodeIntegrityCheckThread.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
// MOOSE includes | ||
#include "MooseMesh.h" | ||
#include "ThreadedNodeLoop.h" | ||
#include "TheWarehouse.h" | ||
|
||
class AuxiliarySystem; | ||
|
||
class BoundaryNodeIntegrityCheckThread | ||
: public ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator> | ||
{ | ||
public: | ||
BoundaryNodeIntegrityCheckThread(FEProblemBase & fe_problem, const TheWarehouse::Query & query); | ||
|
||
// Splitting Constructor | ||
BoundaryNodeIntegrityCheckThread(BoundaryNodeIntegrityCheckThread & x, Threads::split split); | ||
|
||
virtual void onNode(ConstBndNodeRange::const_iterator & node_it) override; | ||
|
||
void join(const BoundaryNodeIntegrityCheckThread & /*y*/); | ||
|
||
protected: | ||
/// The auxiliary system to whom we'll delegate the boundary variable dependency integrity check | ||
const AuxiliarySystem & _aux_sys; | ||
|
||
/// A warehouse query that we will use to obtain user objects for boundary variable dependency | ||
/// integrity checks | ||
const TheWarehouse::Query & _query; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
// MOOSE includes | ||
#include "BoundaryNodeIntegrityCheckThread.h" | ||
#include "AuxiliarySystem.h" | ||
#include "FEProblem.h" | ||
#include "AuxKernel.h" | ||
#include "NodalUserObject.h" | ||
|
||
#include "libmesh/threads.h" | ||
#include "libmesh/node.h" | ||
|
||
BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread( | ||
FEProblemBase & fe_problem, const TheWarehouse::Query & query) | ||
: ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(fe_problem), | ||
_aux_sys(fe_problem.getAuxiliarySystem()), | ||
_query(query) | ||
{ | ||
} | ||
|
||
// Splitting Constructor | ||
BoundaryNodeIntegrityCheckThread::BoundaryNodeIntegrityCheckThread( | ||
BoundaryNodeIntegrityCheckThread & x, Threads::split split) | ||
: ThreadedNodeLoop<ConstBndNodeRange, ConstBndNodeRange::const_iterator>(x, split), | ||
_aux_sys(x._aux_sys), | ||
_query(x._query) | ||
{ | ||
} | ||
|
||
void | ||
BoundaryNodeIntegrityCheckThread::onNode(ConstBndNodeRange::const_iterator & node_it) | ||
{ | ||
const BndNode * const bnode = *node_it; | ||
const auto boundary_id = bnode->_bnd_id; | ||
const Node * const node = bnode->_node; | ||
|
||
if (node->processor_id() != _fe_problem.processor_id()) | ||
return; | ||
|
||
// aux check | ||
_aux_sys.boundaryAuxKernelIntegrityCheck(*node, boundary_id, _tid); | ||
|
||
// uo check | ||
std::vector<NodalUserObject *> objs; | ||
_query.clone() | ||
.condition<AttribThread>(_tid) | ||
.condition<AttribInterfaces>(Interfaces::NodalUserObject) | ||
.condition<AttribBoundaries>(boundary_id, true) | ||
.queryInto(objs); | ||
for (const auto & uo : objs) | ||
{ | ||
const auto & mv_deps = uo->getMooseVariableDependencies(); | ||
for (const auto * const var : mv_deps) | ||
if (!node->n_dofs(var->sys().number(), var->number())) | ||
mooseError("Nodal user object '", | ||
uo->name(), | ||
"' depends on variable '", | ||
var->name(), | ||
"'. However, that variable does not have degrees of freedom on node with id ", | ||
node->id()); | ||
} | ||
} | ||
|
||
void | ||
BoundaryNodeIntegrityCheckThread::join(const BoundaryNodeIntegrityCheckThread & /*y*/) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.