mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: enumerations for known cell models in cellModel, ptr/ref lookups
- this provides a better typesafe means of locating predefined cell models than relying on strings. The lookup is now ptr() or ref() directly. The lookup functions behave like on-demand singletons when loading "etc/cellModels". Functionality is now located entirely in cellModel but a forwarding version of cellModeller is provided for API (but not ABI) compatibility with older existing user code. STYLE: use constexpr for cellMatcher constants
This commit is contained in:
@ -37,8 +37,8 @@ const cellShapeList& cellShapes = meshPtr->cellShapes();
|
||||
// hexa's
|
||||
if (which_type == Z_HEX08)
|
||||
{
|
||||
const cellModel& hex = *(cellModeller::lookup("hex"));
|
||||
//const cellModel& wedge = *(cellModeller::lookup("wedge"));
|
||||
const cellModel& hex = cellModel::ref(cellModel::HEX);
|
||||
//const cellModel& wedge = cellModel::ref(cellModel::WEDGE);
|
||||
|
||||
label counter = 1;
|
||||
for (label n=0; n<nCells; n++)
|
||||
@ -56,7 +56,7 @@ if (which_type == Z_HEX08)
|
||||
// penta's
|
||||
if (which_type == Z_PEN06)
|
||||
{
|
||||
const cellModel& prism = *(cellModeller::lookup("prism"));
|
||||
const cellModel& prism = cellModel::ref(cellModel::PRISM);
|
||||
|
||||
label counter = 1;
|
||||
for (label n=0; n<nCells; n++)
|
||||
@ -74,7 +74,7 @@ if (which_type == Z_PEN06)
|
||||
// pyramids's
|
||||
if (which_type == Z_PYR05)
|
||||
{
|
||||
const cellModel& pyr = *(cellModeller::lookup("pyr"));
|
||||
const cellModel& pyr = cellModel::ref(cellModel::PYR);
|
||||
|
||||
label counter = 1;
|
||||
for (label n=0; n<nCells; n++)
|
||||
@ -93,7 +93,7 @@ if (which_type == Z_PYR05)
|
||||
// penta's
|
||||
if (which_type == Z_TET04)
|
||||
{
|
||||
const cellModel& tet = *(cellModeller::lookup("tet"));
|
||||
const cellModel& tet = cellModel::ref(cellModel::TET);
|
||||
|
||||
label counter = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user