FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
trace_assembler_basic_jobs.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
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>
14
15namespace FEAT
16{
17 namespace Assembly
18 {
24 template<typename DataType_, typename Space_, TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags space_config_>
26 {
27 public:
28 // we do not support pairwise assembly
29 static constexpr bool assemble_pairwise = false;
33 typedef typename AsmTraits::DataType DataType;
39 typedef typename TrafoType::ShapeType ShapeType;
41 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
42
44 static constexpr int shape_dim = ShapeType::dimension;
46 static constexpr int facet_dim = FacetType::dimension;
47
51 typedef typename TrafoType::template Evaluator<FacetType, DataType>::Type TrafoFacetEvaluator;
52
55
57 static constexpr TrafoTags facet_trafo_config = facet_trafo_config_ | TrafoTags::jac_mat;
58
62 typedef typename TrafoFacetEvaluator::template ConfigTraits<facet_trafo_config>::EvalDataType TrafoFacetEvalData;
65 typedef typename AsmTraits::SpaceBasisData SpaceBasisData;
66
68 typedef typename Intern::CubatureTraits<TrafoFacetEvaluator>::RuleType CubatureRuleType;
69
70 protected:
89
92
98
103
104 public:
105 explicit TraceAssemblyBasicTaskBase1(const SpaceType& space_) :
106 space(space_),
107 trafo(space.get_trafo()),
111 trafo_data(),
113 space_data(),
116 {
118 ori_mat.format();
119 face_vec.format();
120 ori_vec.format();
121 }
122
123 virtual ~TraceAssemblyBasicTaskBase1() = default;
124
125 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
126 {
127 // compute facet trafo
128 Geometry::Intern::FaceRefTrafo<ShapeType, facet_dim>::compute(face_mat, face_vec, local_facet);
129
130 // compute orientation trafo
131 Geometry::Intern::CongruencyTrafo<FacetType>::compute(ori_mat, ori_vec, facet_ori);
132
133 // compute orientation of actual cell facet
134 cell_facet_ori = Geometry::Intern::CongruencySampler<FacetType>::orientation(facet_ori)
136
137 // prepare evaluators
138 trafo_facet_eval.prepare(facet);
139 trafo_eval.prepare(cell);
140 space_eval.prepare(trafo_eval);
141
142 // prepare dof mapping
143 dof_mapping.prepare(cell);
144 }
145
146 void prepare_point(Tiny::Vector<DataType, facet_dim>& pt)
147 {
148 // set cubature point
149 cur_point_facet = pt;
150
151 // transform point to local facet on reference cell
152 cur_point = (face_mat * ((ori_mat * cur_point_facet) + ori_vec)) + face_vec;
153
154 // compute trafo data
157
158 // compute normal vector
159 trafo_facet_data.normal = Tiny::orthogonal(trafo_facet_data.jac_mat).normalize();
160
161 // ensure that the normal vector "points outside"
162 if(cell_facet_ori < 0)
163 trafo_facet_data.normal.negate();
164
165 // copy normal to cell trafo data
166 trafo_data.normal = trafo_facet_data.normal;
167
168 // compute space data
170 }
171
172 void finish()
173 {
174 // finish evaluator
175 dof_mapping.finish();
176
177 // finish evaluators
178 space_eval.finish();
179 trafo_eval.finish();
180 trafo_facet_eval.finish();
181 }
182 }; // class TraceAssemblyBasicTaskBase1<...>
183
184 template<typename DataType_, typename TestSpace_, typename TrialSpace_,
185 TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags test_config_, SpaceTags trial_config_>
187 {
188 public:
189 // we do not support pairwise assembly
190 static constexpr bool assemble_pairwise = false;
202 typedef typename TrafoType::ShapeType ShapeType;
204 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
205
207 static constexpr int shape_dim = ShapeType::dimension;
209 static constexpr int facet_dim = FacetType::dimension;
210
214 typedef typename TrafoType::template Evaluator<FacetType, DataType>::Type TrafoFacetEvaluator;
215
219 typedef typename AsmTraits::TrialEvaluator TrialEvaluator;
220
222 static constexpr TrafoTags facet_trafo_config = facet_trafo_config_ | TrafoTags::jac_mat;
223
227 typedef typename TrafoFacetEvaluator::template ConfigTraits<facet_trafo_config>::EvalDataType TrafoFacetEvalData;
230 typedef typename AsmTraits::TestBasisData TestBasisData;
232 typedef typename AsmTraits::TrialEvalData TrialEvalData;
233 typedef typename AsmTraits::TrialBasisData TrialBasisData;
234
236 typedef typename Intern::CubatureTraits<TrafoFacetEvaluator>::RuleType CubatureRuleType;
237
238 protected:
263 typename AsmTraits::TrialDofMapping trial_dof_mapping;
264
267
273
278
279 public:
280 explicit TraceAssemblyBasicTaskBase2(const TestSpaceType& test_space_, const TrialSpaceType& trial_space_) :
281 test_space(test_space_),
282 trial_space(trial_space_),
283 trafo(test_space.get_trafo()),
288 trafo_data(),
290 test_data(),
291 trial_data(),
293 trial_dof_mapping(trial_space),
295 {
297 ori_mat.format();
298 face_vec.format();
299 ori_vec.format();
300 }
301
302 virtual ~TraceAssemblyBasicTaskBase2() = default;
303
304 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
305 {
306 // compute facet trafo
307 Geometry::Intern::FaceRefTrafo<ShapeType, facet_dim>::compute(face_mat, face_vec, local_facet);
308
309 // compute orientation trafo
310 Geometry::Intern::CongruencyTrafo<FacetType>::compute(ori_mat, ori_vec, facet_ori);
311
312 // compute orientation of actual cell facet
313 cell_facet_ori = Geometry::Intern::CongruencySampler<FacetType>::orientation(facet_ori)
315
316 // prepare evaluators
317 trafo_facet_eval.prepare(facet);
318 trafo_eval.prepare(cell);
319 test_eval.prepare(trafo_eval);
320 trial_eval.prepare(trafo_eval);
321
322 // prepare dof mapping
323 test_dof_mapping.prepare(cell);
324 trial_dof_mapping.prepare(cell);
325 }
326
327 void prepare_point(Tiny::Vector<DataType, facet_dim>& pt)
328 {
329 // set cubature point
330 cur_point_facet = pt;
331
332 // transform point to local facet on reference cell
333 cur_point = (face_mat * ((ori_mat * cur_point_facet) + ori_vec)) + face_vec;
334
335 // compute trafo data
338
339 // compute normal vector
340 trafo_facet_data.normal = Tiny::orthogonal(trafo_facet_data.jac_mat).normalize();
341
342 // ensure that the normal vector "points outside"
343 if(cell_facet_ori < 0)
344 trafo_facet_data.normal.negate();
345
346 // copy normal to cell trafo data
347 trafo_data.normal = trafo_facet_data.normal;
348
349 // compute space data
352 }
353
354 void finish()
355 {
356 // finish evaluator
357 trial_dof_mapping.finish();
358 test_dof_mapping.finish();
359
360 // finish evaluators
361 trial_eval.finish();
362 test_eval.finish();
363 trafo_eval.finish();
364 trafo_facet_eval.finish();
365 }
366 }; // class TraceAssemblyBasicTaskBase2<...>
367
396 template<typename Derived_, typename Vector_, typename Space_,
397 TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags space_config_>
399 public TraceAssemblyBasicTaskBase1<typename Vector_::DataType, Space_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_config_>
400 {
401 public:
403 typedef typename Vector_::DataType DataType;
405 typedef typename Vector_::ValueType ValueType;
406
411
413 static constexpr bool need_scatter = true;
415 static constexpr bool need_combine = false;
416
419 using typename BaseClass::SpaceBasisData;
420
421 protected:
423 Vector_& vector;
427 typename AsmTraits::template TLocalVector<ValueType> local_vector;
429 typename Vector_::ScatterAxpy scatter_axpy;
432
433 public:
449 explicit TraceAssemblyBasicVectorTaskCRTP(Vector_& vector_, const Space_& space_,
450 const Cubature::DynamicFactory& cubature_factory_, DataType alpha_) :
451 BaseClass(space_),
452 vector(vector_),
453 cubature_rule(Cubature::ctor_factory, cubature_factory_),
455 scatter_alpha(alpha_)
456 {
457 }
458
459#ifdef DOXYGEN
473
486 void eval(ValueType& val, const DataType& weight, const SpaceBasisData& psi);
487#endif // DOXYGEN
488
492 void assemble()
493 {
494 // format local vector
495 local_vector.format();
496
497 // fetch number of local dofs
498 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
499
500 // loop over all quadrature points and integrate
501 for(int k(0); k < cubature_rule.get_num_points(); ++k)
502 {
503 // prepare point
504 static_cast<Derived_&>(*this).prepare_point(cubature_rule.get_point(k));
505
506 // evaluate operator
507 static_cast<Derived_&>(*this).set_point(this->trafo_facet_data, this->trafo_data);
508
509 // test function loop
510 for(int i(0); i < num_loc_dofs; ++i)
511 {
512 // evaluate functional and integrate
513 static_cast<Derived_&>(*this).eval(local_vector(i),
514 this->trafo_facet_data.jac_det * cubature_rule.get_weight(k), this->space_data.phi[i]);
515 } // continue with next test function
516 } // continue with next cubature point
517 }
518
522 void scatter()
523 {
524 scatter_axpy(local_vector, this->dof_mapping, scatter_alpha);
525 }
526
530 void combine()
531 {
532 // nothing to do here
533 }
534 }; // class TraceAssemblyBasicVectorTaskCRTP<...>
535
553 template<typename LinearFunctional_, typename Vector_, typename Space_>
555 {
556 public:
557 typedef typename Vector_::DataType DataType;
558 typedef typename Vector_::ValueType ValueType;
559
560 static constexpr TrafoTags trafo_config = LinearFunctional_::trafo_config;
561 static constexpr SpaceTags space_config = LinearFunctional_::test_config;
562
563 class Task :
564 public TraceAssemblyBasicVectorTaskCRTP<Task, Vector_, Space_, trafo_config, TrafoTags::none, space_config>
565 {
566 protected:
569
572
574 typename LinearFunctional_::template Evaluator<AsmTraits> func_eval;
575
576 public:
578 BaseClass(job.vector, job.space, job.cubature_factory, job.alpha),
580 {
581 }
582
583 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
584 {
585 BaseClass::prepare(facet, cell, local_facet, facet_ori);
586 func_eval.prepare(this->trafo_eval);
587 }
588
589 void set_point(typename BaseClass::TrafoFacetEvalData& DOXY(tau_f), typename BaseClass::TrafoEvalData& tau)
590 {
591 func_eval.set_point(tau);
592 }
593
594 void eval(ValueType& val, const DataType& weight, typename BaseClass::SpaceBasisData& psi)
595 {
596 Tiny::axpy(val, func_eval.eval(psi), weight);
597 }
598
599 void finish()
600 {
601 func_eval.finish();
602 BaseClass::finish();
603 }
604 }; // class Task
605
606 protected:
608 const LinearFunctional_& linear_functional;
610 Vector_& vector;
612 const Space_& space;
616 DataType alpha;
617
618 public:
637 explicit TraceAssemblyLinearFunctionalVectorJob(const LinearFunctional_& linear_functional_,
638 Vector_& vector_, const Space_& space_, String cubature_, DataType alpha_ = DataType(1)) :
639 linear_functional(linear_functional_),
640 vector(vector_),
641 space(space_),
642 cubature_factory(cubature_),
643 alpha(alpha_)
644 {
645 }
646 }; // class TraceAssemblyLinearFunctionalVectorJob<...>
647
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))
673 {
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");
676
678 linear_functional, vector, space, cubature, alpha);
679 trace_asm.assemble(job);
680 }
681
710 template<typename Derived_, typename Matrix_, typename Space_,
711 TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags space_config_>
713 public TraceAssemblyBasicTaskBase1<typename Matrix_::DataType, Space_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_config_>
714 {
715 public:
717 typedef typename Matrix_::DataType DataType;
719 typedef typename Matrix_::ValueType ValueType;
720
725
727 static constexpr bool need_scatter = true;
729 static constexpr bool need_combine = false;
730
733 using typename BaseClass::SpaceBasisData;
734
735 protected:
737 Matrix_& matrix;
741 typename AsmTraits::template TLocalMatrix<ValueType> local_matrix;
743 typename Matrix_::ScatterAxpy scatter_axpy;
746
747 public:
763 explicit TraceAssemblyBasicMatrixTaskCRTP1(Matrix_& matrix_, const Space_& space_,
764 const Cubature::DynamicFactory& cubature_factory_, DataType alpha_) :
765 BaseClass(space_),
766 matrix(matrix_),
767 cubature_rule(Cubature::ctor_factory, cubature_factory_),
769 scatter_alpha(alpha_)
770 {
771 }
772
773#ifdef DOXYGEN
787
803 void eval(ValueType& val, const DataType& weight, const SpaceBasisData& psi, const SpaceBasisData& phi);
804#endif // DOXYGEN
805
809 void assemble()
810 {
811 // format local matrix
812 local_matrix.format();
813
814 // fetch number of local dofs
815 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
816
817 // loop over all quadrature points and integrate
818 for(int k(0); k < cubature_rule.get_num_points(); ++k)
819 {
820 // prepare point
821 static_cast<Derived_&>(*this).prepare_point(cubature_rule.get_point(k));
822
823 // evaluate operator
824 static_cast<Derived_&>(*this).set_point(this->trafo_facet_data, this->trafo_data);
825
826 // test function loop
827 for(int i(0); i < num_loc_dofs; ++i)
828 {
829 // trial function loop
830 for(int j(0); j < num_loc_dofs; ++j)
831 {
832 // evaluate operator and integrate
833 static_cast<Derived_&>(*this).eval(local_matrix(i,j),
834 this->trafo_facet_data.jac_det * cubature_rule.get_weight(k),
835 this->space_data.phi[j], this->space_data.phi[i]);
836 } // continue with next trial function
837 } // continue with next test function
838 } // continue with next cubature point
839 }
840
844 void scatter()
845 {
846 scatter_axpy(local_matrix, this->dof_mapping, this->dof_mapping, scatter_alpha);
847 }
848
852 void combine()
853 {
854 // nothing to do here
855 }
856 }; // class TraceAssemblyBasicMatrixTaskCRTP1<...>
857
892 template<typename Derived_, typename Matrix_, typename TestSpace_, typename TrialSpace_,
893 TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags test_config_, SpaceTags trial_config_>
895 public TraceAssemblyBasicTaskBase2<typename Matrix_::DataType, TestSpace_, TrialSpace_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, test_config_, trial_config_>
896 {
897 public:
899 typedef typename Matrix_::DataType DataType;
901 typedef typename Matrix_::ValueType ValueType;
902
907
909 static constexpr bool need_scatter = true;
911 static constexpr bool need_combine = false;
912
915 using typename BaseClass::TestBasisData;
916 using typename BaseClass::TrialBasisData;
917
918 protected:
920 Matrix_& matrix;
924 typename AsmTraits::template TLocalMatrix<ValueType> local_matrix;
926 typename Matrix_::ScatterAxpy scatter_axpy;
929
930 public:
949 explicit TraceAssemblyBasicMatrixTaskCRTP2(Matrix_& matrix_, const TestSpace_& test_space_,
950 const TestSpace_& trial_space_, const Cubature::DynamicFactory& cubature_factory_, DataType alpha_) :
951 BaseClass(test_space_, trial_space_),
952 matrix(matrix_),
953 cubature_rule(Cubature::ctor_factory, cubature_factory_),
955 scatter_alpha(alpha_)
956 {
957 }
958
959#ifdef DOXYGEN
973
989 void eval(ValueType& val, const DataType& weight, const TrialBasisData& phi, const TestBasisData& psi),
990#endif // DOXYGEN
991
995 void assemble()
996 {
997 // format local matrix
998 local_matrix.format();
999
1000 // fetch number of local dofs
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();
1003
1004 // loop over all quadrature points and integrate
1005 for(int k(0); k < cubature_rule.get_num_points(); ++k)
1006 {
1007 // prepare point
1008 static_cast<Derived_&>(*this).prepare_point(cubature_rule.get_point(k));
1009
1010 // evaluate operator
1011 static_cast<Derived_&>(*this).set_point(this->trafo_facet_data, this->trafo_data);
1012
1013 // test function loop
1014 for(int i(0); i < num_loc_test_dofs; ++i)
1015 {
1016 // trial function loop
1017 for(int j(0); j < num_loc_trial_dofs; ++j)
1018 {
1019 // evaluate operator and integrate
1020 static_cast<Derived_&>(*this).eval(local_matrix(i,j),
1021 this->trafo_facet_data.jac_det * cubature_rule.get_weight(k),
1022 this->trial_data.phi[j], this->test_data.phi[i]);
1023 } // continue with next trial function
1024 } // continue with next test function
1025 } // continue with next cubature point
1026 }
1027
1031 void scatter()
1032 {
1033 scatter_axpy(local_matrix, this->test_dof_mapping, this->trial_dof_mapping, scatter_alpha);
1034 }
1035
1039 void combine()
1040 {
1041 // nothing to do here
1042 }
1043 }; // class TraceAssemblyBasicMatrixTaskCRTP2<...>
1044
1062 template<typename BilinearOperator_, typename Matrix_, typename Space_>
1064 {
1065 public:
1066 typedef typename Matrix_::DataType DataType;
1067 typedef typename Matrix_::ValueType ValueType;
1068
1069 static constexpr TrafoTags trafo_config = BilinearOperator_::trafo_config;
1070 static constexpr SpaceTags space_config = BilinearOperator_::test_config | BilinearOperator_::trial_config;
1071
1072 class Task :
1073 public TraceAssemblyBasicMatrixTaskCRTP1<Task, Matrix_, Space_, trafo_config, TrafoTags::none, space_config>
1074 {
1075 protected:
1078
1081
1083 typename BilinearOperator_::template Evaluator<AsmTraits> oper_eval;
1084
1085 public:
1087 BaseClass(job.matrix, job.space, job.cubature_factory, job.alpha),
1089 {
1090 }
1091
1092 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
1093 {
1094 BaseClass::prepare(facet, cell, local_facet, facet_ori);
1095 oper_eval.prepare(this->trafo_eval);
1096 }
1097
1098 void set_point(typename BaseClass::TrafoFacetEvalData& DOXY(tau_f), typename BaseClass::TrafoEvalData& tau)
1099 {
1100 oper_eval.set_point(tau);
1101 }
1102
1103 void eval(ValueType& val, const DataType& weight, typename AsmTraits::TrialBasisData& phi, typename AsmTraits::TestBasisData& psi)
1104 {
1105 Tiny::axpy(val, oper_eval.eval(phi, psi), weight);
1106 }
1107
1108 void finish()
1109 {
1110 oper_eval.finish();
1111 BaseClass::finish();
1112 }
1113 }; // class Task
1114
1115 protected:
1117 const BilinearOperator_& bilinear_operator;
1119 Matrix_& matrix;
1121 const Space_& space;
1125 DataType alpha;
1126
1127 public:
1146 explicit TraceAssemblyBilinearOperatorMatrixJob1(const BilinearOperator_& bilinear_operator_,
1147 Matrix_& matrix_, const Space_& space_, String cubature_, DataType alpha_ = DataType(1)) :
1148 bilinear_operator(bilinear_operator_),
1149 matrix(matrix_),
1150 space(space_),
1151 cubature_factory(cubature_),
1152 alpha(alpha_)
1153 {
1154 }
1155 }; // class TraceAssemblyBilinearOperatorMatrixJob1<...>
1156
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))
1182 {
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");
1186
1188 bilinear_operator, matrix, space, cubature, alpha);
1189 trace_asm.assemble(job);
1190 }
1191
1212 template<typename BilinearOperator_, typename Matrix_, typename TestSpace_, typename TrialSpace_>
1214 {
1215 public:
1216 typedef typename Matrix_::DataType DataType;
1217 typedef typename Matrix_::ValueType ValueType;
1218
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;
1222
1223 class Task :
1224 public TraceAssemblyBasicMatrixTaskCRTP2<Task, Matrix_, TestSpace_, TrialSpace_, trafo_config, TrafoTags::none, test_config, trial_config>
1225 {
1226 protected:
1229
1232
1234 typename BilinearOperator_::template Evaluator<AsmTraits> oper_eval;
1235
1236 public:
1240 {
1241 }
1242
1243 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
1244 {
1245 BaseClass::prepare(facet, cell, local_facet, facet_ori);
1246 oper_eval.prepare(this->trafo_eval);
1247 }
1248
1249 void set_point(typename BaseClass::TrafoFacetEvalData& DOXY(tau_f), typename BaseClass::TrafoEvalData& tau)
1250 {
1251 oper_eval.set_point(tau);
1252 }
1253
1254 void eval(ValueType& val, const DataType& weight, typename AsmTraits::TrialBasisData& phi, typename AsmTraits::TestBasisData& psi)
1255 {
1256 Tiny::axpy(val, oper_eval.eval(phi, psi), weight);
1257 }
1258
1259 void finish()
1260 {
1261 oper_eval.finish();
1262 BaseClass::finish();
1263 }
1264 }; // class Task
1265
1266 protected:
1268 const BilinearOperator_& bilinear_operator;
1270 Matrix_& matrix;
1272 const TestSpace_& test_space;
1274 const TrialSpace_& trial_space;
1278 DataType alpha;
1279
1280 public:
1302 explicit TraceAssemblyBilinearOperatorMatrixJob2(const BilinearOperator_& bilinear_operator_,
1303 Matrix_& matrix_, const TestSpace_& test_space_, const TrialSpace_& trial_space_,
1304 String cubature_, DataType alpha_ = DataType(1)) :
1305 bilinear_operator(bilinear_operator_),
1306 matrix(matrix_),
1307 test_space(test_space_),
1308 trial_space(trial_space_),
1309 cubature_factory(cubature_),
1310 alpha(alpha_)
1311 {
1312 }
1313 }; // class TraceAssemblyBilinearOperatorMatrixJob2<...>
1314
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))
1344 {
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");
1349
1351 bilinear_operator, matrix, test_space, trial_space, cubature, alpha);
1352 trace_asm.assemble(job);
1353 }
1354
1379 template<typename BilinearOperator_, typename Vector_, typename VectorSol_, typename Space_>
1381 {
1382 public:
1383 typedef typename Vector_::DataType DataType;
1384 typedef typename Vector_::ValueType ValueType;
1385
1386 static constexpr TrafoTags trafo_config = BilinearOperator_::trafo_config;
1387 static constexpr SpaceTags space_config = BilinearOperator_::test_config | BilinearOperator_::trial_config;
1388
1389 class Task :
1390 public TraceAssemblyBasicVectorTaskCRTP<Task, Vector_, Space_, trafo_config, TrafoTags::none, space_config>
1391 {
1392 protected:
1395
1398 typedef typename BilinearOperator_::template Evaluator<AsmTraits>::ValueType MatValType;
1399
1401 typename BilinearOperator_::template Evaluator<AsmTraits> oper_eval;
1402
1404 const VectorSol_& vec_sol;
1405
1407 typename VectorSol_::GatherAxpy sol_gather;
1408
1410 typename AsmTraits::template TLocalMatrix<MatValType> local_matrix;
1411 typename AsmTraits::template TLocalVector<ValueType> local_vec_sol;
1412
1413
1414 public:
1416 BaseClass(job.vector, job.space, job.cubature_factory, job.alpha),
1418 vec_sol(job.vec_sol),
1420 {
1421 }
1422
1423 void prepare(Index facet, Index cell, int local_facet, int facet_ori)
1424 {
1425 BaseClass::prepare(facet, cell , local_facet, facet_ori);
1426 oper_eval.prepare(this->trafo_eval);
1427 local_vec_sol.format();
1428 sol_gather(local_vec_sol, this->dof_mapping);
1429 }
1430
1431 void set_point(typename BaseClass::TrafoFacetEvalData& DOXY(tau_f), typename BaseClass::TrafoEvalData& tau)
1432 {
1433 oper_eval.set_point(tau);
1434 }
1435
1436 void eval(MatValType& val, const DataType& weight,
1437 typename AsmTraits::TrialBasisData& phi, typename AsmTraits::TestBasisData& psi)
1438 {
1439 val += weight * oper_eval.eval(phi, psi);
1440 }
1441
1446 {
1447 // format local matrix
1448 local_matrix.format();
1449 this->local_vector.format();
1450
1451 // fetch number of local dofs
1452 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
1453
1454 // loop over all quadrature points and integrate
1455 for(int k(0); k < this->cubature_rule.get_num_points(); ++k)
1456 {
1457 // prep point
1458 this->prepare_point(this->cubature_rule.get_point(k));
1459 // evaluate operator
1460 this->set_point(this->trafo_facet_data, this->trafo_data);
1461
1462 // test function loop
1463 for(int i(0); i < num_loc_dofs; ++i)
1464 {
1465 // trial function loop
1466 for(int j(0); j < num_loc_dofs; ++j)
1467 {
1468 // evaluate operator and integrate
1469 this->eval(local_matrix(i,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]);
1472 // continue with next trial function
1473 }
1474 // continue with next test function
1475 }
1476 // continue with next cubature point
1477 }
1478
1479 // apply to local vector
1480 for(int i(0); i < num_loc_dofs; ++i)
1481 for(int j(0); j < num_loc_dofs; ++j)
1482 this->local_vector[i].add_mat_vec_mult(this->local_matrix(i,j), this->local_vec_sol[j]);
1483 }
1484
1485 void finish()
1486 {
1487 oper_eval.finish();
1488 BaseClass::finish();
1489 }
1490 }; // class Task
1491
1492 protected:
1494 const BilinearOperator_& bilinear_operator;
1496 Vector_& vector;
1498 const VectorSol_& vec_sol;
1500 const Space_& space;
1504 DataType alpha;
1505
1506 public:
1525 explicit TraceAssemblyBilinearOperatorApplyVectorJob1(const BilinearOperator_& bilinear_operator_,
1526 Vector_& vector_, const VectorSol_& vec_sol_, const Space_& space_, const String& cubature_, DataType alpha_ = DataType(1)) :
1527 bilinear_operator(bilinear_operator_),
1528 vector(vector_),
1529 vec_sol(vec_sol_),
1530 space(space_),
1531 cubature_factory(cubature_),
1532 alpha(alpha_)
1533 {
1534 }
1535 }; // class TraceAssemblyBilinearOperatorApplyVectorJob1<...>
1536
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))
1565 {
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");
1568
1570 bilinear_operator, vector, vec_sol, space, cubature, alpha);
1571 trace_asm.assemble(job);
1572 }
1573
1591 template<typename DataType_, typename Function_, typename Trafo_, int max_der_>
1593 {
1594 public:
1595 typedef DataType_ DataType;
1596
1599
1600 class Task
1601 {
1602 public:
1605
1606 typedef typename Trafo_::ShapeType ShapeType;
1607 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
1608
1610 typedef typename Trafo_::template Evaluator<FacetType, DataType>::Type TrafoEvaluator;
1611 typedef typename TrafoEvaluator::template ConfigTraits<trafo_config>::EvalDataType TrafoEvalData;
1612
1615
1616 // we do not support pairwise assembly
1617 static constexpr bool assemble_pairwise = false;
1619 static constexpr bool need_scatter = false;
1621 static constexpr bool need_combine = true;
1622
1623 protected:
1627 TrafoEvalData trafo_data;
1629 typename Assembly::Intern::CubatureTraits<TrafoEvaluator>::RuleType cubature_rule;
1631 typename Function_::template Evaluator<AnalyticEvalTraits> func_eval;
1636
1637 public:
1639 trafo_eval(job.trafo),
1640 trafo_data(),
1641 cubature_rule(Cubature::ctor_factory, job.cubature_factory),
1642 func_eval(job.function),
1643 loc_integral(),
1645 {
1646 }
1647
1648 void prepare(Index facet, Index DOXY(cell), int DOXY(local_facet), int DOXY(facet_ori))
1649 {
1650 trafo_eval.prepare(facet);
1651 }
1652
1653 void assemble()
1654 {
1655 // loop over all quadrature points and integrate
1656 for(int k(0); k < cubature_rule.get_num_points(); ++k)
1657 {
1658 // compute trafo data
1659 trafo_eval(trafo_data, cubature_rule.get_point(k));
1660
1661 // call helper to integrate
1662 Intern::AnaFunIntJobHelper<max_der_>::work(loc_integral,
1663 cubature_rule.get_weight(k) * trafo_data.jac_det, func_eval, trafo_data.img_point);
1664 }
1665 }
1666
1667 void scatter()
1668 {
1669 // nothing to do here
1670 }
1671
1672 void finish()
1673 {
1674 trafo_eval.finish();
1675 }
1676
1677 void combine()
1678 {
1680 }
1681 }; // class Task
1682
1683 protected:
1685 const Trafo_& trafo;
1687 const Function_& function;
1692
1693 public:
1706 explicit TraceAssemblyAnalyticFunctionIntegralJob(const Function_& function_, const Trafo_& trafo_, const String& cubature_) :
1707 trafo(trafo_),
1708 function(function_),
1709 cubature_factory(cubature_),
1710 integral()
1711 {
1712 integral.max_der = max_der_;
1713 }
1714
1715 // \returns The integral of the discrete function
1716 FunctionIntegralType& result()
1717 {
1718 return integral;
1719 }
1720 }; // class TraceAssemblyAnalyticFunctionIntegralJob<...>
1721
1744 template<int max_der_, typename DataType_, typename Function_, typename Trafo_>
1746 TraceAssembler<Trafo_>& trace_asm, const Function_& function, const String& cubature)
1747 {
1749 trace_asm.assemble(job);
1750 return job.result();
1751 }
1752
1767 template<typename Vector_, typename Space_, int max_der_>
1769 {
1770 public:
1771 typedef typename Vector_::DataType DataType;
1772 typedef typename Vector_::ValueType ValueType;
1773
1774 static constexpr TrafoTags trafo_config = TrafoTags::none;
1775 static constexpr SpaceTags space_config = SpaceTags::value |
1776 (max_der_ >= 1 ? SpaceTags::grad : SpaceTags::none) |
1777 (max_der_ >= 2 ? SpaceTags::hess : SpaceTags::none);
1778 static constexpr TrafoTags facet_trafo_config = TrafoTags::jac_det;
1779
1780 typedef typename DiscreteFunctionIntegral<Vector_, Space_>::Type FunctionIntegralType;
1781
1782 class Task :
1783 public TraceAssemblyBasicTaskBase1<DataType, Space_, trafo_config, facet_trafo_config, space_config>
1784 {
1785 public:
1788
1791
1792 // we do not support pairwise assembly
1793 static constexpr bool assemble_pairwise = false;
1795 static constexpr bool need_scatter = false;
1797 static constexpr bool need_combine = true;
1798
1799 using typename BaseClass::TrafoEvalData;
1800 using typename BaseClass::TrafoFacetEvalData;
1801
1802 protected:
1804 const Vector_& vector;
1808 typename AsmTraits::template TLocalVector<ValueType> local_vector;
1810 typename Vector_::GatherAxpy gather_axpy;
1812 FunctionIntegralType loc_integral;
1814 FunctionIntegralType& job_integral;
1815
1816 public:
1818 BaseClass(job.space),
1819 vector(job.vector),
1820 cubature_rule(Cubature::ctor_factory, job.cubature_factory),
1821 local_vector(),
1823 loc_integral(),
1825 {
1826 }
1827
1830 {
1831 // format local vector
1832 local_vector.format();
1833
1834 // gather local vector data
1835 gather_axpy(local_vector, this->dof_mapping);
1836
1837 // fetch number of local dofs
1838 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
1839
1840 // loop over all quadrature points and integrate
1841 for(int k(0); k < cubature_rule.get_num_points(); ++k)
1842 {
1843 // prepare point
1844 this->prepare_point(cubature_rule.get_point(k));
1845
1846 // do the dirty work
1847 Intern::DiscFunIntJobHelper<max_der_>::work(loc_integral,
1848 cubature_rule.get_weight(k) * this->trafo_facet_data.jac_det, this->space_data, local_vector, num_loc_dofs);
1849 } // continue with next cubature point
1850 }
1851
1853 void scatter()
1854 {
1855 // nothing to do here
1856 }
1857
1859 void combine()
1860 {
1862 }
1863 }; // class Task
1864
1865 protected:
1867 const Vector_& vector;
1869 const Space_& space;
1873 FunctionIntegralType integral;
1874
1875 public:
1888 explicit TraceAssemblyDiscreteFunctionIntegralJob(const Vector_& vector_, const Space_& space_, String cubature_):
1889 vector(vector_),
1890 space(space_),
1891 cubature_factory(cubature_),
1892 integral()
1893 {
1894 integral.max_der = max_der_;
1895 }
1896
1897 // \returns The integral of the discrete function
1898 FunctionIntegralType& result()
1899 {
1900 return integral;
1901 }
1902 }; // class TraceAssemblyDiscreteFunctionIntegralJob<...>
1903
1926 template<int max_der_, typename Vector_, typename Trafo_, typename Space_>
1928 TraceAssembler<Trafo_>& trace_asm, const Vector_& vector, const Space_& space, const String& cubature)
1929 {
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");
1933 trace_asm.assemble(job);
1934 return job.result();
1935 }
1936
1959 template<typename Function_, typename Vector_, typename Space_, int max_der_>
1961 {
1962 public:
1963 typedef typename Vector_::DataType DataType;
1964 typedef typename Vector_::ValueType ValueType;
1965
1967 static_assert(Intern::ErrCompatHelper<Function_, Vector_>::valid, "function and vector are incompatible");
1968
1971
1972 static constexpr TrafoTags trafo_config = TrafoTags::none;
1973 static constexpr SpaceTags space_config = SpaceTags::value |
1974 (max_der_ >= 1 ? SpaceTags::grad : SpaceTags::none) |
1975 (max_der_ >= 2 ? SpaceTags::hess : SpaceTags::none);
1976 static constexpr TrafoTags facet_trafo_config = TrafoTags::img_point | TrafoTags::jac_det;
1977
1978 class Task :
1979 public TraceAssemblyBasicTaskBase1<DataType, Space_, trafo_config, facet_trafo_config, space_config>
1980 {
1981 public:
1984
1987
1990
1991 // we do not support pairwise assembly
1992 static constexpr bool assemble_pairwise = false;
1994 static constexpr bool need_scatter = false;
1996 static constexpr bool need_combine = true;
1997
1998 using typename BaseClass::TrafoEvalData;
1999 using typename BaseClass::TrafoFacetEvalData;
2000
2001 protected:
2003 typename Function_::template Evaluator<AnalyticEvalTraits> func_eval;
2005 const Vector_& vector;
2009 typename AsmTraits::template TLocalVector<ValueType> local_vector;
2011 typename Vector_::GatherAxpy gather_axpy;
2016
2017 public:
2019 BaseClass(job.space),
2020 func_eval(job.function),
2021 vector(job.vector),
2022 cubature_rule(Cubature::ctor_factory, job.cubature_factory),
2023 local_vector(),
2025 loc_integral(),
2027 {
2028 }
2029
2032 {
2033 // format local vector
2034 local_vector.format();
2035
2036 // gather local vector data
2037 gather_axpy(local_vector, this->dof_mapping);
2038
2039 // fetch number of local dofs
2040 const int num_loc_dofs = this->space_eval.get_num_local_dofs();
2041
2042 // loop over all quadrature points and integrate
2043 for(int k(0); k < cubature_rule.get_num_points(); ++k)
2044 {
2045 // prepare point
2046 this->prepare_point(cubature_rule.get_point(k));
2047
2048 // do the dirty work
2049 Intern::ErrFunIntJobHelper<max_der_>::work(loc_integral,
2050 cubature_rule.get_weight(k) * this->trafo_facet_data.jac_det, func_eval,
2051 this->trafo_facet_data.img_point, this->space_data, local_vector, num_loc_dofs);
2052
2053 } // continue with next cubature point
2054 }
2055
2057 void scatter()
2058 {
2059 // nothing to do here
2060 }
2061
2063 void combine()
2064 {
2066 }
2067 }; // class Task
2068
2069 protected:
2071 const Function_& function;
2073 const Vector_& vector;
2075 const Space_& space;
2080
2081 public:
2097 explicit TraceAssemblyErrorFunctionIntegralJob(const Function_& function_, const Vector_& vector_, const Space_& space_, String cubature_):
2098 function(function_),
2099 vector(vector_),
2100 space(space_),
2101 cubature_factory(cubature_),
2102 integral()
2103 {
2104 integral.max_der = max_der_;
2105 }
2106
2107 // \returns The integral of the discrete function
2108 FunctionIntegralType& result()
2109 {
2110 return integral;
2111 }
2112 }; // class TraceAssemblyErrorFunctionIntegralJob<...>
2113
2139 template<int max_der_, typename Function_, typename Vector_, typename Trafo_, typename Space_>
2141 TraceAssembler<Trafo_>& trace_asm, const Function_& function,
2142 const Vector_& vector, const Space_& space, const String& cubature)
2143 {
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");
2147 trace_asm.assemble(job);
2148 return job.result();
2149 }
2150
2190 template<typename Derived_, typename VectorVelo_, typename VectorPres_, typename SpaceVelo_, typename SpacePres_,
2191 TrafoTags trafo_config_, TrafoTags facet_trafo_config_, SpaceTags space_velo_config_, SpaceTags space_pres_config_>
2193 public TraceAssemblyBasicTaskBase2<typename VectorVelo_::DataType, SpaceVelo_, SpacePres_, trafo_config_, facet_trafo_config_ | TrafoTags::jac_det, space_velo_config_, space_pres_config_>
2194 {
2195 public:
2197 typedef typename VectorVelo_::DataType DataType;
2198
2203
2205 typedef typename VectorVelo_::ValueType VeloValueType;
2206 typedef typename VectorPres_::ValueType PresValueType;
2207
2210 typedef typename TrafoEvalData::EvalTraits TrafoEvalTraits;
2211
2212 static constexpr int max_local_velo_dofs = AsmTraits::max_local_test_dofs;
2213 static constexpr int max_local_pres_dofs = AsmTraits::max_local_trial_dofs;
2214
2217
2218 protected:
2220 const VectorVelo_& vector_velo;
2222 const VectorPres_& vector_pres;
2226 typename AsmTraits::template TLocalTestVector<VeloValueType> local_vector_velo;
2228 typename AsmTraits::template TLocalTrialVector<PresValueType> local_vector_pres;
2230 typename VectorVelo_::GatherAxpy gather_axpy_velo;
2232 typename VectorPres_::GatherAxpy gather_axpy_pres;
2233
2234 public:
2248 const VectorVelo_& vector_velo_, const VectorPres_& vector_pres_,
2249 const SpaceVelo_& space_velo_, const SpacePres_& space_pres_,
2250 const Cubature::DynamicFactory& cubature_factory_) :
2251 BaseClass(space_velo_, space_pres_),
2252 vector_velo(vector_velo_),
2253 vector_pres(vector_pres_),
2254 cubature_rule(Cubature::ctor_factory, cubature_factory_),
2257 {
2258 }
2259
2260#ifdef DOXYGEN
2282 void eval(TrafoFacetEvalData& tau_f, TrafoEvalData& tau, const DataType& weight,
2283 const VeloData& velo, const PresData& pres);
2284#endif // DOXYGEN
2285
2290 {
2291 // gather local vectors
2292 local_vector_velo.format();
2293 local_vector_pres.format();
2294 gather_axpy_velo(local_vector_velo, this->test_dof_mapping);
2295 gather_axpy_pres(local_vector_pres, this->trial_dof_mapping);
2296
2297 // fetch number of local dofs
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();
2300
2301 VeloData velo_data;
2302 PresData pres_data;
2303
2304 // loop over all quadrature points and integrate
2305 for(int k(0); k < cubature_rule.get_num_points(); ++k)
2306 {
2307 // prepare point
2308 static_cast<Derived_&>(*this).prepare_point(cubature_rule.get_point(k));
2309
2310 velo_data.format();
2311 pres_data.format();
2312
2313 // compute velocity data
2314 for(int i(0); i < num_loc_dofs_velo; ++i)
2315 {
2316 if constexpr (*(space_velo_config_ & SpaceTags::value))
2317 velo_data.value.axpy(this->test_data.phi[i].value, local_vector_velo(i));
2318 if constexpr (*(space_velo_config_ & SpaceTags::ref_value))
2319 velo_data.ref_value.axpy(this->test_data.phi[i].ref_value, local_vector_velo(i));
2320 if constexpr (*(space_velo_config_ & SpaceTags::grad))
2321 velo_data.grad.add_outer_product(local_vector_velo(i), this->test_data.phi[i].grad);
2322 if constexpr (*(space_velo_config_ & SpaceTags::ref_grad))
2323 velo_data.ref_grad.add_outer_product(local_vector_velo(i), this->test_data.phi[i].ref_grad);
2324 if constexpr (*(space_velo_config_ & SpaceTags::hess))
2325 velo_data.hess.add_vec_mat_outer_product(local_vector_velo(i), this->test_data.phi[i].hess);
2326 if constexpr (*(space_velo_config_ & SpaceTags::ref_hess))
2327 velo_data.ref_hess.add_vec_mat_outer_product(local_vector_velo(i), this->test_data.phi[i].ref_hess);
2328 }
2329
2330 // compute velocity data
2331 for(int i(0); i < num_loc_dofs_pres; ++i)
2332 {
2333 if constexpr (*(space_pres_config_ & SpaceTags::value))
2334 pres_data.value += local_vector_pres(i) * this->trial_data.phi[i].value;
2335 if constexpr (*(space_pres_config_ & SpaceTags::ref_value))
2336 pres_data.ref_value += local_vector_pres(i) * this->trial_data.phi[i].ref_value;
2337 if constexpr (*(space_pres_config_ & SpaceTags::grad))
2338 pres_data.grad.axpy(local_vector_pres(i), this->trial_data.phi[i].grad);
2339 if constexpr (*(space_pres_config_ & SpaceTags::ref_grad))
2340 pres_data.ref_grad.axpy(local_vector_pres(i), this->trial_data.phi[i].ref_grad);
2341 if constexpr (*(space_pres_config_ & SpaceTags::hess))
2342 pres_data.hess.axpy(local_vector_pres(i), this->trial_data.phi[i].hess);
2343 if constexpr (*(space_pres_config_ & SpaceTags::ref_hess))
2344 pres_data.ref_hess.axpy(local_vector_pres(i), this->trial_data.phi[i].ref_hess);
2345 }
2346
2347 // evaluate
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);
2350 } // continue with next cubature point
2351 }
2352 }; // class TraceAssemblyStokesVectorAnalysisTaskCRTP<...>
2353
2367 template<typename VectorVelo_, typename VectorPres_, typename SpaceVelo_, typename SpacePres_>
2369 {
2370 public:
2371 typedef typename VectorVelo_::DataType DataType;
2372 typedef typename VectorVelo_::ValueType VeloValueType;
2373 typedef typename VectorPres_::ValueType PresValueType;
2374
2375 static constexpr TrafoTags trafo_config = TrafoTags::none;
2376 static constexpr SpaceTags space_velo_config = SpaceTags::value | SpaceTags::grad;
2377 static constexpr SpaceTags space_pres_config = SpaceTags::value;
2378 static constexpr TrafoTags facet_trafo_config = TrafoTags::jac_det | TrafoTags::normal;
2379
2380 static constexpr int dim = SpaceVelo_::shape_dim;
2381
2383
2384 class Task :
2385 public TraceAssemblyStokesVectorAnalysisTaskCRTP<Task, VectorVelo_, VectorPres_, SpaceVelo_, SpacePres_, trafo_config, facet_trafo_config, space_velo_config, space_pres_config>
2386 {
2387 public:
2390
2393
2394 // we do not support pairwise assembly
2395 static constexpr bool assemble_pairwise = false;
2397 static constexpr bool need_scatter = false;
2399 static constexpr bool need_combine = true;
2400
2401 using typename BaseClass::TrafoEvalData;
2402 using typename BaseClass::TrafoFacetEvalData;
2403 using typename BaseClass::VeloData;
2404 using typename BaseClass::PresData;
2405
2406 protected:
2407 RawForces& job_raw_forces;
2408 RawForces raw_forces;
2409
2410 public:
2412 BaseClass(job.vector_velo, job.vector_pres, job.space_velo, job.space_pres, job.cubature_factory),
2413 job_raw_forces(job.raw_forces),
2414 raw_forces()
2415 {
2416 raw_forces.format();
2417 }
2418
2419 void eval(TrafoFacetEvalData& tau_f, TrafoEvalData& DOXY(tau), DataType weight, const VeloData& velo, const PresData& pres)
2420 {
2421 this->_eval(weight, tau_f.normal, velo.grad, pres.value);
2422 }
2423
2425 void scatter()
2426 {
2427 // nothing to do here
2428 }
2429
2431 void combine()
2432 {
2433 job_raw_forces += raw_forces;
2434 }
2435
2436 protected:
2438 void _eval(const DataType omega, const Tiny::Vector<DataType, 2, 2>& n,
2439 const Tiny::Matrix<DataType, 2, 2, 2, 2>& grad_v, const DataType val_p)
2440 {
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];
2445 }
2446
2448 void _eval(const DataType omega, const Tiny::Vector<DataType, 3, 3>& n,
2449 const Tiny::Matrix<DataType, 3, 3, 3, 3>& grad_v, const DataType val_p)
2450 {
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];
2457 }
2458 }; // class Task
2459
2460 protected:
2461 const VectorVelo_& vector_velo;
2462 const VectorPres_& vector_pres;
2463 const SpaceVelo_& space_velo;
2464 const SpacePres_& space_pres;
2465 Cubature::DynamicFactory cubature_factory;
2466 RawForces raw_forces;
2467
2468 public:
2487 explicit TraceAssemblyStokesBodyForceAssemblyJob(const VectorVelo_& vector_velo_, const VectorPres_& vector_pres_,
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_),
2494 raw_forces()
2495 {
2496 raw_forces.format();
2497 }
2498
2500 DataType drag(DataType nu) const
2501 {
2502 return nu * raw_forces(0, 0) - raw_forces(0, 1);
2503 }
2504
2506 DataType lift(DataType nu) const
2507 {
2508 return nu * raw_forces(1, 0) - raw_forces(1, 1);
2509 }
2510
2512 DataType side(DataType nu) const
2513 {
2514 return nu * raw_forces(2, 0) - raw_forces(2, 1);
2515 }
2516
2518 void sync(const Dist::Comm& comm)
2519 {
2520 comm.allreduce(&raw_forces.v[0][0], &raw_forces.v[0][0], std::size_t(6), Dist::op_sum);
2521 }
2522 }; // class TraceAssemblyStokesBodyForceAssemblyJob<...>
2523 } // namespace Assembly
2524} // namespace FEAT
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Definition: assertion.hpp:263
Common single-space assembly traits class template.
Definition: asm_traits.hpp:83
TrafoType::template Evaluator< ShapeType, DataType >::Type TrafoEvaluator
trafo evaluator type
Definition: asm_traits.hpp:104
SpaceEvalData::BasisDataType SpaceBasisData
basis function data types
Definition: asm_traits.hpp:148
SpaceEvaluator::template ConfigTraits< space_config >::EvalDataType SpaceEvalData
space evaluation data types
Definition: asm_traits.hpp:142
DataType_ DataType
data type
Definition: asm_traits.hpp:86
SpaceType::TrafoType TrafoType
trafo type
Definition: asm_traits.hpp:97
SpaceType::DofMappingType DofMapping
dof-mapping types
Definition: asm_traits.hpp:155
TrafoEvaluator::template ConfigTraits< trafo_config >::EvalDataType TrafoEvalData
trafo evaluation data type
Definition: asm_traits.hpp:138
SpaceType::template Evaluator< TrafoEvaluator >::Type SpaceEvaluator
space evaluator types
Definition: asm_traits.hpp:110
Space_ SpaceType
space type
Definition: asm_traits.hpp:88
Common test-/trial-space assembly traits class template.
Definition: asm_traits.hpp:227
TestSpaceType::DofMappingType TestDofMapping
dof-mapping types
Definition: asm_traits.hpp:291
TrafoType::template Evaluator< ShapeType, DataType >::Type TrafoEvaluator
trafo evaluator type
Definition: asm_traits.hpp:246
TrialSpace_ TrialSpaceType
trial-space type
Definition: asm_traits.hpp:234
TestSpace_ TestSpaceType
test-space type
Definition: asm_traits.hpp:232
DataType_ DataType
data type
Definition: asm_traits.hpp:230
TestEvalData::BasisDataType TestBasisData
basis function data types
Definition: asm_traits.hpp:286
TestSpaceType::template Evaluator< TrafoEvaluator >::Type TestEvaluator
space evaluator types
Definition: asm_traits.hpp:252
TestSpaceType::TrafoType TrafoType
trafo type
Definition: asm_traits.hpp:239
TestEvaluator::template ConfigTraits< test_config >::EvalDataType TestEvalData
space evaluation data types
Definition: asm_traits.hpp:281
TrafoEvaluator::template ConfigTraits< trafo_config >::EvalDataType TrafoEvalData
trafo evaluation data type
Definition: asm_traits.hpp:277
static constexpr int max_local_test_dofs
maximum local dofs
Definition: asm_traits.hpp:301
Trace Integral Assembler class template.
void assemble(Job_ &job)
Executes a trace assembly job.
const TrafoType & get_trafo() const
Analytic::EvalTraits< DataType, Function_ > AnalyticEvalTraits
declare our analytic eval traits
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
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.
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
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.
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
static constexpr bool need_scatter
this task needs to scatter
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
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
TraceAssemblyBasicMatrixTaskCRTP2(Matrix_ &matrix_, const TestSpace_ &test_space_, const TestSpace_ &trial_space_, const Cubature::DynamicFactory &cubature_factory_, DataType alpha_)
Constructor.
TrafoFacetEvaluator::template ConfigTraits< facet_trafo_config >::EvalDataType TrafoFacetEvalData
trafo facet evaluation data
Matrix_::DataType DataType
the data-type of the matrix
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
SpaceEvalData space_data
the space evaluation data
Shape::FaceTraits< ShapeType, ShapeType::dimension-1 >::ShapeType FacetType
our facet type
AsmTraits::SpaceEvalData SpaceEvalData
space evaluation data
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
AsmTraits::SpaceEvaluator SpaceEvaluator
space evaluator type
TrafoEvalData trafo_data
the trafo evaluation data
AsmTraits::DofMapping dof_mapping
the space dof-mapping
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
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
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
Tiny::Vector< DataType, facet_dim > cur_point_facet
current cubature point on reference facet
Intern::CubatureTraits< TrafoFacetEvaluator >::RuleType CubatureRuleType
cubature rule type
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
AsmTraits::TrafoEvalData TrafoEvalData
trafo evaluation data
Basic Vector trace assembly task CRTP base-class.
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.
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
void set_point(TrafoFacetEvalData &tau_f, TrafoEvalData &tau)
Sets the current cubature point.
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
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
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
TraceAssemblyBasicMatrixTaskCRTP1< Task, Matrix_, Space_, trafo_config, TrafoTags::none, space_config > BaseClass
our base-class typedef
BilinearOperator_::template Evaluator< AsmTraits > oper_eval
the bilinear operator evaluator
Matrix assembly job for BilinearOperator implementations and identical test-/trial-spaces.
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
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
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
AsmTraits::template TLocalVector< ValueType > local_vector
the local vector to be assembled
BaseClass::CubatureRuleType cubature_rule
the cubature rule used for integration
TraceAssemblyBasicTaskBase1< DataType, Space_, trafo_config, facet_trafo_config, space_config > BaseClass
our base-class typedef
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
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
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
static constexpr bool need_scatter
this task needs to scatter
AsmTraits::template TLocalVector< ValueType > local_vector
the local vector to be assembled
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
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
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
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
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
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
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
Communicator class.
Definition: dist.hpp:1349
void allreduce(const void *sendbuf, void *recvbuf, std::size_t count, const Datatype &datatype, const Operation &op) const
Blocking All-Reduce.
Definition: dist.cpp:655
Basis function evaluation data structure.
Definition: eval_data.hpp:37
EvalTraits_::BasisValueType value
basis function value object
Definition: eval_data.hpp:47
EvalTraits_::BasisReferenceHessianType ref_hess
basis reference hessian object
Definition: eval_data.hpp:50
EvalTraits_::BasisHessianType hess
basis hessian object
Definition: eval_data.hpp:43
EvalTraits_::BasisGradientType grad
basis gradient object
Definition: eval_data.hpp:45
EvalTraits_::BasisReferenceGradientType ref_grad
basis reference gradient object
Definition: eval_data.hpp:52
EvalTraits_::BasisReferenceValueType ref_value
basis reference value object
Definition: eval_data.hpp:54
String class implementation.
Definition: string.hpp:46
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.
Definition: dist.hpp:271
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.
FEAT namespace.
Definition: adjactor.hpp:12
SpaceTags
Space configuration tags enum.
Definition: eval_tags.hpp:97
@ 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.
Definition: eval_tags.hpp:22
@ 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.
Definition: shape.hpp:106
static int facet_orientation(int facet_index)
Returns the orientation of a facet.