17 mfem::ParFiniteElementSpace& space,
const std::optional<int> component)
19 std::set<int> filtered_attrs;
20 std::set_difference(ess_bdr.begin(), ess_bdr.end(), attrs_in_use_.begin(), attrs_in_use_.end(),
21 std::inserter(filtered_attrs, filtered_attrs.begin()));
24 if (filtered_attrs.size() < ess_bdr.size()) {
25 SLIC_WARNING_ROOT(
"Multiple definition of essential boundary! Using first definition given.");
28 ess_bdr_.emplace_back(ess_bdr_coef, component, space, filtered_attrs);
29 attrs_in_use_.insert(ess_bdr.begin(), ess_bdr.end());
30 all_dofs_valid_ =
false;
34 mfem::ParFiniteElementSpace& space,
const std::optional<int> component)
36 nat_bdr_.emplace_back(nat_bdr_coef, component, space, nat_bdr);
37 all_dofs_valid_ =
false;
41 std::shared_ptr<mfem::VectorCoefficient> ess_bdr_coef,
42 mfem::ParFiniteElementSpace& space)
44 ess_bdr_.emplace_back(ess_bdr_coef, std::nullopt, space, true_dofs);
45 all_dofs_valid_ =
false;
48 void BoundaryConditionManager::updateAllDofs()
const
50 all_true_dofs_.DeleteAll();
51 all_local_dofs_.DeleteAll();
52 for (
const auto& bc : ess_bdr_) {
53 all_true_dofs_.Append(bc.getTrueDofList());
54 all_local_dofs_.Append(bc.getLocalDofList());
56 all_true_dofs_.Sort();
57 all_local_dofs_.Sort();
58 all_true_dofs_.Unique();
59 all_local_dofs_.Unique();
60 all_dofs_valid_ =
true;
This file contains the declaration of the boundary condition manager class.
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.
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.
This file contains the all the necessary functions and macros required for logging as well as a helpe...
Accelerator functionality.