28 template <
typename Iter,
typename Pred>
53 while ((curr_ != end_) && (!pred_(*curr_))) {
101 while ((begin_ != end_) && (!pred_(*begin_))) {
150 template <
class Iter,
class Pred>
174 mfem::ParFiniteElementSpace& space,
const std::optional<int> component = {});
187 void addEssential(
const mfem::Array<int>& true_dofs, std::shared_ptr<mfem::VectorCoefficient> ess_bdr_coef,
188 mfem::ParFiniteElementSpace& space);
199 mfem::ParFiniteElementSpace& space,
const std::optional<int> component = {});
212 template <
typename Tag>
214 mfem::ParFiniteElementSpace& space,
const std::optional<int> component = {})
216 other_bdr_.emplace_back(bdr_coef, component, space, bdr_attr);
217 other_bdr_.back().setTag(tag);
218 all_dofs_valid_ =
false;
227 if (!all_dofs_valid_) {
230 return all_true_dofs_;
239 if (!all_dofs_valid_) {
242 return all_local_dofs_;
260 std::vector<BoundaryCondition>&
essentials() {
return ess_bdr_; }
264 std::vector<BoundaryCondition>&
naturals() {
return nat_bdr_; }
268 std::vector<BoundaryCondition>&
generics() {
return other_bdr_; }
273 const std::vector<BoundaryCondition>&
essentials()
const {
return ess_bdr_; }
277 const std::vector<BoundaryCondition>&
naturals()
const {
return nat_bdr_; }
281 const std::vector<BoundaryCondition>&
generics()
const {
return other_bdr_; }
289 template <
typename Tag>
292 static_assert(std::is_enum_v<Tag>,
"Only enumerations can be used to tag a boundary condition.");
293 return FilterView(other_bdr_.begin(), other_bdr_.end(), [tag](
const auto& bc) { return bc.tagEquals(tag); });
300 void updateAllDofs()
const;
305 const int num_attrs_;
310 std::vector<BoundaryCondition> ess_bdr_;
315 std::vector<BoundaryCondition> nat_bdr_;
320 std::vector<BoundaryCondition> other_bdr_;
327 std::set<int> attrs_in_use_;
333 mutable mfem::Array<int> all_true_dofs_;
339 mutable mfem::Array<int> all_local_dofs_;
344 mutable bool all_dofs_valid_ =
false;
This file contains the declaration of the boundary condition class.
A container for the boundary condition information relating to a specific physics module.
BoundaryConditionManager(const mfem::ParMesh &mesh)
Construct a new Boundary Condition Manager object.
auto genericsWithTag(const Tag tag)
View over all "other"/generic boundary conditions with a specific tag.
std::unique_ptr< mfem::HypreParMatrix > eliminateAllEssentialDofsFromMatrix(mfem::HypreParMatrix &matrix) const
Eliminates all essential BCs from a matrix.
void addGeneric(const std::set< int > &bdr_attr, serac::GeneralCoefficient bdr_coef, const Tag tag, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
Set a generic boundary condition from a list of boundary markers and a coefficient.
std::vector< BoundaryCondition > & generics()
Accessor for the generic BC objects.
void addNatural(const std::set< int > &nat_bdr, serac::GeneralCoefficient nat_bdr_coef, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
Set the natural boundary conditions from a list of boundary markers and a coefficient.
const std::vector< BoundaryCondition > & generics() const
Accessor for the generic BC objects.
const mfem::Array< int > & allEssentialLocalDofs() const
Returns all the local degrees of freedom associated with all the essential BCs.
const std::vector< BoundaryCondition > & essentials() const
Accessor for the essential BC objects.
void addEssential(const std::set< int > &ess_bdr, serac::GeneralCoefficient ess_bdr_coef, mfem::ParFiniteElementSpace &space, const std::optional< int > component={})
Set the essential boundary conditions from a list of boundary markers and a coefficient.
std::vector< BoundaryCondition > & essentials()
Accessor for the essential BC objects.
std::vector< BoundaryCondition > & naturals()
Accessor for the natural BC objects.
const std::vector< BoundaryCondition > & naturals() const
Accessor for the natural BC objects.
const mfem::Array< int > & allEssentialTrueDofs() const
Returns all the true degrees of freedom associated with all the essential BCs.
An iterator over a filtered view.
bool operator!=(const FilterViewIterator &other) const
Comparison operation, checks for iterator inequality.
const auto & operator*() const
Dereferences the iterator.
FilterViewIterator(Iter curr, Iter end, const Pred &pred)
Constructs a new iterator object.
FilterViewIterator & operator++()
Advances the pointed-to container element to the next element that satisfies the predicate.
A "view" for filtering a container.
const FilterViewIterator end() const
FilterView(Iter begin, Iter end, Pred &&pred)
Constructs a new lazily-evaluated filtering view over a container.
const FilterViewIterator begin() const
FilterViewIterator begin()
Returns the first filtered element, i.e., the first element in the underlying container that satisfie...
FilterViewIterator end()
Returns one past the end of the container, primarily for bounds-checking.
This file contains the declaration of structure that manages the MFEM objects that make up the state ...
Accelerator functionality.
FilterView(Iter, Iter, Pred &&) -> FilterView< Iter, Pred >
Deduction guide - iterator and lambda types must be deduced, so this mitigates a "builder" function.