Skip to content

Commit

Permalink
Added BlockRestrictable::blocksMaxDimension()
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahansel committed Apr 15, 2023
1 parent 82cee4a commit a2236fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions framework/include/interfaces/BlockRestrictable.h
Expand Up @@ -107,6 +107,11 @@ class BlockRestrictable
*/
const virtual std::set<SubdomainID> & blockIDs() const;

/**
* Return the largest mesh dimension of the elements in the blocks for this object
*/
unsigned int blocksMaxDimension() const { return _blk_dim; }

/**
* Test if the supplied block name is valid for this object
* @param name A SubdomainName to check
Expand Down Expand Up @@ -248,6 +253,9 @@ class BlockRestrictable

/// Name of the object
const std::string & _blk_name;

/// Largest mesh dimension of the elements in the blocks for this object
unsigned int _blk_dim;
};

template <typename T, bool is_ad>
Expand Down
6 changes: 6 additions & 0 deletions framework/src/interfaces/BlockRestrictable.C
Expand Up @@ -163,6 +163,12 @@ BlockRestrictable::initializeBlockRestrictable(const MooseObject * moose_object)
moose_object->paramError("block", msg.str());
}
}

// Get the mesh dimension for the blocks
if (blockRestricted())
_blk_dim = _blk_mesh->getBlocksMaxDimension(_blocks);
else
_blk_dim = _blk_mesh->dimension();
}

bool
Expand Down

0 comments on commit a2236fa

Please sign in to comment.