www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MortarPeriodicMesh Class Reference

Mesh generated from parameters with additional subdomains for mortar interfaces to enforce periodicity constraints. More...

#include <MortarPeriodicMesh.h>

Inheritance diagram for MortarPeriodicMesh:
[legend]

Public Member Functions

 MortarPeriodicMesh (const InputParameters &parameters)
 
 MortarPeriodicMesh (const MortarPeriodicMesh &other_mesh)
 
virtual ~MortarPeriodicMesh ()
 
virtual MooseMesh & clone () const
 
const std::vector< SubdomainID > & getMortarSubdomains () const
 {@ public interfaces for the mortar periodicity action More...
 
const MultiMooseEnum & getPeriodicDirections () const
 

Protected Member Functions

virtual void buildMesh ()
 

Protected Attributes

MultiMooseEnum _periodic_dirs
 periodic directions More...
 
std::vector< SubdomainID > _mortar_subdomains
 

Detailed Description

Mesh generated from parameters with additional subdomains for mortar interfaces to enforce periodicity constraints.

Definition at line 25 of file MortarPeriodicMesh.h.

Constructor & Destructor Documentation

◆ MortarPeriodicMesh() [1/2]

MortarPeriodicMesh::MortarPeriodicMesh ( const InputParameters &  parameters)

Definition at line 31 of file MortarPeriodicMesh.C.

Referenced by clone().

32  : GeneratedMesh(parameters),
33  _periodic_dirs(getParam<MultiMooseEnum>("periodic_directions")),
34  _mortar_subdomains(_dim, Moose::INVALID_BLOCK_ID)
35 {
36 }
MultiMooseEnum _periodic_dirs
periodic directions
std::vector< SubdomainID > _mortar_subdomains

◆ MortarPeriodicMesh() [2/2]

MortarPeriodicMesh::MortarPeriodicMesh ( const MortarPeriodicMesh other_mesh)

Definition at line 38 of file MortarPeriodicMesh.C.

39  : GeneratedMesh(other_mesh),
40  _periodic_dirs(other_mesh._periodic_dirs),
42 {
43 }
MultiMooseEnum _periodic_dirs
periodic directions
std::vector< SubdomainID > _mortar_subdomains

◆ ~MortarPeriodicMesh()

MortarPeriodicMesh::~MortarPeriodicMesh ( )
virtual

Definition at line 45 of file MortarPeriodicMesh.C.

45 {}

Member Function Documentation

◆ buildMesh()

void MortarPeriodicMesh::buildMesh ( )
protectedvirtual

Definition at line 54 of file MortarPeriodicMesh.C.

55 {
56  // build the main mesh
57  GeneratedMesh::buildMesh();
58 
59  // boundaries
60  const std::vector<BoundaryName> boundary_names = {"left", "bottom", "back"};
61 
62  buildBndElemList();
63 
64  // build side meshes
65  for (unsigned short i = 0; i < _dim; ++i)
66  if (_periodic_dirs.contains(i))
67  {
68  BoundaryID current_boundary_id = getBoundaryID(boundary_names[i]);
69 
70  for (auto it = bndElemsBegin(); it != bndElemsEnd(); ++it)
71  if ((*it)->_bnd_id == current_boundary_id)
72  {
73  Elem * elem = (*it)->_elem;
74  auto s = (*it)->_side;
75 
76  // build element from the side
77  std::unique_ptr<Elem> side(elem->build_side_ptr(s, false));
78  side->processor_id() = elem->processor_id();
79 
80  // Add the side set subdomain
81  Elem * new_elem = _mesh->add_elem(side.release());
82  _mortar_subdomains[i] = 10 + i;
83  new_elem->subdomain_id() = _mortar_subdomains[i];
84 
85  // TODO: this does not assign unique IDs
86  }
87  }
88 }
MultiMooseEnum _periodic_dirs
periodic directions
std::vector< SubdomainID > _mortar_subdomains

◆ clone()

MooseMesh & MortarPeriodicMesh::clone ( ) const
virtual

Definition at line 48 of file MortarPeriodicMesh.C.

49 {
50  return *(new MortarPeriodicMesh(*this));
51 }
MortarPeriodicMesh(const InputParameters &parameters)

◆ getMortarSubdomains()

const std::vector<SubdomainID>& MortarPeriodicMesh::getMortarSubdomains ( ) const
inline

{@ public interfaces for the mortar periodicity action

Definition at line 35 of file MortarPeriodicMesh.h.

35 { return _mortar_subdomains; }
std::vector< SubdomainID > _mortar_subdomains

◆ getPeriodicDirections()

const MultiMooseEnum& MortarPeriodicMesh::getPeriodicDirections ( ) const
inline

Definition at line 36 of file MortarPeriodicMesh.h.

36 { return _periodic_dirs; }
MultiMooseEnum _periodic_dirs
periodic directions

Member Data Documentation

◆ _mortar_subdomains

std::vector<SubdomainID> MortarPeriodicMesh::_mortar_subdomains
protected

Definition at line 46 of file MortarPeriodicMesh.h.

Referenced by buildMesh(), and getMortarSubdomains().

◆ _periodic_dirs

MultiMooseEnum MortarPeriodicMesh::_periodic_dirs
protected

periodic directions

Definition at line 43 of file MortarPeriodicMesh.h.

Referenced by buildMesh(), and getPeriodicDirections().


The documentation for this class was generated from the following files: