FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
unit_filter_asm.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
9#include <kernel/assembly/unit_filter_assembler.hpp>
10
11namespace FEAT
12{
13 namespace Control
14 {
15 namespace Asm
16 {
28 template<typename DomainLevel_>
29 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> create_unit_filter_asm(const DomainLevel_& dom_level, const std::deque<String>& mesh_part_names)
30 {
31
32 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> unit_asm;
33 // loop over all mesh parts
34 for(const auto& mp_name : mesh_part_names)
35 {
36 auto* mesh_part_node = dom_level.get_mesh_node()->find_mesh_part_node(mp_name);
37 XASSERT(mesh_part_node != nullptr);
38
39 // let's see if we have that mesh part
40 // if it is nullptr, then our patch is not adjacent to that boundary part
41 auto* mesh_part = mesh_part_node->get_mesh();
42 if (mesh_part != nullptr)
43 {
44 // add to boundary assembler
45 unit_asm.add_mesh_part(*mesh_part);
46 }
47 }
48 return unit_asm;
49 }
50
51
60 template<typename DomainLevel_>
61 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> create_unit_filter_asm(const DomainLevel_& dom_level, const String& mesh_part_names)
62 {
63 std::deque<String> mp_names;
64 if(mesh_part_names == "*")
65 mp_names = dom_level.get_mesh_node()->get_mesh_part_names(true);
66 else
67 mp_names = mesh_part_names.split_by_whitespaces();
68
69 return create_unit_filter_asm(dom_level, mp_names);
70 }
71
88 template<typename DataType_, typename IndexType_, typename DomainLevel_, typename Space_>
89 void asm_unit_filter_scalar_homogeneous(LAFEM::UnitFilter<DataType_, IndexType_>& filter,
90 const DomainLevel_& dom_level, const Space_& space, const String& mesh_part_names)
91 {
92 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> unit_asm = create_unit_filter_asm(dom_level, mesh_part_names);
93 unit_asm.assemble(filter, space);
94 }
95
115 template<typename DataType_, typename IndexType_, typename DomainLevel_, typename Space_, typename Function_>
116 void asm_unit_filter_scalar(LAFEM::UnitFilter<DataType_, IndexType_>& filter,
117 const DomainLevel_& dom_level, const Space_& space, const String& mesh_part_names, const Function_& function)
118 {
119 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> unit_asm = create_unit_filter_asm(dom_level, mesh_part_names);
120 unit_asm.assemble(filter, space, function);
121 }
122
139 template<typename DataType_, typename IndexType_, int block_size_, typename DomainLevel_, typename Space_>
140 void asm_unit_filter_blocked_homogeneous(LAFEM::UnitFilterBlocked<DataType_, IndexType_, block_size_>& filter,
141 const DomainLevel_& dom_level, const Space_& space, const String& mesh_part_names)
142 {
143 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> unit_asm = create_unit_filter_asm(dom_level, mesh_part_names);
144 unit_asm.assemble(filter, space);
145 }
146
166 template<typename DataType_, typename IndexType_, int block_size_, typename DomainLevel_, typename Space_, typename Function_>
167 void asm_unit_filter_blocked(LAFEM::UnitFilterBlocked<DataType_, IndexType_, block_size_>& filter,
168 const DomainLevel_& dom_level, const Space_& space, const String& mesh_part_names, const Function_& function)
169 {
170 Assembly::UnitFilterAssembler<typename DomainLevel_::MeshType> unit_asm = create_unit_filter_asm(dom_level, mesh_part_names);
171 unit_asm.assemble(filter, space, function);
172 }
173 } // namespace Asm
174 } // namespace Control
175} // namespace FEAT
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12