9#include <kernel/lafem/dense_vector_blocked.hpp>
10#include <kernel/lafem/sparse_matrix_bcsr.hpp>
11#include <kernel/lafem/sparse_matrix_bwrappedcsr.hpp>
12#include <kernel/lafem/unit_filter_blocked.hpp>
13#include <kernel/lafem/slip_filter.hpp>
14#include <kernel/lafem/filter_chain.hpp>
15#include <kernel/lafem/filter_sequence.hpp>
16#include <kernel/lafem/vector_mirror.hpp>
17#include <kernel/lafem/transfer.hpp>
18#include <kernel/global/gate.hpp>
19#include <kernel/global/vector.hpp>
20#include <kernel/global/matrix.hpp>
21#include <kernel/global/filter.hpp>
22#include <kernel/global/transfer.hpp>
23#include <kernel/global/muxer.hpp>
24#include <kernel/assembly/common_operators.hpp>
25#include <kernel/assembly/domain_assembler_basic_jobs.hpp>
27#include <control/domain/domain_control.hpp>
28#include <control/asm/gate_asm.hpp>
29#include <control/asm/muxer_asm.hpp>
30#include <control/asm/splitter_asm.hpp>
31#include <control/asm/transfer_asm.hpp>
32#include <control/asm/mean_filter_asm.hpp>
33#include <control/asm/unit_filter_asm.hpp>
34#include <control/asm/slip_filter_asm.hpp>
42 typename DataType_ =
Real,
43 typename IndexType_ =
Index,
44 typename BlockedMatrix_ = LAFEM::SparseMatrixBCSR<DataType_, IndexType_, dim_, dim_>,
45 typename TransferMatrix_ = LAFEM::SparseMatrixBWrappedCSR<DataType_, IndexType_, dim_>
50 static_assert(std::is_same<DataType_, typename BlockedMatrix_::DataType>::value,
"DataType mismatch!");
51 static_assert(std::is_same<IndexType_, typename BlockedMatrix_::IndexType>::value,
"IndexType mismatch!");
54 typedef DataType_ DataType;
55 typedef IndexType_ IndexType;
56 static constexpr int dim = dim_;
123 return this->gate_sys.
bytes() + this->coarse_muxer_sys.
bytes()
124 + this->transfer_sys.
bytes() + this->matrix_sys.
local().bytes();
127 template<
typename M_,
typename D_,
typename I_,
typename SM_>
136 template<
typename DomainLevel_>
137 void assemble_gate(
const Domain::VirtualLevel<DomainLevel_>& virt_dom_lvl)
139 Asm::asm_gate(virt_dom_lvl, virt_dom_lvl->space, this->gate_sys,
true);
142 template<
typename DomainLevel_>
143 void assemble_coarse_muxer(
const Domain::VirtualLevel<DomainLevel_>& virt_lvl_coarse)
145 Asm::asm_muxer(virt_lvl_coarse, [](
const DomainLevel_& dl){
return &dl.space;}, this->
coarse_muxer_sys);
148 template<
typename DomainLevel_>
149 void assemble_transfer(
151 const Domain::VirtualLevel<DomainLevel_>& virt_lvl_fine,
152 const Domain::VirtualLevel<DomainLevel_>& virt_lvl_coarse,
153 const String& cubature,
bool trunc =
false,
bool shrink =
true)
155 Asm::asm_transfer_blocked(virt_lvl_fine, virt_lvl_coarse, cubature, trunc, shrink,
156 [](
const DomainLevel_& dl) {
return &dl.space;},
157 this->transfer_sys.
local(), this->coarse_muxer_sys, this->gate_sys, sys_lvl_coarse.gate_sys);
159 this->transfer_sys.compile();
162 template<
typename DomainLevel_>
163 void assemble_transfer(
164 const Domain::VirtualLevel<DomainLevel_>& virt_lvl_fine,
165 const Domain::VirtualLevel<DomainLevel_>& virt_lvl_coarse,
166 const String& cubature,
bool trunc =
false,
bool shrink =
true)
169 XASSERT(!virt_lvl_coarse.is_parent());
171 Asm::asm_transfer_blocked(virt_lvl_fine, virt_lvl_coarse, cubature, trunc, shrink,
172 [](
const DomainLevel_& dl) {
return &dl.space;},
173 this->transfer_sys.
local(), this->coarse_muxer_sys, this->gate_sys, this->gate_sys);
175 this->transfer_sys.compile();
178 template<
typename Trafo_,
typename Space_>
179 void assemble_laplace_matrix(Assembly::DomainAssembler<Trafo_>& dom_asm,
const Space_& space,
const String& cubature,
const DataType nu = DataType(1))
182 auto& loc_matrix = this->matrix_sys.
local();
185 if(loc_matrix.empty())
192 Assembly::Common::LaplaceOperatorBlocked<dim_> laplace_op;
200 typename DataType_ =
Real,
201 typename IndexType_ =
Index,
202 typename BlockedMatrix_ = LAFEM::SparseMatrixBCSR<DataType_, IndexType_, dim_, dim_>,
203 typename TransferMatrix_ = LAFEM::SparseMatrixBWrappedCSR<DataType_, IndexType_, dim_>>
211 typedef DataType_ DataType;
212 typedef IndexType_ IndexType;
224 template <
typename DT2_,
typename IT2_,
typename BlockedMatrix2_>
242 template<
typename M_,
typename D_,
typename I_,
typename SM_>
245 BaseClass::convert(other);
249 template<
typename DomainLevel_,
typename Space_>
250 void assemble_homogeneous_unit_filter(
const DomainLevel_& dom_level,
const Space_& space)
252 Asm::asm_unit_filter_blocked_homogeneous(this->filter_sys.local(), dom_level, space,
"*");
258 typename DataType_ =
Real,
259 typename IndexType_ =
Index,
260 typename BlockedMatrix_ = LAFEM::SparseMatrixBCSR<DataType_, IndexType_, dim_, dim_>,
261 typename TransferMatrix_ = LAFEM::SparseMatrixBWrappedCSR<DataType_, IndexType_, dim_>>
269 typedef DataType_ DataType;
270 typedef IndexType_ IndexType;
287 template <
typename DT2_,
typename IT2_,
typename BlockedMatrix2_>
305 template<
typename M_,
typename D_,
typename I_,
typename SM_>
308 BaseClass::convert(other);
312 LocalUnitFilterSeq& get_local_unit_filter_seq()
314 return this->filter_sys.local().template at<0>();
319 return get_local_unit_filter_seq().find_or_add(name);
322 LocalSlipFilterSeq& get_local_slip_filter_seq()
324 return this->filter_sys.local().template at<1>();
327 LocalSlipFilter& get_local_slip_filter(
const String& name)
329 return get_local_slip_filter_seq().find_or_add(name);
337 template<
typename DomainLevel_,
typename Space_>
338 void assemble_homogeneous_unit_filter(
const DomainLevel_& dom_level,
const Space_& space,
const String& name,
const String& mesh_parts)
340 auto& loc_filter = get_local_unit_filter(name);
342 Asm::asm_unit_filter_blocked_homogeneous(loc_filter, dom_level, space, mesh_parts);
345 template<
typename DomainLevel_,
typename Space_,
typename Function_>
346 void assemble_unit_filter(
const DomainLevel_& dom_level,
const Space_& space,
const String& name,
const String& mesh_parts,
const Function_& function)
348 auto& loc_filter = get_local_unit_filter(name);
350 Asm::asm_unit_filter_blocked(loc_filter, dom_level, space, mesh_parts, function);
353 template<
typename DomainLevel_,
typename Space_>
354 void assemble_slip_filter(
const DomainLevel_& dom_level,
const Space_& space,
const String& name,
const String& mesh_parts)
356 auto& loc_filter = get_local_slip_filter(name);
358 Asm::asm_slip_filter(loc_filter, dom_level, space, mesh_parts);
359 Asm::sync_slip_filter(this->gate_sys, loc_filter);
#define XASSERT(expr)
Assertion macro definition.
static void assemble_matrix_std1(MatrixType_ &matrix, const Space_ &space)
Assembles a standard matrix structure from a single space.
BlockedBasicSystemLevel()
CTOR.
LocalSystemMatrix::VectorTypeR LocalSystemVector
define local system vector type
BlockedMatrix_ LocalSystemMatrix
define local system matrix type
Global::Transfer< LocalSystemTransfer, SystemMirror > GlobalSystemTransfer
define global system operator type
LAFEM::Transfer< LocalSystemTransferMatrix > LocalSystemTransfer
define local system transfer operator type
TransferMatrix_ LocalSystemTransferMatrix
define local transfer matrix type
GlobalSystemTransfer transfer_sys
our global transfer operator
Global::Matrix< LocalSystemMatrix, SystemMirror, SystemMirror > GlobalSystemMatrix
define global system matrix type
std::size_t bytes() const
Returns the total amount of bytes allocated.
SystemGate gate_sys
our system gate
SystemMuxer coarse_muxer_sys
our coarse-level system muxer
Global::Vector< LocalSystemVector, SystemMirror > GlobalSystemVector
define global system vector type
Global::Gate< LocalSystemVector, SystemMirror > SystemGate
define system gate
GlobalSystemMatrix matrix_sys
our global system matrix
BlockedMatrix_ LocalBlockedMatrix
define local blocked matrix type
LAFEM::VectorMirror< DataType, IndexType > SystemMirror
define system mirror type
BlockedCombinedSystemLevel()
CTOR.
Global::Filter< LocalSystemFilter, SystemMirror > GlobalSystemFilter
define global filter type
GlobalSystemFilter filter_sys
our global system filter
LAFEM::UnitFilterBlocked< DataType_, IndexType_, dim_ > LocalUnitFilter
define local filter types
std::size_t bytes() const
Returns the total amount of bytes allocated.
LAFEM::VectorMirror< DataType, IndexType > SystemMirror
define system mirror type
LAFEM::UnitFilterBlocked< DataType_, IndexType_, dim_ > LocalSystemFilter
define local filter type
GlobalSystemFilter filter_sys
our global system filter
LAFEM::VectorMirror< DataType, IndexType > SystemMirror
define system mirror type
std::size_t bytes() const
Returns the total amount of bytes allocated.
Global::Filter< LocalSystemFilter, SystemMirror > GlobalSystemFilter
define global filter type
BlockedUnitFilterSystemLevel()
CTOR.
Global Filter wrapper class template.
std::size_t bytes() const
Returns the total amount of bytes allocated.
Global gate implementation.
void convert(const Gate< LVT2_, MT2_ > &other)
Conversion function for same vector container type but with different MDI-Type.
std::size_t bytes() const
Returns the total amount of bytes allocated.
Global Matrix wrapper class template.
LocalMatrix_ & local()
Returns a reference to the internal local LAFEM matrix object.
Global multiplexer/demultiplexer implementation.
std::size_t bytes() const
Returns the internal data size in bytes.
void convert(const Muxer< LVT2_, MT2_ > &other)
Conversion function for same vector container type but with different MDI-Type.
Global grid-transfer operator class template.
void convert(MuxerType *coarse_muxer, const Transfer< LocalTransfer2_, Mirror2_ > &other)
container conversion function
std::size_t bytes() const
Global vector wrapper class template.
Filter Chainclass template.
Sequence of filters of the same type.
Slip Filter class template.
Grid-Transfer operator class template.
Unit Filter Blocked class template.
Handles vector prolongation, restriction and serialization.
void assemble_bilinear_operator_matrix_1(DomainAssembler< Trafo_ > &dom_asm, Matrix_ &matrix, const BilOp_ &bilinear_operator, const Space_ &space, const String &cubature, const typename Matrix_::DataType alpha=typename Matrix_::DataType(1))
Assembles a bilinear operator into a matrix with identical test- and trial-spaces.
double Real
Real data type.
std::uint64_t Index
Index data type.