16 mfem::ParFiniteElementSpace& space,
const std::optional<int> component)
18 std::set<int> filtered_attrs;
19 std::set_difference(ess_bdr.begin(), ess_bdr.end(), attrs_in_use_.begin(), attrs_in_use_.end(),
20 std::inserter(filtered_attrs, filtered_attrs.begin()));
23 if (filtered_attrs.size() < ess_bdr.size()) {
24 SLIC_WARNING_ROOT(
"Multiple definition of essential boundary! Using first definition given.");
27 ess_bdr_.emplace_back(ess_bdr_coef, component, space, filtered_attrs);
28 attrs_in_use_.insert(ess_bdr.begin(), ess_bdr.end());
29 all_dofs_valid_ =
false;
33 std::shared_ptr<mfem::Coefficient> ess_bdr_coef,
34 mfem::ParFiniteElementSpace& space, std::optional<int> component)
37 mfem::Array<int> true_dofs;
38 for (
int j = 0; j < local_dofs.Size(); ++j) {
39 int tdof = space.GetLocalTDofNumber(local_dofs[j]);
40 if (tdof >= 0) true_dofs.Append(tdof);
43 ess_bdr_.emplace_back(ess_bdr_coef, component, space, true_dofs);
44 all_dofs_valid_ =
false;
48 std::shared_ptr<mfem::VectorCoefficient> ess_bdr_coef,
49 mfem::ParFiniteElementSpace& space)
51 ess_bdr_.emplace_back(ess_bdr_coef, std::nullopt, space, true_dofs);
52 all_dofs_valid_ =
false;
55 void BoundaryConditionManager::updateAllDofs()
const
57 all_true_dofs_.DeleteAll();
58 all_local_dofs_.DeleteAll();
59 for (
const auto& bc : ess_bdr_) {
60 all_true_dofs_.Append(bc.getTrueDofList());
61 all_local_dofs_.Append(bc.getLocalDofList());
63 all_true_dofs_.Sort();
64 all_local_dofs_.Sort();
65 all_true_dofs_.Unique();
66 all_local_dofs_.Unique();
67 all_dofs_valid_ =
true;
This file contains the declaration of the boundary condition manager class.
void addEssentialByTrueDofs(const mfem::Array< int > &true_dofs, std::shared_ptr< mfem::VectorCoefficient > ess_bdr_coef, mfem::ParFiniteElementSpace &space)
void addEssential(const std::set< int > &ess_bdr, smith::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.