www.mooseframework.org
PETScDMDAMesh.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
14 class PETScDMDAMesh;
15 
16 template <>
17 InputParameters validParams<PETScDMDAMesh>();
18 
27 class PETScDMDAMesh : public MooseMesh
28 {
29 public:
30  PETScDMDAMesh(const InputParameters & parameters);
31  PETScDMDAMesh(const PETScDMDAMesh & /* other_mesh */) = default;
32 
33 #if LIBMESH_HAVE_PETSC
35  {
37  DMDestroy(&_dmda);
38  }
39 #endif
40  // No copy
41  PETScDMDAMesh & operator=(const PETScDMDAMesh & other_mesh) = delete;
42 
43  virtual std::unique_ptr<MooseMesh> safeClone() const override;
44 
45  virtual void buildMesh() override;
46  virtual Real getMinInDimension(unsigned int component) const override;
47  virtual Real getMaxInDimension(unsigned int component) const override;
48 
49 protected:
51  MooseEnum _dim;
52 
54  dof_id_type _nx, _ny, _nz;
55 
58 
60  ElemType _elem_type;
61 
64 #if LIBMESH_HAVE_PETSC
65  DM _dmda;
67 #endif
68 };
69 
PETScDMDAMesh::safeClone
virtual std::unique_ptr< MooseMesh > safeClone() const override
Definition: PETScDMDAMesh.C:165
PETScDMDAMesh::getMaxInDimension
virtual Real getMaxInDimension(unsigned int component) const override
Definition: PETScDMDAMesh.C:149
PETScDMDAMesh::operator=
PETScDMDAMesh & operator=(const PETScDMDAMesh &other_mesh)=delete
PETScDMDAMesh::_ymin
Real _ymin
Definition: PETScDMDAMesh.h:57
validParams< PETScDMDAMesh >
InputParameters validParams< PETScDMDAMesh >()
Definition: PETScDMDAMesh.C:36
PETScDMDAMesh::_zmax
Real _zmax
Definition: PETScDMDAMesh.h:57
PETScDMDAMesh::_xmin
Real _xmin
The min/max values for x,y,z component.
Definition: PETScDMDAMesh.h:57
PETScDMDAMesh::_nz
dof_id_type _nz
Definition: PETScDMDAMesh.h:54
PETScDMDAMesh::getMinInDimension
virtual Real getMinInDimension(unsigned int component) const override
Definition: PETScDMDAMesh.C:133
PETScDMDAMesh::_zmin
Real _zmin
Definition: PETScDMDAMesh.h:57
PETScDMDAMesh::_ny
dof_id_type _ny
Definition: PETScDMDAMesh.h:54
PETScDMDAMesh
Generate a parallel (distributed) mesh from PETSc DMDA.
Definition: PETScDMDAMesh.h:27
PETScDMDAMesh::_xmax
Real _xmax
Definition: PETScDMDAMesh.h:57
MaterialTensorCalculatorTools::component
Real component(const SymmTensor &symm_tensor, unsigned int index)
Definition: MaterialTensorCalculatorTools.C:16
PETScDMDAMesh::_dmda
DM _dmda
Mesh object.
Definition: PETScDMDAMesh.h:66
PETScDMDAMesh::buildMesh
virtual void buildMesh() override
Definition: PETScDMDAMesh.C:517
PETScDMDAMesh::_nx
dof_id_type _nx
Number of elements in x, y, z direction.
Definition: PETScDMDAMesh.h:54
PETScDMDAMesh::~PETScDMDAMesh
~PETScDMDAMesh()
Definition: PETScDMDAMesh.h:34
PETScDMDAMesh::_need_to_destroy_dmda
bool _need_to_destroy_dmda
If DMDA is created on the fly, we should destroy it.
Definition: PETScDMDAMesh.h:63
PETScDMDAMesh::PETScDMDAMesh
PETScDMDAMesh(const InputParameters &parameters)
Definition: PETScDMDAMesh.C:72
PETScDMDAMesh::_elem_type
ElemType _elem_type
The type of element to build.
Definition: PETScDMDAMesh.h:60
PETScDMDAMesh::_dim
MooseEnum _dim
The dimension of the mesh.
Definition: PETScDMDAMesh.h:51
PETScDMDAMesh::_ymax
Real _ymax
Definition: PETScDMDAMesh.h:57