www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
ContactDOFSetSize Class Reference

#include <ContactDOFSetSize.h>

Inheritance diagram for ContactDOFSetSize:
[legend]

Public Member Functions

 ContactDOFSetSize (const InputParameters &parameters)
 
void initialize () override
 
void execute () override
 
PostprocessorValue getValue () override
 

Private Attributes

const MooseVariableFEBase & _var
 MOOSE variable we compute the contact set from. More...
 
const MeshBase & _mesh
 The libmesh mesh. More...
 
const SubdomainID _subdomain_id
 The subdomain over which to query degrees of freedom. More...
 
const Real _tolerance
 The tolerance used to decide whether the variable indicates contact. More...
 
unsigned int _count
 Represents the number of values in contact. More...
 

Detailed Description

Definition at line 25 of file ContactDOFSetSize.h.

Constructor & Destructor Documentation

◆ ContactDOFSetSize()

ContactDOFSetSize::ContactDOFSetSize ( const InputParameters &  parameters)

Definition at line 37 of file ContactDOFSetSize.C.

38  : GeneralPostprocessor(parameters),
39  _var(_fe_problem.getVariable(_tid,
40  getParam<VariableName>("variable"),
41  Moose::VarKindType::VAR_NONLINEAR,
42  Moose::VarFieldType::VAR_FIELD_STANDARD)),
43  _mesh(_fe_problem.mesh().getMesh()),
44  _subdomain_id(_fe_problem.mesh().getSubdomainID(getParam<SubdomainName>("subdomain"))),
45  _tolerance(getParam<Real>("tolerance"))
46 {
47 }

Member Function Documentation

◆ execute()

void ContactDOFSetSize::execute ( )
override

Definition at line 56 of file ContactDOFSetSize.C.

57 {
58  AllLocalDofIndicesThread aldit(_fe_problem.getNonlinearSystemBase().system(), {_var.name()});
59 
60  // Get the element iterators corresponding to the subdomain id
61  auto elem_begin = _mesh.active_local_subdomain_elements_begin(_subdomain_id);
62  auto elem_end = _mesh.active_local_subdomain_elements_end(_subdomain_id);
63 
64  ConstElemRange range(elem_begin, elem_end);
65 
66  Threads::parallel_reduce(range, aldit);
67 
68  auto && solution = _fe_problem.getNonlinearSystemBase().solution();
69 
70  for (auto dof : aldit._all_dof_indices)
71  if (solution(dof) > _tolerance)
72  ++_count;
73 
74  gatherSum(_count);
75  _console << std::endl << "The number of nodes in contact is " << _count << std::endl << std::endl;
76 }

◆ getValue()

PostprocessorValue ContactDOFSetSize::getValue ( )
override

Definition at line 79 of file ContactDOFSetSize.C.

80 {
81  return _count;
82 }

◆ initialize()

void ContactDOFSetSize::initialize ( )
override

Definition at line 50 of file ContactDOFSetSize.C.

51 {
52  _count = 0;
53 }

Member Data Documentation

◆ _count

unsigned int ContactDOFSetSize::_count
private

Represents the number of values in contact.

Definition at line 49 of file ContactDOFSetSize.h.

Referenced by execute(), getValue(), and initialize().

◆ _mesh

const MeshBase& ContactDOFSetSize::_mesh
private

The libmesh mesh.

Definition at line 40 of file ContactDOFSetSize.h.

Referenced by execute().

◆ _subdomain_id

const SubdomainID ContactDOFSetSize::_subdomain_id
private

The subdomain over which to query degrees of freedom.

Definition at line 43 of file ContactDOFSetSize.h.

Referenced by execute().

◆ _tolerance

const Real ContactDOFSetSize::_tolerance
private

The tolerance used to decide whether the variable indicates contact.

Definition at line 46 of file ContactDOFSetSize.h.

Referenced by execute().

◆ _var

const MooseVariableFEBase& ContactDOFSetSize::_var
private

MOOSE variable we compute the contact set from.

Definition at line 37 of file ContactDOFSetSize.h.

Referenced by execute().


The documentation for this class was generated from the following files:
ContactDOFSetSize::_tolerance
const Real _tolerance
The tolerance used to decide whether the variable indicates contact.
Definition: ContactDOFSetSize.h:46
ContactDOFSetSize::_mesh
const MeshBase & _mesh
The libmesh mesh.
Definition: ContactDOFSetSize.h:40
ContactDOFSetSize::_var
const MooseVariableFEBase & _var
MOOSE variable we compute the contact set from.
Definition: ContactDOFSetSize.h:37
ContactDOFSetSize::_count
unsigned int _count
Represents the number of values in contact.
Definition: ContactDOFSetSize.h:49
ContactDOFSetSize::_subdomain_id
const SubdomainID _subdomain_id
The subdomain over which to query degrees of freedom.
Definition: ContactDOFSetSize.h:43