MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / CreateSmoothingBlocks

Method CreateSmoothingBlocks

comp/fespace.cpp:1604–2072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1602
1603
1604 shared_ptr<Table<int>> FESpace :: CreateSmoothingBlocks (const Flags & flags) const
1605 {
1606 bool eliminate_internal =
1607 flags.GetDefineFlag("eliminate_internal") ||
1608 flags.GetDefineFlag("condense");
1609
1610 auto freedofs = GetFreeDofs(eliminate_internal);
1611
1612 if (flags.GetDefineFlag("subassembled"))
1613 {
1614 freedofs = make_shared<BitArray>(*freedofs);
1615 for (auto i : Range(GetNDof()))
1616 if (GetDofCouplingType(i) != WIREBASKET_DOF)
1617 freedofs->Clear(i);
1618 }
1619
1620 if (flags.AnyFlagDefined("additional_dirichlet_constraints"))
1621 {
1622 Region reg = std::any_cast<Region>(flags.GetAnyFlag("additional_dirichlet_constraints"));
1623 BitArray dofs = GetDofs(reg);
1624 dofs.Invert();
1625 freedofs = make_shared<BitArray>(*freedofs);
1626 freedofs->And(dofs);
1627 }
1628
1629 FilteredTableCreator creator(freedofs.get());
1630
1631 /*
1632 for ( ; !creator.Done(); creator++)
1633 {
1634 for (size_t i = 0; i < nd; i++)
1635 if (freedofs->Test(i))
1636 creator.Add (i, i);
1637 }
1638 */
1639
1640
1641 // new version for ngs24:
1642
1643 Array<string> blocktypes { flags.GetStringListFlag("blocktype") };
1644 std::map<string, optional<string>> filtered_blocktypes;
1645
1646 if (flags.GetStringFlag("blocktype")=="vertex" ||
1647 flags.GetStringFlag("blocktype")=="edge" ||
1648 flags.GetStringFlag("blocktype")=="face" ||
1649 flags.GetStringFlag("blocktype")=="facet" ||
1650 flags.GetStringFlag("blocktype")=="element" ||
1651 flags.GetStringFlag("blocktype")=="vertexpatch" ||
1652 flags.GetStringFlag("blocktype")=="edgepatch" ||
1653 flags.GetStringFlag("blocktype")=="vertexedge")
1654 blocktypes += flags.GetStringFlag("blocktype");
1655
1656 for (auto fulltype : blocktypes)
1657 {
1658 auto pos = fulltype.find(':');
1659 string type, filter;
1660 if (pos != std::string::npos)
1661 {

Callers

nothing calls this directly

Calls 15

GetDofCouplingTypeFunction · 0.85
ToStringFunction · 0.85
NodeIdClass · 0.85
IsRegularDofFunction · 0.85
ElementIdClass · 0.85
ClearMethod · 0.80
findMethod · 0.80
ContainsMethod · 0.80
AddMethod · 0.80
VerticesMethod · 0.80
EdgesMethod · 0.80
GetNDofFunction · 0.70

Tested by

no test coverage detected