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 23 of file MortarPeriodicMesh.h.

Constructor & Destructor Documentation

MortarPeriodicMesh::MortarPeriodicMesh ( const InputParameters &  parameters)

Definition at line 27 of file MortarPeriodicMesh.C.

Referenced by clone().

28  : GeneratedMesh(parameters),
29  _periodic_dirs(getParam<MultiMooseEnum>("periodic_directions")),
30  _mortar_subdomains(_dim, Moose::INVALID_BLOCK_ID)
31 {
32 }
MultiMooseEnum _periodic_dirs
periodic directions
std::vector< SubdomainID > _mortar_subdomains
MortarPeriodicMesh::MortarPeriodicMesh ( const MortarPeriodicMesh other_mesh)

Definition at line 34 of file MortarPeriodicMesh.C.

35  : GeneratedMesh(other_mesh),
36  _periodic_dirs(other_mesh._periodic_dirs),
38 {
39 }
MultiMooseEnum _periodic_dirs
periodic directions
std::vector< SubdomainID > _mortar_subdomains
MortarPeriodicMesh::~MortarPeriodicMesh ( )
virtual

Definition at line 41 of file MortarPeriodicMesh.C.

41 {}

Member Function Documentation

void MortarPeriodicMesh::buildMesh ( )
protectedvirtual

Definition at line 50 of file MortarPeriodicMesh.C.

Referenced by getPeriodicDirections().

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

Definition at line 44 of file MortarPeriodicMesh.C.

45 {
46  return *(new MortarPeriodicMesh(*this));
47 }
MortarPeriodicMesh(const InputParameters &parameters)
const std::vector<SubdomainID>& MortarPeriodicMesh::getMortarSubdomains ( ) const
inline

{@ public interfaces for the mortar periodicity action

Definition at line 33 of file MortarPeriodicMesh.h.

33 { return _mortar_subdomains; }
std::vector< SubdomainID > _mortar_subdomains
const MultiMooseEnum& MortarPeriodicMesh::getPeriodicDirections ( ) const
inline

Definition at line 34 of file MortarPeriodicMesh.h.

34 { return _periodic_dirs; }
MultiMooseEnum _periodic_dirs
periodic directions

Member Data Documentation

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

Definition at line 44 of file MortarPeriodicMesh.h.

Referenced by buildMesh(), and getMortarSubdomains().

MultiMooseEnum MortarPeriodicMesh::_periodic_dirs
protected

periodic directions

Definition at line 41 of file MortarPeriodicMesh.h.

Referenced by buildMesh(), and getPeriodicDirections().


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