www.mooseframework.org
ImageMesh.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef IMAGEMESH_H
16 #define IMAGEMESH_H
17 
18 #include "GeneratedMesh.h"
19 #include "FileRangeBuilder.h"
20 
21 class ImageMesh;
22 
23 template <>
25 
30 {
31 public:
33  ImageMesh(const ImageMesh & other_mesh);
34 
35  virtual MooseMesh & clone() const override;
36 
37  virtual void buildMesh() override;
38 
39 protected:
43  void buildMesh2D(const std::string & filename);
44 
48  void buildMesh3D(const std::vector<std::string> & filenames);
49 
54  void GetPixelInfo(std::string filename, int & xpixels, int & ypixels);
55 
60  const bool _scale_to_one;
61 
70  const Real & _cells_per_pixel;
71 };
72 
73 #endif /* IMAGEMESH_H */
void buildMesh3D(const std::vector< std::string > &filenames)
buildMesh() calls this helper function to build 3D ImageMeshes from stacks of images.
Definition: ImageMesh.C:80
ImageMesh(const InputParameters &parameters)
Definition: ImageMesh.C:44
const std::vector< std::string > & filenames()
InputParameters validParams< ImageMesh >()
Definition: ImageMesh.C:27
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void buildMesh2D(const std::string &filename)
buildMesh() calls this helper function to build 2D ImageMeshes.
Definition: ImageMesh.C:150
virtual MooseMesh & clone() const override
Clone method.
Definition: ImageMesh.C:63
Mesh generated from parameters.
Definition: GeneratedMesh.h:28
virtual void buildMesh() override
Must be overridden by child classes.
Definition: ImageMesh.C:69
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
Augments an InputParameters object with file range information.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction...
Definition: ImageMesh.h:70
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
Definition: ImageMesh.h:60
void GetPixelInfo(std::string filename, int &xpixels, int &ypixels)
Process a single image with the &#39;file&#39; command to find out the number of pixels in the x and y direct...
Definition: ImageMesh.C:187
A 2D GeneratedMesh where xmin, xmax, etc.
Definition: ImageMesh.h:29