https://mooseframework.inl.gov
MeshGeneratorMesh.C
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 #include "MeshGeneratorMesh.h"
11 
12 #include "MeshGeneratorSystem.h"
13 #include "MooseApp.h"
14 
15 #include "libmesh/face_quad4.h"
16 #include "libmesh/face_tri3.h"
17 
19 
22 {
24  params.set<bool>("_mesh_generator_mesh") = true;
25 
26  params.addParam<std::string>("final_generator",
27  "The name of the mesh generator output to use for the final Mesh");
29  "Set to make all dependencies of this mesh generator run in data "
30  "driven mode, where a mesh is not generated");
31 
32  params.addClassDescription("Mesh generated using mesh generators");
33  return params;
34 }
35 
37 
38 std::unique_ptr<MooseMesh>
40 {
41  return _app.getFactory().copyConstruct(*this);
42 }
43 
44 void
46 {
47  if (!hasMeshBase())
48  mooseError("The mesh base has not been set");
49 }
static InputParameters validParams()
Typical "Moose-style" constructor and copy constructor.
Definition: MooseMesh.C:83
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::unique_ptr< T > copyConstruct(const T &object)
Copy constructs the object object.
Definition: Factory.h:310
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition: MooseApp.h:424
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...
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
virtual void buildMesh() override
Must be overridden by child classes.
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:84
MeshGeneratorMesh(const InputParameters &parameters)
registerMooseObject("MooseApp", MeshGeneratorMesh)
Mesh generated from parameters.
bool hasMeshBase() const
Whether mesh base object was constructed or not.
Definition: MooseMesh.h:1104
static const std::string data_driven_generator_param
The name of the string parameter that sets the data driven generator.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
static InputParameters validParams()