Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triangulation::CellStatus: provide proper compatibility type #15707

Merged
merged 3 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion include/deal.II/grid/cell_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,27 @@ enum class CellStatus : unsigned int
/**
* Invalid status. Will not occur for the user.
*/
cell_invalid
cell_invalid,

/**
* @deprecated Use CellStatus::cell_will_persist instead
*/
CELL_PERSIST DEAL_II_DEPRECATED_EARLY = cell_will_persist,

/**
* @deprecated Use CellStatus::cell_will_be_refined instead
*/
CELL_REFINE DEAL_II_DEPRECATED_EARLY = cell_will_be_refined,

/**
* @deprecated Use CellStatus::cell_will_be_coarsened instead
*/
CELL_COARSEN DEAL_II_DEPRECATED_EARLY = children_will_be_coarsened,

/**
* @deprecated Use CellStatus::cell_invalid instead
*/
CELL_INVALID DEAL_II_DEPRECATED_EARLY = cell_invalid,
};

DEAL_II_NAMESPACE_CLOSE
Expand Down
57 changes: 39 additions & 18 deletions include/deal.II/grid/tria.h
Original file line number Diff line number Diff line change
Expand Up @@ -2226,26 +2226,47 @@ class Triangulation : public Subscriptor
/** @} */

/**
* Alias for backward compatibility.
* The elements of this `enum` are used to inform functions how a
* specific cell is going to change. This is used in the course of
* transferring data from one mesh to a refined or coarsened version of
* the mesh, for example. Note that this may me different than the
* refine_flag() and coarsen_flag() set on a cell, for example in
* parallel calculations, because of refinement constraints that an
* individual machine does not see.
*
* @deprecated This enumeration has been moved to the global namespace.
* Use ::dealii::CellStatus instead. Also, its values have been renamed
* (CELL_PERSIST -> cell_will_persist,
* CELL_REFINE -> cell_will_be_refined,
* CELL_COARSEN -> children_will_be_coarsened,
* CELL_INVALID -> cell_invalid).
* @deprecated This is an alias for backward compatibility. Use
* ::dealii::CellStatus directly.
*/
enum CellStatus
{
CELL_PERSIST DEAL_II_DEPRECATED =
static_cast<unsigned int>(::dealii::CellStatus::cell_will_persist),
CELL_REFINE DEAL_II_DEPRECATED =
static_cast<unsigned int>(::dealii::CellStatus::cell_will_be_refined),
CELL_COARSEN DEAL_II_DEPRECATED = static_cast<unsigned int>(
::dealii::CellStatus::children_will_be_coarsened),
CELL_INVALID DEAL_II_DEPRECATED =
static_cast<unsigned int>(::dealii::CellStatus::cell_invalid)
};
using CellStatus DEAL_II_DEPRECATED_EARLY = ::dealii::CellStatus;

/**
* @deprecated This is an alias for backward compatibility. Use
* ::dealii::CellStatus directly.
*/
static constexpr auto CELL_PERSIST DEAL_II_DEPRECATED_EARLY =
::dealii::CellStatus::cell_will_persist;

/**
* @deprecated This is an alias for backward compatibility. Use
* ::dealii::CellStatus directly.
*/
static constexpr auto CELL_REFINE DEAL_II_DEPRECATED_EARLY =
::dealii::CellStatus::cell_will_be_refined;

/**
* @deprecated This is an alias for backward compatibility. Use
* ::dealii::CellStatus directly.
*/
static constexpr auto CELL_COARSEN DEAL_II_DEPRECATED_EARLY =
::dealii::CellStatus::children_will_be_coarsened;

/**
* @deprecated This is an alias for backward compatibility. Use
* ::dealii::CellStatus directly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is doxygen able to resolve this even though we delete the dealii namespace?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjhei Perhaps not - but then, how am I supposed to tell doxygen to link to the global CellStatus and not the local version?

*/
static constexpr auto CELL_INVALID DEAL_II_DEPRECATED_EARLY =
::dealii::CellStatus::cell_invalid;
tamiko marked this conversation as resolved.
Show resolved Hide resolved


/**
* A structure used to accumulate the results of the `weight` signal slot
Expand Down