www.mooseframework.org
TestSubblockIndexProvider.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 
11 
12 registerMooseObject("SolidMechanicsTestApp", TestSubblockIndexProvider);
13 
16 {
18  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
19  return params;
20 }
21 
23  : GeneralUserObject(params)
24 {
25 }
26 
27 unsigned int
29 {
30  Point p = *elem.node_ptr(0);
31 
32  if (MooseUtils::relativeFuzzyLessThan(p(0), 0.5))
33  return 0;
34  else
35  return 1;
36 }
37 
38 unsigned int
40 {
41  return 1;
42 }
static InputParameters validParams()
T & set(const std::string &name, bool quiet_mode=false)
virtual unsigned int getMaxSubblockIndex() const override
The max index of subblock.
TestSubblockIndexProvider(const InputParameters &params)
A class used to set the subblock index for testing generalized plane strain calculations when more th...
registerMooseObject("SolidMechanicsTestApp", TestSubblockIndexProvider)
virtual unsigned int getSubblockIndex(const Elem &) const override
The index of subblock this element is on.
static InputParameters validParams()
bool relativeFuzzyLessThan(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
const ExecFlagType EXEC_INITIAL