www.mooseframework.org
ImageMesh.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 "GeneratedMesh.h"
13 #include "FileRangeBuilder.h"
14 
19 {
20 public:
22 
24  ImageMesh(const ImageMesh & other_mesh);
25 
26  virtual std::unique_ptr<MooseMesh> safeClone() const override;
27 
28  virtual void buildMesh() override;
29 
30 protected:
34  void buildMesh2D(const std::string & filename);
35 
39  void buildMesh3D(const std::vector<std::string> & filenames);
40 
45  void GetPixelInfo(std::string filename, int & xpixels, int & ypixels);
46 
51  const bool _scale_to_one;
52 
62 };
void buildMesh3D(const std::vector< std::string > &filenames)
buildMesh() calls this helper function to build 3D ImageMeshes from stacks of images.
Definition: ImageMesh.C:76
ImageMesh(const InputParameters &parameters)
Definition: ImageMesh.C:40
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...
Definition: ImageMesh.C:59
const std::vector< std::string > & filenames()
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:146
Mesh generated from parameters.
Definition: GeneratedMesh.h:17
virtual void buildMesh() override
Must be overridden by child classes.
Definition: ImageMesh.C:65
To be called in the validParams functions of classes that need to operate on ranges of files...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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:61
const InputParameters & parameters() const
Get the parameters of the object.
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:51
static InputParameters validParams()
Definition: ImageMesh.C:23
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:183
A 2D GeneratedMesh where xmin, xmax, etc.
Definition: ImageMesh.h:18