Permalink
Browse files

Merge pull request #12704 from snschune/Cartesian_mesh_12693

Add Cartesian Mesh
  • Loading branch information...
permcody committed Jan 31, 2019
2 parents 4e02ad6 + d7ffeae commit 204996d962b0579081df748865c7cc9dfb9c8f44
@@ -0,0 +1,27 @@
# CartesianMeshGenerator

!syntax description /MeshGenerators/CartesianMeshGenerator

## Description

The `CartesianMeshGenerator` object is the built-in mesh generation capable of creating lines, rectangles, and hexahedra ("boxes").
The mesh spacing can be non-uniform and each line/rectangle/hexahedron can be assigned a separate subdomain id.
The mesh automatically creates side sets that are logically named and numbered as follows:

- In 1D, left = 0, right = 1
- In 2D, bottom = 0, right = 1, top = 2, left = 3
- In 3D, back = 0, bottom = 1, right = 2, top = 3, left = 4, front = 5

The length, width, and height of each element, as well as their subdomain id can be set independently.
Each linear subdivision in x, y, or z can be additionally subdivided into sub-elements.

## Example Syntax

!listing moose/test/tests/meshgenerators/cartesian_mesh_generator/cartesian_mesh.i
block=MeshGenerators

!syntax parameters /MeshGenerators/CartesianMeshGenerator

!syntax inputs /MeshGenerators/CartesianMeshGenerator

!syntax children /MeshGenerators/CartesianMeshGenerator
@@ -0,0 +1,49 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef CARTESIANMESHGENERATOR_H
#define CARTESIANMESHGENERATOR_H

#include "MeshGenerator.h"
#include "MooseEnum.h"

class CartesianMeshGenerator;

template <>
InputParameters validParams<CartesianMeshGenerator>();

class CartesianMeshGenerator : public MeshGenerator
{
public:
CartesianMeshGenerator(const InputParameters & parameters);

std::unique_ptr<MeshBase> generate() override;

protected:
/// The dimension of the mesh
MooseEnum _dim;
/// Intervals in x direction
std::vector<Real> _dx;
/// Number of grids in all intervals in x direction
std::vector<unsigned int> _ix;
/// Intervals in y direction
std::vector<Real> _dy;
/// Number of grids in all intervals in y direction
std::vector<unsigned int> _iy;
/// Intervals in z direction
std::vector<Real> _dz;
/// Number of grids in all intervals in z direction
std::vector<unsigned int> _iz;
/// Block IDs
std::vector<unsigned int> _subdomain_id;
/// Number of elements in x, y, z direction
int _nx, _ny, _nz;
};

#endif /* CARTESIANMESHGENERATOR_H */
Oops, something went wrong.

0 comments on commit 204996d

Please sign in to comment.