https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ImageMeshGenerator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
13#include "FileRangeBuilder.h"
14#include "libmesh/replicated_mesh.h"
15
20{
21public:
23
25
26 std::unique_ptr<MeshBase> generate() override;
27
28protected:
32 void buildMesh2D(const std::string & filename, MeshBase & mesh);
33
37 void buildMesh3D(const std::vector<std::string> & filenames, MeshBase & mesh);
38
43 void GetPixelInfo(std::string filename, int & xpixels, int & ypixels);
44
49 const bool _scale_to_one;
50
59 const Real & _cells_per_pixel;
60};
To be called in the validParams functions of classes that need to operate on ranges of files.
const std::vector< std::string > & filenames()
Generates a line, square, or cube mesh with uniformly spaced or biased elements.
A 2D GeneratedMesh where xmin, xmax, etc.
void buildMesh2D(const std::string &filename, MeshBase &mesh)
generate() calls this helper function to build 2D ImageMeshes.
void GetPixelInfo(std::string filename, int &xpixels, int &ypixels)
Process a single image with the 'file' command to find out the number of pixels in the x and y direct...
void buildMesh3D(const std::vector< std::string > &filenames, MeshBase &mesh)
generate() calls this helper function to build 3D ImageMeshes from stacks of images.
const bool _scale_to_one
If true, forces the maximum width (height) of the mesh to be 1.0 while retaining the original aspect ...
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const Real & _cells_per_pixel
A number <= 1.0 which determines the number of cells in the mesh per pixel in each direction.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MeshBase & mesh