8#include <kernel/assembly/trace_assembler.hpp>
9#include <kernel/assembly/function_integral_info.hpp>
10#include <kernel/geometry/intern/face_index_mapping.hpp>
11#include <kernel/geometry/intern/face_ref_trafo.hpp>
12#include <kernel/geometry/intern/congruency_sampler.hpp>
13#include <kernel/geometry/intern/congruency_trafo.hpp>
24 template<
typename DataType_,
typename Space_, TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags space_config_>
29 static constexpr bool assemble_pairwise =
false;
44 static constexpr int shape_dim = ShapeType::dimension;
46 static constexpr int facet_dim = FacetType::dimension;
62 typedef typename TrafoFacetEvaluator::template ConfigTraits<facet_trafo_config>::EvalDataType
TrafoFacetEvalData;
68 typedef typename Intern::CubatureTraits<TrafoFacetEvaluator>::RuleType
CubatureRuleType;
125 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
128 Geometry::Intern::FaceRefTrafo<ShapeType, facet_dim>::compute(
face_mat, face_vec, local_facet);
131 Geometry::Intern::CongruencyTrafo<FacetType>::compute(ori_mat, ori_vec, facet_ori);
134 cell_facet_ori = Geometry::Intern::CongruencySampler<FacetType>::orientation(facet_ori)
184 template<
typename DataType_,
typename TestSpace_,
typename TrialSpace_,
190 static constexpr bool assemble_pairwise =
false;
227 typedef typename TrafoFacetEvaluator::template ConfigTraits<facet_trafo_config>::EvalDataType
TrafoFacetEvalData;
233 typedef typename AsmTraits::TrialBasisData TrialBasisData;
263 typename AsmTraits::TrialDofMapping trial_dof_mapping;
304 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
307 Geometry::Intern::FaceRefTrafo<ShapeType, facet_dim>::compute(
face_mat, face_vec, local_facet);
310 Geometry::Intern::CongruencyTrafo<FacetType>::compute(ori_mat, ori_vec, facet_ori);
313 cell_facet_ori = Geometry::Intern::CongruencySampler<FacetType>::orientation(facet_ori)
324 trial_dof_mapping.prepare(cell);
357 trial_dof_mapping.finish();
396 template<
typename Derived_,
typename Vector_,
typename Space_,
399 public TraceAssemblyBasicTaskBase1<typename Vector_::DataType, Space_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_config_>
419 using typename BaseClass::SpaceBasisData;
498 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
504 static_cast<Derived_&
>(*this).prepare_point(
cubature_rule.get_point(k));
507 static_cast<Derived_&
>(*this).set_point(this->trafo_facet_data, this->trafo_data);
510 for(
int i(0); i < num_loc_dofs; ++i)
514 this->trafo_facet_data.jac_det *
cubature_rule.get_weight(k), this->space_data.phi[i]);
553 template<
typename LinearFunctional_,
typename Vector_,
typename Space_>
557 typedef typename Vector_::DataType DataType;
558 typedef typename Vector_::ValueType ValueType;
560 static constexpr TrafoTags trafo_config = LinearFunctional_::trafo_config;
561 static constexpr SpaceTags space_config = LinearFunctional_::test_config;
574 typename LinearFunctional_::template Evaluator<AsmTraits>
func_eval;
583 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
585 BaseClass::prepare(facet, cell, local_facet, facet_ori);
594 void eval(
ValueType& val,
const DataType& weight,
typename BaseClass::SpaceBasisData& psi)
638 Vector_& vector_,
const Space_& space_,
String cubature_, DataType alpha_ = DataType(1)) :
669 template<
typename Trafo_,
typename Vector_,
typename LinFunc_,
typename Space_>
671 Vector_& vector,
const LinFunc_& linear_functional,
const Space_& space,
672 const String& cubature,
const typename Vector_::DataType alpha =
typename Vector_::DataType(1))
674 XASSERTM(trace_asm.
get_trafo() == space.get_trafo(),
"trace assembler and space have different trafos");
675 XASSERTM(vector.size() == space.get_num_dofs(),
"invalid vector length");
678 linear_functional, vector, space, cubature, alpha);
710 template<
typename Derived_,
typename Matrix_,
typename Space_,
713 public TraceAssemblyBasicTaskBase1<typename Matrix_::DataType, Space_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_config_>
733 using typename BaseClass::SpaceBasisData;
815 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
821 static_cast<Derived_&
>(*this).prepare_point(
cubature_rule.get_point(k));
824 static_cast<Derived_&
>(*this).set_point(this->trafo_facet_data, this->trafo_data);
827 for(
int i(0); i < num_loc_dofs; ++i)
830 for(
int j(0); j < num_loc_dofs; ++j)
834 this->trafo_facet_data.jac_det *
cubature_rule.get_weight(k),
835 this->space_data.phi[j], this->space_data.phi[i]);
892 template<
typename Derived_,
typename Matrix_,
typename TestSpace_,
typename TrialSpace_,
895 public TraceAssemblyBasicTaskBase2<typename Matrix_::DataType, TestSpace_, TrialSpace_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, test_config_, trial_config_>
915 using typename BaseClass::TestBasisData;
916 using typename BaseClass::TrialBasisData;
1001 const int num_loc_test_dofs = this->test_eval.get_num_local_dofs();
1002 const int num_loc_trial_dofs = this->trial_eval.get_num_local_dofs();
1008 static_cast<Derived_&
>(*this).prepare_point(
cubature_rule.get_point(k));
1011 static_cast<Derived_&
>(*this).set_point(this->trafo_facet_data, this->trafo_data);
1014 for(
int i(0); i < num_loc_test_dofs; ++i)
1017 for(
int j(0); j < num_loc_trial_dofs; ++j)
1021 this->trafo_facet_data.jac_det *
cubature_rule.get_weight(k),
1022 this->trial_data.phi[j], this->test_data.phi[i]);
1062 template<
typename BilinearOperator_,
typename Matrix_,
typename Space_>
1066 typedef typename Matrix_::DataType DataType;
1067 typedef typename Matrix_::ValueType ValueType;
1069 static constexpr TrafoTags trafo_config = BilinearOperator_::trafo_config;
1070 static constexpr SpaceTags space_config = BilinearOperator_::test_config | BilinearOperator_::trial_config;
1083 typename BilinearOperator_::template Evaluator<AsmTraits>
oper_eval;
1092 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
1094 BaseClass::prepare(facet, cell, local_facet, facet_ori);
1103 void eval(
ValueType& val,
const DataType& weight,
typename AsmTraits::TrialBasisData& phi,
typename AsmTraits::TestBasisData& psi)
1111 BaseClass::finish();
1147 Matrix_& matrix_,
const Space_& space_,
String cubature_, DataType alpha_ = DataType(1)) :
1178 template<
typename Trafo_,
typename Matrix_,
typename BilOp_,
typename Space_>
1180 const BilOp_& bilinear_operator,
const Space_& space,
const String& cubature,
1181 const typename Matrix_::DataType alpha =
typename Matrix_::DataType(1))
1183 XASSERTM(trace_asm.
get_trafo() == space.get_trafo(),
"trace assembler and space have different trafos");
1184 XASSERTM(matrix.columns() == space.get_num_dofs(),
"invalid matrix column count");
1185 XASSERTM(matrix.rows() == space.get_num_dofs(),
"invalid matrix row count");
1188 bilinear_operator, matrix, space, cubature, alpha);
1212 template<
typename BilinearOperator_,
typename Matrix_,
typename TestSpace_,
typename TrialSpace_>
1216 typedef typename Matrix_::DataType DataType;
1217 typedef typename Matrix_::ValueType ValueType;
1219 static constexpr TrafoTags trafo_config = BilinearOperator_::trafo_config;
1220 static constexpr SpaceTags test_config = BilinearOperator_::test_config;
1221 static constexpr SpaceTags trial_config = BilinearOperator_::trial_config;
1234 typename BilinearOperator_::template Evaluator<AsmTraits>
oper_eval;
1243 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
1245 BaseClass::prepare(facet, cell, local_facet, facet_ori);
1262 BaseClass::finish();
1303 Matrix_& matrix_,
const TestSpace_& test_space_,
const TrialSpace_& trial_space_,
1304 String cubature_, DataType alpha_ = DataType(1)) :
1339 template<
typename Trafo_,
typename Matrix_,
typename BilOp_,
typename TestSpace_,
typename TrialSpace_>
1341 Matrix_& matrix,
const BilOp_& bilinear_operator,
const TestSpace_& test_space,
1342 const TrialSpace_& trial_space,
const String& cubature,
1343 const typename Matrix_::DataType alpha =
typename Matrix_::DataType(1))
1345 XASSERTM(trace_asm.
get_trafo() == test_space.get_trafo(),
"trace assembler and test space have different trafos");
1346 XASSERTM(trace_asm.
get_trafo() == trial_space.get_trafo(),
"trace assembler and trial space have different trafos");
1347 XASSERTM(matrix.columns() == trial_space.get_num_dofs(),
"invalid matrix column count");
1348 XASSERTM(matrix.rows() == test_space.get_num_dofs(),
"invalid matrix row count");
1351 bilinear_operator, matrix, test_space, trial_space, cubature, alpha);
1379 template<
typename BilinearOperator_,
typename Vector_,
typename VectorSol_,
typename Space_>
1383 typedef typename Vector_::DataType DataType;
1384 typedef typename Vector_::ValueType ValueType;
1386 static constexpr TrafoTags trafo_config = BilinearOperator_::trafo_config;
1387 static constexpr SpaceTags space_config = BilinearOperator_::test_config | BilinearOperator_::trial_config;
1398 typedef typename BilinearOperator_::template Evaluator<AsmTraits>::ValueType MatValType;
1401 typename BilinearOperator_::template Evaluator<AsmTraits>
oper_eval;
1411 typename AsmTraits::template TLocalVector<ValueType> local_vec_sol;
1423 void prepare(
Index facet,
Index cell,
int local_facet,
int facet_ori)
1425 BaseClass::prepare(facet, cell , local_facet, facet_ori);
1427 local_vec_sol.format();
1428 sol_gather(local_vec_sol, this->dof_mapping);
1436 void eval(MatValType& val,
const DataType& weight,
1437 typename AsmTraits::TrialBasisData& phi,
typename AsmTraits::TestBasisData& psi)
1439 val += weight *
oper_eval.eval(phi, psi);
1452 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
1455 for(
int k(0); k < this->
cubature_rule.get_num_points(); ++k)
1460 this->set_point(this->trafo_facet_data, this->trafo_data);
1463 for(
int i(0); i < num_loc_dofs; ++i)
1466 for(
int j(0); j < num_loc_dofs; ++j)
1470 this->trafo_facet_data.jac_det * this->cubature_rule.get_weight(k),
1471 this->space_data.phi[j], this->space_data.phi[i]);
1480 for(
int i(0); i < num_loc_dofs; ++i)
1481 for(
int j(0); j < num_loc_dofs; ++j)
1488 BaseClass::finish();
1526 Vector_& vector_,
const VectorSol_& vec_sol_,
const Space_& space_,
const String& cubature_, DataType alpha_ = DataType(1)) :
1561 template<
typename Trafo_,
typename Vector_,
typename VectorSol_,
typename BilOp_,
typename Space_>
1563 const VectorSol_& vec_sol,
const BilOp_& bilinear_operator,
const Space_& space,
const String& cubature,
1564 const typename Vector_::DataType alpha =
typename Vector_::DataType(1))
1566 XASSERTM(trace_asm.
get_trafo() == space.get_trafo(),
"domain assembler and space have different trafos");
1567 XASSERTM(vector.size() == space.get_num_dofs(),
"invalid vector size");
1570 bilinear_operator, vector, vec_sol, space, cubature, alpha);
1591 template<
typename DataType_,
typename Function_,
typename Trafo_,
int max_der_>
1595 typedef DataType_ DataType;
1606 typedef typename Trafo_::ShapeType ShapeType;
1607 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
1610 typedef typename Trafo_::template Evaluator<FacetType, DataType>::Type
TrafoEvaluator;
1611 typedef typename TrafoEvaluator::template ConfigTraits<trafo_config>::EvalDataType TrafoEvalData;
1617 static constexpr bool assemble_pairwise =
false;
1629 typename Assembly::Intern::CubatureTraits<TrafoEvaluator>::RuleType
cubature_rule;
1631 typename Function_::template Evaluator<AnalyticEvalTraits>
func_eval;
1648 void prepare(
Index facet,
Index DOXY(cell),
int DOXY(local_facet),
int DOXY(facet_ori))
1662 Intern::AnaFunIntJobHelper<max_der_>::work(
loc_integral,
1744 template<
int max_der_,
typename DataType_,
typename Function_,
typename Trafo_>
1750 return job.result();
1767 template<
typename Vector_,
typename Space_,
int max_der_>
1771 typedef typename Vector_::DataType DataType;
1772 typedef typename Vector_::ValueType ValueType;
1774 static constexpr TrafoTags trafo_config = TrafoTags::none;
1793 static constexpr bool assemble_pairwise =
false;
1838 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
1847 Intern::DiscFunIntJobHelper<max_der_>::work(
loc_integral,
1898 FunctionIntegralType& result()
1926 template<
int max_der_,
typename Vector_,
typename Trafo_,
typename Space_>
1930 XASSERTM(trace_asm.
get_trafo() == space.get_trafo(),
"domain assembler and space have different trafos");
1931 XASSERTM(vector.size() == space.get_num_dofs(),
"invalid coefficient vector length");
1934 return job.result();
1959 template<
typename Function_,
typename Vector_,
typename Space_,
int max_der_>
1963 typedef typename Vector_::DataType DataType;
1964 typedef typename Vector_::ValueType ValueType;
1967 static_assert(Intern::ErrCompatHelper<Function_, Vector_>::valid,
"function and vector are incompatible");
1972 static constexpr TrafoTags trafo_config = TrafoTags::none;
1992 static constexpr bool assemble_pairwise =
false;
2003 typename Function_::template Evaluator<AnalyticEvalTraits>
func_eval;
2040 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
2049 Intern::ErrFunIntJobHelper<max_der_>::work(
loc_integral,
2051 this->trafo_facet_data.img_point, this->space_data,
local_vector, num_loc_dofs);
2139 template<
int max_der_,
typename Function_,
typename Vector_,
typename Trafo_,
typename Space_>
2142 const Vector_& vector,
const Space_& space,
const String& cubature)
2144 XASSERTM(trace_asm.
get_trafo() == space.get_trafo(),
"trace assembler and space have different trafos");
2145 XASSERTM(vector.size() == space.get_num_dofs(),
"invalid coefficient vector length");
2148 return job.result();
2190 template<
typename Derived_,
typename VectorVelo_,
typename VectorPres_,
typename SpaceVelo_,
typename SpacePres_,
2193 public TraceAssemblyBasicTaskBase2<typename VectorVelo_::DataType, SpaceVelo_, SpacePres_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_velo_config_, space_pres_config_>
2206 typedef typename VectorPres_::ValueType PresValueType;
2210 typedef typename TrafoEvalData::EvalTraits TrafoEvalTraits;
2213 static constexpr int max_local_pres_dofs = AsmTraits::max_local_trial_dofs;
2248 const VectorVelo_& vector_velo_,
const VectorPres_& vector_pres_,
2249 const SpaceVelo_& space_velo_,
const SpacePres_& space_pres_,
2298 const int num_loc_dofs_velo = this->test_eval.get_num_local_dofs();
2299 const int num_loc_dofs_pres = this->trial_eval.get_num_local_dofs();
2308 static_cast<Derived_&
>(*this).prepare_point(
cubature_rule.get_point(k));
2314 for(
int i(0); i < num_loc_dofs_velo; ++i)
2331 for(
int i(0); i < num_loc_dofs_pres; ++i)
2348 static_cast<Derived_&
>(*this).eval(this->trafo_facet_data, this->trafo_data,
2349 cubature_rule.get_weight(k) * this->trafo_facet_data.jac_det, velo_data, pres_data);
2367 template<
typename VectorVelo_,
typename VectorPres_,
typename SpaceVelo_,
typename SpacePres_>
2371 typedef typename VectorVelo_::DataType DataType;
2372 typedef typename VectorVelo_::ValueType VeloValueType;
2373 typedef typename VectorPres_::ValueType PresValueType;
2375 static constexpr TrafoTags trafo_config = TrafoTags::none;
2380 static constexpr int dim = SpaceVelo_::shape_dim;
2395 static constexpr bool assemble_pairwise =
false;
2413 job_raw_forces(job.raw_forces),
2421 this->
_eval(weight, tau_f.normal, velo.grad, pres.value);
2433 job_raw_forces += raw_forces;
2441 raw_forces(0, 0) -= omega * (
DataType(2) * grad_v(0,0) * n[0] + (grad_v(0, 1) + grad_v(1, 0)) * n[1]);
2442 raw_forces(1, 0) -= omega * (
DataType(2) * grad_v(1,1) * n[1] + (grad_v(1, 0) + grad_v(0, 1)) * n[0]);
2443 raw_forces(0, 1) -= omega * val_p * n[0];
2444 raw_forces(1, 1) -= omega * val_p * n[1];
2451 raw_forces(0, 0) -= omega * (
DataType(2) * grad_v(0,0) * n[0] + (grad_v(0, 1) + grad_v(1, 0)) * n[1] + (grad_v(0, 2) + grad_v(2, 0)) * n[2]);
2452 raw_forces(1, 0) -= omega * (
DataType(2) * grad_v(1,1) * n[1] + (grad_v(1, 2) + grad_v(2, 1)) * n[2] + (grad_v(1, 0) + grad_v(0, 1)) * n[0]);
2453 raw_forces(2, 0) -= omega * (
DataType(2) * grad_v(2,2) * n[2] + (grad_v(2, 0) + grad_v(0, 2)) * n[0] + (grad_v(2, 1) + grad_v(1, 2)) * n[1]);
2454 raw_forces(0, 1) -= omega * val_p * n[0];
2455 raw_forces(1, 1) -= omega * val_p * n[1];
2456 raw_forces(2, 1) -= omega * val_p * n[2];
2461 const VectorVelo_& vector_velo;
2462 const VectorPres_& vector_pres;
2463 const SpaceVelo_& space_velo;
2464 const SpacePres_& space_pres;
2466 RawForces raw_forces;
2488 const SpaceVelo_& space_velo_,
const SpacePres_& space_pres_,
String cubature_):
2489 vector_velo(vector_velo_),
2490 vector_pres(vector_pres_),
2491 space_velo(space_velo_),
2492 space_pres(space_pres_),
2493 cubature_factory(cubature_),
2502 return nu * raw_forces(0, 0) - raw_forces(0, 1);
2508 return nu * raw_forces(1, 0) - raw_forces(1, 1);
2514 return nu * raw_forces(2, 0) - raw_forces(2, 1);
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Common single-space assembly traits class template.
TrafoType::template Evaluator< ShapeType, DataType >::Type TrafoEvaluator
trafo evaluator type
SpaceEvalData::BasisDataType SpaceBasisData
basis function data types
SpaceEvaluator::template ConfigTraits< space_config >::EvalDataType SpaceEvalData
space evaluation data types
DataType_ DataType
data type
SpaceType::TrafoType TrafoType
trafo type
SpaceType::DofMappingType DofMapping
dof-mapping types
TrafoEvaluator::template ConfigTraits< trafo_config >::EvalDataType TrafoEvalData
trafo evaluation data type
SpaceType::template Evaluator< TrafoEvaluator >::Type SpaceEvaluator
space evaluator types
Space_ SpaceType
space type
Common test-/trial-space assembly traits class template.
TestSpaceType::DofMappingType TestDofMapping
dof-mapping types
TrafoType::template Evaluator< ShapeType, DataType >::Type TrafoEvaluator
trafo evaluator type
TrialSpace_ TrialSpaceType
trial-space type
TestSpace_ TestSpaceType
test-space type
DataType_ DataType
data type
TestEvalData::BasisDataType TestBasisData
basis function data types
TestSpaceType::template Evaluator< TrafoEvaluator >::Type TestEvaluator
space evaluator types
TestSpaceType::TrafoType TrafoType
trafo type
TestEvaluator::template ConfigTraits< test_config >::EvalDataType TestEvalData
space evaluation data types
TrafoEvaluator::template ConfigTraits< trafo_config >::EvalDataType TrafoEvalData
trafo evaluation data type
static constexpr int max_local_test_dofs
maximum local dofs
Function integral info class.
Trace Integral Assembler class template.
void assemble(Job_ &job)
Executes a trace assembly job.
const TrafoType & get_trafo() const
static constexpr bool need_combine
this task has no combine
TrafoEvaluator trafo_eval
trafo evaluator
Analytic::EvalTraits< DataType, Function_ > AnalyticEvalTraits
declare our analytic eval traits
FunctionIntegralType & job_integral
the function value
FunctionIntegralType loc_integral
the local integral
TrafoEvalData trafo_data
trafo eval data type
Trafo_::template Evaluator< FacetType, DataType >::Type TrafoEvaluator
trafo evaluator
Assembly::Intern::CubatureTraits< TrafoEvaluator >::RuleType cubature_rule
the cubature rule
Function_::template Evaluator< AnalyticEvalTraits > func_eval
the function evaluator
static constexpr bool need_scatter
this task needs to scatter
static constexpr TrafoTags trafo_config
our base-class typedef
Assembly job for the trace integration of an analytic function.
AnalyticFunctionIntegral< DataType, Function_ >::Type FunctionIntegralType
our function integral type
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
TraceAssemblyAnalyticFunctionIntegralJob(const Function_ &function_, const Trafo_ &trafo_, const String &cubature_)
Constructor.
const Trafo_ & trafo
the trafo to use
FunctionIntegralType integral
the function integral
const Function_ & function
the function to be integrated
Basic Matrix trace assembly task CRTP base-class for identical test-/trial-space.
TraceAssemblyBasicMatrixTaskCRTP1(Matrix_ &matrix_, const Space_ &space_, const Cubature::DynamicFactory &cubature_factory_, DataType alpha_)
Constructor.
void set_point(TrafoFacetEvalData &tau_f, TrafoEvalData &tau)
Sets the current cubature point.
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
DataType scatter_alpha
the scatter scaling factor
void combine()
Finalizes the assembly.
static constexpr bool need_combine
this task has no combine
Matrix_::ValueType ValueType
the value-type of the matrix
void eval(ValueType &val, const DataType &weight, const SpaceBasisData &psi, const SpaceBasisData &phi)
Evaluates the assembly for a test-/trial-basis function pair.
BaseClass::AsmTraits AsmTraits
our assembly traits
TraceAssemblyBasicTaskBase1< DataType, Space_, trafo_config_, facet_trafo_config_|TrafoTags::jac_det, space_config_ > BaseClass
our base class
Matrix_ & matrix
the matrix that is to be assembled
Matrix_::DataType DataType
the data-type of the matrix
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
Matrix_::ScatterAxpy scatter_axpy
the matrix scatter object
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
void assemble()
Performs the local assembly.
static constexpr bool need_scatter
this task needs to scatter
void scatter()
Scatters the local assembly.
AsmTraits::template TLocalMatrix< ValueType > local_matrix
the local matrix to be assembled
Basic Matrix assembly task CRTP base-class for different test-/trial-space.
AsmTraits::template TLocalMatrix< ValueType > local_matrix
the local matrix to be assembled
void set_point(TrafoFacetEvalData &tau_f, TrafoEvalData &tau)
Sets the current cubature point.
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
Matrix_::ValueType ValueType
the value-type of the matrix
void combine()
Finalizes the assembly.
Matrix_ & matrix
the matrix that is to be assembled
void eval(ValueType &val, const DataType &weight, const TrialBasisData &phi, const TestBasisData &psi)
Evaluates the assembly for a test-/trial-basis function pair.
static constexpr bool need_scatter
this task needs to scatter
TraceAssemblyBasicTaskBase2< typename Matrix_::DataType, TestSpace_, TrialSpace_, trafo_config_, facet_trafo_config_|TrafoTags::jac_det, test_config_, trial_config_ > BaseClass
our base class
Matrix_::ScatterAxpy scatter_axpy
the matrix scatter object
void scatter()
Scatters the local assembly.
TraceAssemblyBasicMatrixTaskCRTP2(Matrix_ &matrix_, const TestSpace_ &test_space_, const TestSpace_ &trial_space_, const Cubature::DynamicFactory &cubature_factory_, DataType alpha_)
Constructor.
DataType scatter_alpha
the scatter scaling factor
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
void void assemble()
Performs the local assembly.
Matrix_::DataType DataType
the data-type of the matrix
BaseClass::AsmTraits AsmTraits
our assembly traits
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
static constexpr bool need_combine
this task has no combine
Basic assembly task base class for a single finite element space without pairwise assembly support.
Tiny::Matrix< DataType, shape_dim, facet_dim > face_mat
local facet trafo matrices and vectors
Tiny::Vector< DataType, shape_dim > cur_point
current cubature point on reference cell
Assembly::AsmTraits1< DataType_, Space_, trafo_config_, space_config_ > AsmTraits
our assembly traits
TrafoFacetEvalData trafo_facet_data
the trafo facet evaluation data
TrafoType::template Evaluator< FacetType, DataType >::Type TrafoFacetEvaluator
trafo facet evaluator type
AsmTraits::SpaceType SpaceType
space type
TrafoType::ShapeType ShapeType
our shape type
SpaceEvalData space_data
the space evaluation data
const TrafoType & trafo
the trafo
AsmTraits::DataType DataType
our data type
Shape::FaceTraits< ShapeType, ShapeType::dimension-1 >::ShapeType FacetType
our facet type
AsmTraits::SpaceEvalData SpaceEvalData
space evaluation data
TrafoEvaluator trafo_eval
the trafo evaluator
static constexpr TrafoTags facet_trafo_config
include jacobian in facet trafo config (required for normal vector computation)
static constexpr int facet_dim
the facet dimension; always equal to shape_dim-1
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
SpaceEvaluator space_eval
the space evaluator
AsmTraits::SpaceEvaluator SpaceEvaluator
space evaluator type
TrafoEvalData trafo_data
the trafo evaluation data
AsmTraits::DofMapping dof_mapping
the space dof-mapping
AsmTraits::TrafoType TrafoType
trafo type
const SpaceType & space
the space
static constexpr int shape_dim
the shape dimension
TrafoFacetEvaluator trafo_facet_eval
the trafo facet evaluator
Intern::CubatureTraits< TrafoFacetEvaluator >::RuleType CubatureRuleType
cubature rule type
int cell_facet_ori
the internal cell facet orientation code
Tiny::Vector< DataType, facet_dim > cur_point_facet
current cubature point on reference facet
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
AsmTraits::TrafoEvaluator TrafoEvaluator
trafo evaluator type
AsmTraits::TrafoType TrafoType
trafo type
AsmTraits::DataType DataType
our data type
TrialEvaluator trial_eval
the trial space evaluator
TrafoFacetEvaluator trafo_facet_eval
the trafo facet evaluator
Tiny::Matrix< DataType, shape_dim, facet_dim > face_mat
local facet trafo matrices and vectors
TestEvaluator test_eval
the test space evaluator
const TrafoType & trafo
the trafo
TrafoEvalData trafo_data
the trafo evaluation data
Assembly::AsmTraits2< DataType_, TestSpace_, TrialSpace_, trafo_config_, test_config_, trial_config_ > AsmTraits
our assembly traits
const TrialSpaceType & trial_space
the trial space
static constexpr int shape_dim
the shape dimension
AsmTraits::TrialSpaceType TrialSpaceType
test space type
Shape::FaceTraits< ShapeType, ShapeType::dimension-1 >::ShapeType FacetType
our facet type
TrafoType::ShapeType ShapeType
our shape type
Tiny::Vector< DataType, facet_dim > cur_point_facet
current cubature point on reference facet
Intern::CubatureTraits< TrafoFacetEvaluator >::RuleType CubatureRuleType
cubature rule type
const TestSpaceType & test_space
the test space
AsmTraits::TestEvaluator TestEvaluator
test space evaluator type
AsmTraits::TestSpaceType TestSpaceType
test space type
Tiny::Vector< DataType, shape_dim > cur_point
current cubature point on reference cell
AsmTraits::TestEvalData TestEvalData
test evaluation data
TrialEvalData trial_data
the trial space evaluation data
AsmTraits::TrialEvaluator TrialEvaluator
trial space evaluator type
AsmTraits::TrialEvalData TrialEvalData
trial evaluation data
TestEvalData test_data
the test space evaluation data
AsmTraits::TrafoEvaluator TrafoEvaluator
trafo evaluator type
static constexpr int facet_dim
the facet dimension; always equal to shape_dim-1
static constexpr TrafoTags facet_trafo_config
include jacobian in facet trafo config (required for normal vector computation)
AsmTraits::TestDofMapping test_dof_mapping
the space dof-mappings
TrafoFacetEvalData trafo_facet_data
the trafo facet evaluation data
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
int cell_facet_ori
the internal cell facet orientation code
TrafoType::template Evaluator< FacetType, DataType >::Type TrafoFacetEvaluator
trafo facet evaluator type
TrafoEvaluator trafo_eval
the trafo evaluator
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
Basic Vector trace assembly task CRTP base-class.
void scatter()
Scatters the local assembly.
static constexpr bool need_scatter
this task needs to scatter
Vector_::DataType DataType
the data-type of the vector
void eval(ValueType &val, const DataType &weight, const SpaceBasisData &psi)
Evaluates the assembly for a basis function.
static constexpr bool need_combine
this task has no combine
TraceAssemblyBasicVectorTaskCRTP(Vector_ &vector_, const Space_ &space_, const Cubature::DynamicFactory &cubature_factory_, DataType alpha_)
Constructor.
void assemble()
Performs the local assembly.
Vector_::ScatterAxpy scatter_axpy
the vector scatter object
TraceAssemblyBasicTaskBase1< DataType, Space_, trafo_config_, facet_trafo_config_|TrafoTags::jac_det, space_config_ > BaseClass
our base-class
Vector_ & vector
the vector that is to be assembled
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
AsmTraits::template TLocalVector< ValueType > local_vector
the local vector to be assembled
BaseClass::AsmTraits AsmTraits
our assembly traits
void set_point(TrafoFacetEvalData &tau_f, TrafoEvalData &tau)
Sets the current cubature point.
void combine()
Finalizes the assembly.
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
Vector_::ValueType ValueType
the value-type of the vector
DataType scatter_alpha
the scatter scaling factor
const VectorSol_ & vec_sol
the local solution vector that the bilinear operator is applied to
AsmTraits::template TLocalMatrix< MatValType > local_matrix
the local matrix that is used to assemble the local vector
VectorSol_::GatherAxpy sol_gather
the gather axpy for the local solution vector
BaseClass::AsmTraits AsmTraits
our assembly traits
void assemble()
Performs the local assembly.
TraceAssemblyBasicVectorTaskCRTP< Task, Vector_, Space_, trafo_config, TrafoTags::none, space_config > BaseClass
our base-class typedef
BilinearOperator_::template Evaluator< AsmTraits > oper_eval
the bilinear operator evaluator
Vector assembly job for BilinearOperator and identical test-/trial-spaces.
TraceAssemblyBilinearOperatorApplyVectorJob1(const BilinearOperator_ &bilinear_operator_, Vector_ &vector_, const VectorSol_ &vec_sol_, const Space_ &space_, const String &cubature_, DataType alpha_=DataType(1))
Constructor.
Vector_ & vector
a reference to the vector that is to be assembled
const VectorSol_ & vec_sol
a reference to the vector the biliniear operator is applied on
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
const Space_ & space
a reference to the finite element space to be used as test-/trial-space
const BilinearOperator_ & bilinear_operator
a reference to the bilinear operator that is to be assembled
DataType alpha
the scaling factor for the assembly.
TraceAssemblyBasicMatrixTaskCRTP1< Task, Matrix_, Space_, trafo_config, TrafoTags::none, space_config > BaseClass
our base-class typedef
BaseClass::AsmTraits AsmTraits
our assembly traits
BilinearOperator_::template Evaluator< AsmTraits > oper_eval
the bilinear operator evaluator
Matrix assembly job for BilinearOperator implementations and identical test-/trial-spaces.
DataType alpha
the scaling factor for the assembly.
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
TraceAssemblyBilinearOperatorMatrixJob1(const BilinearOperator_ &bilinear_operator_, Matrix_ &matrix_, const Space_ &space_, String cubature_, DataType alpha_=DataType(1))
Constructor.
const Space_ & space
a reference to the finite element space to be used as test-/trial-space
Matrix_ & matrix
a reference to the matrix that is to be assembled
const BilinearOperator_ & bilinear_operator
a reference to the bilinear operator that is to be assembled
BaseClass::AsmTraits AsmTraits
our assembly traits
TraceAssemblyBasicMatrixTaskCRTP2< Task, Matrix_, TestSpace_, TrialSpace_, trafo_config, TrafoTags::none, test_config, trial_config > BaseClass
our base-class typedef
BilinearOperator_::template Evaluator< AsmTraits > oper_eval
the bilinear operator evaluator
Matrix assembly job for BilinearOperator implementations and different test-/trial-spaces.
const BilinearOperator_ & bilinear_operator
a reference to the bilinear operator that is to be assembled
Matrix_ & matrix
a reference to the matrix that is to be assembled
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
DataType alpha
the scaling factor for the assembly.
TraceAssemblyBilinearOperatorMatrixJob2(const BilinearOperator_ &bilinear_operator_, Matrix_ &matrix_, const TestSpace_ &test_space_, const TrialSpace_ &trial_space_, String cubature_, DataType alpha_=DataType(1))
Constructor.
const TrialSpace_ & trial_space
a reference to the finite element space to be used as trial-space
const TestSpace_ & test_space
a reference to the finite element space to be used as test-space
FunctionIntegralType & job_integral
the function value
void assemble()
Performs the local assembly.
BaseClass::AsmTraits AsmTraits
our assembly traits
static constexpr bool need_scatter
this task needs to scatter
FunctionIntegralType loc_integral
the local integral
void scatter()
Scatters the local assembly.
void combine()
Finalizes the assembly.
AsmTraits::template TLocalVector< ValueType > local_vector
the local vector to be assembled
static constexpr bool need_combine
this task has no combine
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
Vector_::GatherAxpy gather_axpy
the vector scatter object
TraceAssemblyBasicTaskBase1< DataType, Space_, trafo_config, facet_trafo_config, space_config > BaseClass
our base-class typedef
const Vector_ & vector
the vector that is to be integrated
Assembly job for the trace integration of a discrete finite element function.
TraceAssemblyDiscreteFunctionIntegralJob(const Vector_ &vector_, const Space_ &space_, String cubature_)
Constructor.
const Vector_ & vector
a reference to the vector that is to be integrated
FunctionIntegralType integral
the function integral
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
const Space_ & space
a reference to the finite element space to be used as test-/trial-space
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
const Vector_ & vector
the vector that is to be integrated
void scatter()
Scatters the local assembly.
static constexpr bool need_combine
this task has no combine
Function_::template Evaluator< AnalyticEvalTraits > func_eval
the function evaluator
TraceAssemblyBasicTaskBase1< DataType, Space_, trafo_config, facet_trafo_config, space_config > BaseClass
our base-class typedef
Analytic::EvalTraits< DataType, Function_ > AnalyticEvalTraits
declare our analytic eval traits
Vector_::GatherAxpy gather_axpy
the vector scatter object
static constexpr bool need_scatter
this task needs to scatter
BaseClass::AsmTraits AsmTraits
our assembly traits
FunctionIntegralType & job_integral
the function value
void combine()
Finalizes the assembly.
AsmTraits::template TLocalVector< ValueType > local_vector
the local vector to be assembled
FunctionIntegralType loc_integral
the local integral
void assemble()
Performs the local assembly.
Assembly job for the trace integration of a analytic vs discrete error function.
const Function_ & function
the function to be integrated
const Space_ & space
a reference to the finite element space to be used as test-/trial-space
FunctionIntegralType integral
the function integral
DiscreteFunctionIntegral< Vector_, Space_ >::Type FunctionIntegralType
make sure that function and vector are compatible
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
const Vector_ & vector
a reference to the vector that is to be integrated
TraceAssemblyErrorFunctionIntegralJob(const Function_ &function_, const Vector_ &vector_, const Space_ &space_, String cubature_)
Constructor.
TraceAssemblyBasicVectorTaskCRTP< Task, Vector_, Space_, trafo_config, TrafoTags::none, space_config > BaseClass
our base-class typedef
LinearFunctional_::template Evaluator< AsmTraits > func_eval
the bilinear operator evaluator
BaseClass::AsmTraits AsmTraits
our assembly traits
Vector trace assembly job for LinearFunctional implementations.
const Space_ & space
a reference to the finite element space to be used as test-/trial-space
Cubature::DynamicFactory cubature_factory
the cubature factory to be used for integration
Vector_ & vector
a reference to the vector that is to be assembled
DataType alpha
the scaling factor for the assembly.
TraceAssemblyLinearFunctionalVectorJob(const LinearFunctional_ &linear_functional_, Vector_ &vector_, const Space_ &space_, String cubature_, DataType alpha_=DataType(1))
Constructor.
const LinearFunctional_ & linear_functional
a reference to the linear functional that is to be assembled
TraceAssemblyStokesVectorAnalysisTaskCRTP< Task, VectorVelo_, VectorPres_, SpaceVelo_, SpacePres_, trafo_config, facet_trafo_config, space_velo_config, space_pres_config > BaseClass
our base-class typedef
void _eval(const DataType omega, const Tiny::Vector< DataType, 3, 3 > &n, const Tiny::Matrix< DataType, 3, 3, 3, 3 > &grad_v, const DataType val_p)
3D version
static constexpr bool need_scatter
this task needs to scatter
void combine()
Finalizes the assembly.
BaseClass::AsmTraits AsmTraits
our assembly traits
void _eval(const DataType omega, const Tiny::Vector< DataType, 2, 2 > &n, const Tiny::Matrix< DataType, 2, 2, 2, 2 > &grad_v, const DataType val_p)
2D version
static constexpr bool need_combine
this task has no combine
void scatter()
Scatters the local assembly.
Assembly job for the body forces computation of a Stokes solution vector.
DataType lift(DataType nu) const
Returns the raw lift force coefficient for a given viscosity parameter.
TraceAssemblyStokesBodyForceAssemblyJob(const VectorVelo_ &vector_velo_, const VectorPres_ &vector_pres_, const SpaceVelo_ &space_velo_, const SpacePres_ &space_pres_, String cubature_)
Constructor.
void sync(const Dist::Comm &comm)
Synchronizes the forces over a communicator.
DataType side(DataType nu) const
Returns the raw side force coefficient for a given viscosity parameter.
DataType drag(DataType nu) const
Returns the raw drag force coefficient for a given viscosity parameter.
Basic Stokes Vector analysis task CRTP base-class.
TraceAssemblyBasicTaskBase2< DataType, SpaceVelo_, SpacePres_, trafo_config_, facet_trafo_config_|TrafoTags::jac_det, space_velo_config_, space_pres_config_ > BaseClass
our base-class
VectorPres_::GatherAxpy gather_axpy_pres
the pressure vector object
void eval(TrafoFacetEvalData &tau_f, TrafoEvalData &tau, const DataType &weight, const VeloData &velo, const PresData &pres)
Sets the current cubature point.
const VectorVelo_ & vector_velo
the velocity vector that is to be analyzed
VectorVelo_::DataType DataType
the data-type of the vector
AsmTraits::template TLocalTestVector< VeloValueType > local_vector_velo
the local velocity vector to be assembled
VectorVelo_::ValueType VeloValueType
the value-type of the vectors
const VectorPres_ & vector_pres
the pressure vector that is to be analyzed
TraceAssemblyStokesVectorAnalysisTaskCRTP(const VectorVelo_ &vector_velo_, const VectorPres_ &vector_pres_, const SpaceVelo_ &space_velo_, const SpacePres_ &space_pres_, const Cubature::DynamicFactory &cubature_factory_)
Constructor.
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
void assemble()
Performs the local assembly.
BaseClass::AsmTraits AsmTraits
our assembly traits
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
AsmTraits::template TLocalTrialVector< PresValueType > local_vector_pres
the local pressure vector to be assembled
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
VectorVelo_::GatherAxpy gather_axpy_velo
the velocity vector object
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
Basis function evaluation data structure.
EvalTraits_::BasisValueType value
basis function value object
EvalTraits_::BasisReferenceHessianType ref_hess
basis reference hessian object
EvalTraits_::BasisHessianType hess
basis hessian object
EvalTraits_::BasisGradientType grad
basis gradient object
EvalTraits_::BasisReferenceGradientType ref_grad
basis reference gradient object
EvalTraits_::BasisReferenceValueType ref_value
basis reference value object
String class implementation.
Tiny Matrix class template.
RowType v[sm_]
actual matrix data; that's an array of vectors
CUDA_HOST_DEVICE void format(DataType alpha=DataType(0))
Formats the matrix.
Tiny Vector class template.
CUDA_HOST_DEVICE void format(DataType alpha=DataType(0))
Formats the vector.
void assemble_linear_functional_vector(DomainAssembler< Trafo_ > &dom_asm, Vector_ &vector, const LinFunc_ &linear_functional, const Space_ &space, const String &cubature, const typename Vector_::DataType alpha=typename Vector_::DataType(1))
Assembles a linear functional into a vector.
void assemble_bilinear_operator_matrix_2(DomainAssembler< Trafo_ > &dom_asm, Matrix_ &matrix, const BilOp_ &bilinear_operator, const TestSpace_ &test_space, const TrialSpace_ &trial_space, const String &cubature, const typename Matrix_::DataType alpha=typename Matrix_::DataType(1))
Assembles a bilinear operator into a matrix with different test- and trial-spaces.
AnalyticFunctionIntegral< DataType_, Function_ >::Type integrate_analytic_function(DomainAssembler< Trafo_ > &dom_asm, const Function_ &function, const String &cubature)
Assembles the integral of an analytic function.
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.
DiscreteFunctionIntegral< Vector_, Space_ >::Type integrate_error_function(DomainAssembler< Trafo_ > &dom_asm, const Function_ &function, const Vector_ &vector, const Space_ &space, const String &cubature)
Assembles the integral of an (analytic - discrete) error function.
void assemble_bilinear_operator_apply_vector_1(DomainAssembler< Trafo_ > &dom_asm, Vector_ &vector, const VectorSol_ &vec_sol, const BilOp_ &bilinear_operator, const Space_ &space, const String &cubature, const typename Vector_::DataType alpha=typename Vector_::DataType(1))
Assembles the application of a bilinear operator into a vector with identical test- and trial-spaces.
DiscreteFunctionIntegral< Vector_, Space_ >::Type integrate_discrete_function(DomainAssembler< Trafo_ > &dom_asm, const Vector_ &vector, const Space_ &space, const String &cubature)
Assembles the integral of a discrete finite element function.
const Operation op_sum(MPI_SUM)
Operation wrapper for MPI_SUM.
CUDA_HOST_DEVICE void axpy(T_ &y, const T_ &x, const T_ &alpha)
Performs an AXPY of two scalars.
Vector< T_, m_ > orthogonal(const Matrix< T_, m_, m_-1, sm_, sn_ > &tau)
Computes the positively oriented orthogonal vector to the columns of a m_ x (m_-1) Matrix.
SpaceTags
Space configuration tags enum.
@ value
specifies whether the space should supply basis function values
@ hess
specifies whether the space should supply basis function hessians
@ ref_value
specifies whether the space should supply reference basis function values
@ ref_hess
specifies whether the space should supply reference basis function hessians
@ ref_grad
specifies whether the space should supply reference basis function gradients
@ grad
specifies whether the space should supply basis function gradients
std::uint64_t Index
Index data type.
TrafoTags
Trafo configuration tags enum.
@ img_point
specifies whether the trafo should supply image point coordinates
@ jac_mat
specifies whether the trafo should supply jacobian matrices
@ jac_det
specifies whether the trafo should supply jacobian determinants
Helper class to determine the FunctionIntegralInfo type for discrete functions.
Face traits tag struct template.
static int facet_orientation(int facet_index)
Returns the orientation of a facet.