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 
dof_id_type _nx
Number of elements in x, y, z direction.
Definition: PETScDMDAMesh.h:54
dof_id_type _nz
Definition: PETScDMDAMesh.h:54
InputParameters validParams< PETScDMDAMesh >()
Definition: PETScDMDAMesh.C:36
dof_id_type _ny
Definition: PETScDMDAMesh.h:54
Real component(const SymmTensor &symm_tensor, unsigned int index)
PETScDMDAMesh & operator=(const PETScDMDAMesh &other_mesh)=delete
ElemType _elem_type
The type of element to build.
Definition: PETScDMDAMesh.h:60
virtual std::unique_ptr< MooseMesh > safeClone() const override
virtual Real getMinInDimension(unsigned int component) const override
Generate a parallel (distributed) mesh from PETSc DMDA.
Definition: PETScDMDAMesh.h:27
MooseEnum _dim
The dimension of the mesh.
Definition: PETScDMDAMesh.h:51
DM _dmda
Mesh object.
Definition: PETScDMDAMesh.h:66
bool _need_to_destroy_dmda
If DMDA is created on the fly, we should destroy it.
Definition: PETScDMDAMesh.h:63
Real _xmin
The min/max values for x,y,z component.
Definition: PETScDMDAMesh.h:57
virtual void buildMesh() override
virtual Real getMaxInDimension(unsigned int component) const override
PETScDMDAMesh(const InputParameters &parameters)
Definition: PETScDMDAMesh.C:72