https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PatternedMesh.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
10#pragma once
11
12#include "MooseMesh.h"
13
14namespace libMesh
15{
16class ReplicatedMesh;
17}
18
30{
31public:
33
35 PatternedMesh(const PatternedMesh & other_mesh);
36 virtual ~PatternedMesh() = default;
37
38 virtual std::unique_ptr<MooseMesh> safeClone() const override;
39
40 virtual void buildMesh() override;
41
42protected:
43 // The mesh files to read
44 const std::vector<MeshFileName> & _files;
45
46 // The pattern, starting with the upper left corner
47 const std::vector<std::vector<unsigned int>> & _pattern;
48
49 // Pointer to the original "row" mesh to be repeated and stitched
50 ReplicatedMesh * _original_mesh;
51
52 // Holds the pointers to the meshes
53 std::vector<std::unique_ptr<ReplicatedMesh>> _meshes;
54
55 // Holds a mesh for each row, these will be stitched together in the end
56 std::vector<std::unique_ptr<ReplicatedMesh>> _row_meshes;
57
58 const Real _x_width;
59 const Real _y_width;
60 const Real _z_width;
61};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Reads one or more 2D mesh files and stitches them together based on a provided two-dimensional patter...
std::vector< std::unique_ptr< ReplicatedMesh > > _row_meshes
const Real _z_width
static InputParameters validParams()
virtual void buildMesh() override
Must be overridden by child classes.
const std::vector< std::vector< unsigned int > > & _pattern
virtual std::unique_ptr< MooseMesh > safeClone() const override
A safer version of the clone() method that hands back an allocated object wrapped in a smart pointer.
const Real _x_width
const std::vector< MeshFileName > & _files
virtual ~PatternedMesh()=default
std::vector< std::unique_ptr< ReplicatedMesh > > _meshes
ReplicatedMesh * _original_mesh
const Real _y_width
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...