https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshDivision.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
12#include "MooseObject.h"
13#include "SetupInterface.h"
14#include "Restartable.h"
16
17#include "libmesh/vector_value.h"
18
19// libMesh forward declarations
20namespace libMesh
21{
22class Point;
23}
24
26{
28inline unsigned int INVALID_DIVISION_INDEX = std::numeric_limits<unsigned int>::max();
29}
30
36{
37public:
43
45
49 virtual ~MeshDivision();
50
52 virtual unsigned int divisionIndex(const Point & pt) const = 0;
54 virtual unsigned int divisionIndex(const Elem & elem) const = 0;
56 unsigned int getNumDivisions() const { return _num_divs; }
58 bool coversEntireMesh() const { return _mesh_fully_indexed; }
59
61 virtual void meshChanged() override { initialize(); }
62
63protected:
65 void setNumDivisions(const unsigned int ndivs) { _num_divs = ndivs; }
66
68 virtual void initialize() {}
69
72
75
78
79private:
81 unsigned int _num_divs;
82};
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Interface for notifications that the mesh has changed.
Base class for MeshDivision objects.
virtual unsigned int divisionIndex(const Elem &elem) const =0
Return the index of the division to which the element belongs.
virtual void meshChanged() override
By default, meshChanged will cause a re-initialization of the necessary data members.
unsigned int getNumDivisions() const
Return the number of divisions.
virtual void initialize()
Set up any data members that would be necessary to obtain the division indices.
static InputParameters validParams()
Class constructor.
virtual unsigned int divisionIndex(const Point &pt) const =0
Return the index of the division to which the point belongs.
const FEProblemBase *const _fe_problem
Pointer to the problem, needed to retrieve pointers to various objects.
void setNumDivisions(const unsigned int ndivs)
Set the number of divisions.
virtual ~MeshDivision()
MeshDivision destructor.
const MooseMesh & _mesh
Mesh that is being divided.
bool coversEntireMesh() const
Returns whether the entire mesh is covered by the division of the mesh, whether every point and eleme...
bool _mesh_fully_indexed
Whether the mesh is fully covered / indexed, all elements and points have a valid index.
unsigned int _num_divs
Number of divisions in the division.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
unsigned int INVALID_DIVISION_INDEX
Invalid subdomain id to return when outside the mesh division.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...