33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__DOMAIN_DISC_IMPL__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__DOMAIN_DISC_IMPL__
48 template <
class TElemDisc>
51 for(
size_t i = 0; i < vElemDisc.size(); ++i)
53 vElemDisc[i]->prep_assemble_loop();
57 template <
class TElemDisc>
60 for(
size_t i = 0; i < vElemDisc.size(); ++i)
62 vElemDisc[i]->post_assemble_loop();
67 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
71 if(!m_spApproxSpace.valid())
72 UG_THROW(
"DomainDiscretization: Before using the "
73 "DomainDiscretization an ApproximationSpace must be set to it. "
74 "Please use DomainDiscretization:set_approximation_space to "
75 "set an appropriate Space.");
79 for(
size_t i = 0; i < m_vDomainElemDisc.size(); ++i)
81 m_vDomainElemDisc[i]->set_approximation_space(m_spApproxSpace);
83 if(!(m_spAssTuner->elem_disc_type_enabled(m_vDomainElemDisc[i]->type())))
continue;
84 m_vElemDisc.push_back(m_vDomainElemDisc[i].
get());
88 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
92 if(!m_spApproxSpace.valid())
93 UG_THROW(
"DomainDiscretization: Before using the "
94 "DomainDiscretization an ApproximationSpace must be set to it. "
95 "Please use DomainDiscretization:set_approximation_space to "
96 "set an appropriate Space.");
100 for(
size_t i = 0; i < m_vDomainElemError.size(); ++i)
102 m_vDomainElemError[i]->set_approximation_space(m_spApproxSpace);
104 if(!(m_spAssTuner->elem_disc_type_enabled(m_vDomainElemError[i]->type())))
continue;
105 m_vElemError.push_back(m_vDomainElemError[i].
get());
111 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
115 if(!m_spApproxSpace.valid())
116 UG_THROW(
"DomainDiscretization: Before using the "
117 "DomainDiscretization an ApproximationSpace must be set to it. "
118 "Please use DomainDiscretization:set_approximation_space to "
119 "set an appropriate Space.");
122 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
123 m_vConstraint[i]->set_approximation_space(m_spApproxSpace);
126 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
130 update_constraints();
133 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
136 update_elem_errors();
137 update_constraints();
143 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
154 m_spAssTuner->resize(dd, M);
158 std::vector<SubsetGroup> vSSGrp;
163 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
166 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
169 const int si = unionSubsets[i];
178 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
181 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
192 this->
template AssembleMassMatrix<RegularVertex>
193 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
196 this->
template AssembleMassMatrix<RegularEdge>
197 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
199 this->
template AssembleMassMatrix<ConstrainingEdge>
200 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
203 this->
template AssembleMassMatrix<Triangle>
204 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
205 this->
template AssembleMassMatrix<Quadrilateral>
206 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
208 this->
template AssembleMassMatrix<ConstrainingTriangle>
209 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
210 this->
template AssembleMassMatrix<ConstrainingQuadrilateral>
211 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
214 this->
template AssembleMassMatrix<Tetrahedron>
215 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
216 this->
template AssembleMassMatrix<Pyramid>
217 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
218 this->
template AssembleMassMatrix<Prism>
219 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
220 this->
template AssembleMassMatrix<Hexahedron>
221 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
222 this->
template AssembleMassMatrix<Octahedron>
223 (vSubsetElemDisc, dd, si, bNonRegularGrid, M, u);
226 UG_THROW(
"DomainDiscretization::assemble_mass_matrix:"
227 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
231 " Assembling of elements of Dimension " <<
dim <<
" in "
232 " subset "<<si<<
" failed.");
237 for(
int type = 1; type <
CT_ALL; type = type << 1){
238 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
239 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
240 if(m_vConstraint[i]->type() & type)
242 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
243 m_vConstraint[i]->adjust_jacobian(M, u, dd, type);
248 " Cannot execute post process.");
253 M.set_layouts(dd->layouts());
268 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
269 template <
typename TElem>
273 int si,
bool bNonRegularGrid,
278 if(m_spAssTuner->selected_elements_used())
280 std::vector<TElem*> vElem;
281 m_spAssTuner->collect_selected_elements(vElem, dd, si);
285 gass_type::template AssembleMassMatrix<TElem>
286 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
287 bNonRegularGrid, M, u, m_spAssTuner);
292 gass_type::template AssembleMassMatrix<TElem>
293 (vElemDisc, m_spApproxSpace->domain(), dd,
294 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
295 bNonRegularGrid, M, u, m_spAssTuner);
303 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
314 m_spAssTuner->resize(dd, A);
318 std::vector<SubsetGroup> vSSGrp;
323 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
326 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
329 const int si = unionSubsets[i];
338 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
341 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
352 this->
template AssembleStiffnessMatrix<RegularVertex>
353 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
356 this->
template AssembleStiffnessMatrix<RegularEdge>
357 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
359 this->
template AssembleStiffnessMatrix<ConstrainingEdge>
360 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
363 this->
template AssembleStiffnessMatrix<Triangle>
364 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
365 this->
template AssembleStiffnessMatrix<Quadrilateral>
366 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
368 this->
template AssembleStiffnessMatrix<ConstrainingTriangle>
369 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
370 this->
template AssembleStiffnessMatrix<ConstrainingQuadrilateral>
371 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
374 this->
template AssembleStiffnessMatrix<Tetrahedron>
375 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
376 this->
template AssembleStiffnessMatrix<Pyramid>
377 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
378 this->
template AssembleStiffnessMatrix<Prism>
379 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
380 this->
template AssembleStiffnessMatrix<Hexahedron>
381 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
382 this->
template AssembleStiffnessMatrix<Octahedron>
383 (vSubsetElemDisc, dd, si, bNonRegularGrid, A, u);
386 UG_THROW(
"DomainDiscretization::assemble_stiffness_matrix:"
387 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
391 " Assembling of elements of Dimension " <<
dim <<
" in "
392 " subset "<<si<<
" failed.");
397 for(
int type = 1; type <
CT_ALL; type = type << 1){
398 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
399 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
400 if(m_vConstraint[i]->type() & type)
402 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
403 m_vConstraint[i]->adjust_jacobian(A, u, dd, type);
407 }
UG_CATCH_THROW(
"DomainDiscretization::assemble_stiffness_matrix:"
408 " Cannot execute post process.");
413 A.set_layouts(dd->layouts());
428 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
429 template <
typename TElem>
433 int si,
bool bNonRegularGrid,
438 if(m_spAssTuner->selected_elements_used())
440 std::vector<TElem*> vElem;
441 m_spAssTuner->collect_selected_elements(vElem, dd, si);
445 gass_type::template AssembleStiffnessMatrix<TElem>
446 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
447 bNonRegularGrid, A, u, m_spAssTuner);
452 gass_type::template AssembleStiffnessMatrix<TElem>
453 (vElemDisc, m_spApproxSpace->domain(), dd,
454 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
455 bNonRegularGrid, A, u, m_spAssTuner);
469 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
481 m_spAssTuner->resize(dd, J);
485 std::vector<SubsetGroup> vSSGrp;
490 if( m_spAssTuner->modify_solution_enabled() ){
491 pModifyMemory = u.clone();
492 pModifyU = pModifyMemory.
get();
494 for(
int type = 1; type <
CT_ALL; type = type << 1){
495 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
496 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
497 if(m_vConstraint[i]->type() & type)
498 m_vConstraint[i]->modify_solution(*pModifyMemory, u, dd, type);
508 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
511 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
514 const int si = unionSubsets[i];
523 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
526 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
537 this->
template AssembleJacobian<RegularVertex>
538 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
541 this->
template AssembleJacobian<RegularEdge>
542 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
544 this->
template AssembleJacobian<ConstrainingEdge>
545 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
548 this->
template AssembleJacobian<Triangle>
549 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
550 this->
template AssembleJacobian<Quadrilateral>
551 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
553 this->
template AssembleJacobian<ConstrainingTriangle>
554 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
555 this->
template AssembleJacobian<ConstrainingQuadrilateral>
556 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
559 this->
template AssembleJacobian<Tetrahedron>
560 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
561 this->
template AssembleJacobian<Pyramid>
562 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
563 this->
template AssembleJacobian<Prism>
564 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
565 this->
template AssembleJacobian<Hexahedron>
566 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
567 this->
template AssembleJacobian<Octahedron>
568 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, *pModifyU);
571 UG_THROW(
"DomainDiscretization::assemble_jacobian (stationary):"
572 "Dimension "<<
dim<<
"(subset="<<si<<
") not supported");
575 UG_CATCH_THROW(
"DomainDiscretization::assemble_jacobian (stationary):"
576 " Assembling of elements of Dimension " <<
dim <<
" in "
577 " subset "<<si<<
" failed.");
582 for(
int type = 1; type <
CT_ALL; type = type << 1){
583 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
584 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
585 if(m_vConstraint[i]->type() & type)
587 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
588 m_vConstraint[i]->adjust_jacobian(J, *pModifyU, dd, type);
593 " Cannot execute post process.");
598 J.set_layouts(dd->layouts());
612 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
613 template <
typename TElem>
617 int si,
bool bNonRegularGrid,
622 if(m_spAssTuner->selected_elements_used())
624 std::vector<TElem*> vElem;
625 m_spAssTuner->collect_selected_elements(vElem, dd, si);
629 gass_type::template AssembleJacobian<TElem>
630 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
631 bNonRegularGrid, J, u, m_spAssTuner);
636 gass_type::template AssembleJacobian<TElem>
637 (vElemDisc, m_spApproxSpace->domain(), dd,
638 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
639 bNonRegularGrid, J, u, m_spAssTuner);
646 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
658 m_spAssTuner->resize(dd, d);
662 std::vector<SubsetGroup> vSSGrp;
667 if( m_spAssTuner->modify_solution_enabled() ){
668 pModifyMemory = u.clone();
669 pModifyU = pModifyMemory.
get();
671 for(
int type = 1; type <
CT_ALL; type = type << 1){
672 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
673 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
674 if(m_vConstraint[i]->type() & type)
675 m_vConstraint[i]->modify_solution(*pModifyMemory, u, dd, type);
683 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
686 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
689 const int si = unionSubsets[i];
698 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
701 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
712 this->
template AssembleDefect<RegularVertex>
713 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
716 this->
template AssembleDefect<RegularEdge>
717 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
719 this->
template AssembleDefect<ConstrainingEdge>
720 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
723 this->
template AssembleDefect<Triangle>
724 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
725 this->
template AssembleDefect<Quadrilateral>
726 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
728 this->
template AssembleDefect<ConstrainingTriangle>
729 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
730 this->
template AssembleDefect<ConstrainingQuadrilateral>
731 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
734 this->
template AssembleDefect<Tetrahedron>
735 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
736 this->
template AssembleDefect<Pyramid>
737 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
738 this->
template AssembleDefect<Prism>
739 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
740 this->
template AssembleDefect<Hexahedron>
741 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
742 this->
template AssembleDefect<Octahedron>
743 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, *pModifyU);
746 UG_THROW(
"DomainDiscretization::assemble_defect (stationary):"
747 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
750 UG_CATCH_THROW(
"DomainDiscretization::assemble_defect (stationary):"
751 " Assembling of elements of Dimension " <<
dim <<
" in "
752 " subset "<<si<<
" failed.");
759 if (m_spAssTuner->constraint_type_enabled(
CT_DIRICHLET))
761 for (
size_t i = 0; i < m_vConstraint.size(); ++i)
765 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
766 m_vConstraint[i]->adjust_defect(d, *pModifyU, dd,
CT_DIRICHLET);
771 for(
int type = 1; type <
CT_ALL; type = type << 1){
772 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
773 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
774 if(m_vConstraint[i]->type() & type)
776 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
777 m_vConstraint[i]->adjust_defect(d, *pModifyU, dd, type);
801 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
802 template <
typename TElem>
806 int si,
bool bNonRegularGrid,
811 if(m_spAssTuner->selected_elements_used())
813 std::vector<TElem*> vElem;
814 m_spAssTuner->collect_selected_elements(vElem, dd, si);
818 gass_type::template AssembleDefect<TElem>
819 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
820 bNonRegularGrid, d, u, m_spAssTuner);
825 gass_type::template AssembleDefect<TElem>
826 (vElemDisc, m_spApproxSpace->domain(), dd,
827 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
828 bNonRegularGrid, d, u, m_spAssTuner);
835 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
846 m_spAssTuner->resize(dd, mat);
847 m_spAssTuner->resize(dd, rhs);
851 std::vector<SubsetGroup> vSSGrp;
856 }
UG_CATCH_THROW(
"DomainDiscretization: Can not create Subset Groups and Union.");
859 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
862 const int si = unionSubsets[i];
871 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
874 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
885 this->
template AssembleLinear<RegularVertex>
886 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
889 this->
template AssembleLinear<RegularEdge>
890 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
892 this->
template AssembleLinear<ConstrainingEdge>
893 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
896 this->
template AssembleLinear<Triangle>
897 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
898 this->
template AssembleLinear<Quadrilateral>
899 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
901 this->
template AssembleLinear<ConstrainingTriangle>
902 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
903 this->
template AssembleLinear<ConstrainingQuadrilateral>
904 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
907 this->
template AssembleLinear<Tetrahedron>
908 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
909 this->
template AssembleLinear<Pyramid>
910 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
911 this->
template AssembleLinear<Prism>
912 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
913 this->
template AssembleLinear<Hexahedron>
914 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
915 this->
template AssembleLinear<Octahedron>
916 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs);
919 UG_THROW(
"DomainDiscretization::assemble_linear (stationary):"
920 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
923 UG_CATCH_THROW(
"DomainDiscretization::assemble_linear (stationary):"
924 " Assembling of elements of Dimension " <<
dim <<
" in "
925 " subset "<<si<<
" failed.");
930 for(
int type = 1; type <
CT_ALL; type = type << 1){
931 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
932 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
933 if(m_vConstraint[i]->type() & type)
935 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
936 m_vConstraint[i]->adjust_linear(mat, rhs, dd, type);
940 }
UG_CATCH_THROW(
"DomainDiscretization::assemble_linear: Cannot post process.");
945 mat.set_layouts(dd->layouts());
962 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
963 template <
typename TElem>
967 int si,
bool bNonRegularGrid,
972 if(m_spAssTuner->selected_elements_used())
974 std::vector<TElem*> vElem;
975 m_spAssTuner->collect_selected_elements(vElem, dd, si);
979 gass_type::template AssembleLinear<TElem>
980 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
981 bNonRegularGrid, A, rhs, m_spAssTuner);
986 gass_type::template AssembleLinear<TElem>
987 (vElemDisc, m_spApproxSpace->domain(), dd,
988 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
989 bNonRegularGrid, A, rhs, m_spAssTuner);
996 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1004 update_disc_items();
1008 m_spAssTuner->resize(dd, rhs);
1012 std::vector<SubsetGroup> vSSGrp;
1017 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1020 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1023 const int si = unionSubsets[i];
1032 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1035 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1046 this->
template AssembleRhs<RegularVertex>
1047 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1050 this->
template AssembleRhs<RegularEdge>
1051 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1053 this->
template AssembleRhs<ConstrainingEdge>
1054 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1057 this->
template AssembleRhs<Triangle>
1058 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1059 this->
template AssembleRhs<Quadrilateral>
1060 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1062 this->
template AssembleRhs<ConstrainingTriangle>
1063 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1064 this->
template AssembleRhs<ConstrainingQuadrilateral>
1065 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1068 this->
template AssembleRhs<Tetrahedron>
1069 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1070 this->
template AssembleRhs<Pyramid>
1071 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1072 this->
template AssembleRhs<Prism>
1073 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1074 this->
template AssembleRhs<Hexahedron>
1075 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1076 this->
template AssembleRhs<Octahedron>
1077 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, u);
1080 UG_THROW(
"DomainDiscretization::assemble_rhs (stationary):"
1081 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1084 UG_CATCH_THROW(
"DomainDiscretization::assemble_rhs (stationary):"
1085 " Assembling of elements of Dimension " <<
dim <<
" in "
1086 " subset "<<si<<
" failed.");
1091 for(
int type = 1; type <
CT_ALL; type = type << 1){
1092 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1093 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1094 if(m_vConstraint[i]->type() & type)
1096 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
1097 m_vConstraint[i]->adjust_rhs(rhs, u, dd, type);
1102 " Cannot execute post process.");
1121 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1122 template <
typename TElem>
1126 int si,
bool bNonRegularGrid,
1131 if(m_spAssTuner->selected_elements_used())
1133 std::vector<TElem*> vElem;
1134 m_spAssTuner->collect_selected_elements(vElem, dd, si);
1138 gass_type::template AssembleRhs<TElem>
1139 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
1140 bNonRegularGrid, rhs, u, m_spAssTuner);
1145 gass_type::template AssembleRhs<TElem>
1146 (vElemDisc, m_spApproxSpace->domain(), dd, dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
1147 bNonRegularGrid, rhs, u, m_spAssTuner);
1154 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1159 update_constraints();
1163 std::vector<int> vType(6);
1172 if (m_spAssTuner->single_index_assembling_enabled()) u.resize(1);
1175 for(
size_t i = 0; i < vType.size(); ++i){
1176 int type = vType[i];
1177 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1178 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1179 if(m_vConstraint[i]->type() & type)
1181 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
1182 m_vConstraint[i]->adjust_solution(u, dd, type);
1201 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1212 update_disc_items();
1217 size_t num_subsets = sh->num_subsets();
1218 bool bNonRegularGrid =
false;
1219 for (
size_t si = 0; si < num_subsets; ++si)
1223 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1228 gass_type::PrepareTimestep(m_vElemDisc, dd, bNonRegularGrid, vSol, future_time, m_spAssTuner);
1230 UG_CATCH_THROW(
"DomainDiscretization::prepare_timestep (instationary):" <<
1231 " Preparing time step failed.");
1239 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1246 update_disc_items();
1251 std::vector<SubsetGroup> vSSGrp;
1256 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1259 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1262 const int si = unionSubsets[i];
1271 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1274 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1285 this->
template PrepareTimestepElem<RegularVertex>
1286 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1289 this->
template PrepareTimestepElem<RegularEdge>
1290 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1292 this->
template PrepareTimestepElem<ConstrainingEdge>
1293 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1296 this->
template PrepareTimestepElem<Triangle>
1297 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1298 this->
template PrepareTimestepElem<Quadrilateral>
1299 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1301 this->
template PrepareTimestepElem<ConstrainingTriangle>
1302 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1303 this->
template PrepareTimestepElem<ConstrainingQuadrilateral>
1304 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1307 this->
template PrepareTimestepElem<Tetrahedron>
1308 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1309 this->
template PrepareTimestepElem<Pyramid>
1310 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1311 this->
template PrepareTimestepElem<Prism>
1312 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1313 this->
template PrepareTimestepElem<Hexahedron>
1314 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1315 this->
template PrepareTimestepElem<Octahedron>
1316 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
1319 UG_THROW(
"DomainDiscretization::prepare_timestep_elem (instationary):"
1320 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1323 UG_CATCH_THROW(
"DomainDiscretization::prepare_timestep_elem (instationary):"
1324 " Assembling of elements of Dimension " <<
dim <<
" in "
1325 " subset "<<si<<
" failed.");
1341 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1342 template <
typename TElem>
1346 int si,
bool bNonRegularGrid,
1350 if(m_spAssTuner->selected_elements_used())
1352 std::vector<TElem*> vElem;
1353 m_spAssTuner->collect_selected_elements(vElem, dd, si);
1357 gass_type::template PrepareTimestepElem<TElem>
1358 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
1359 bNonRegularGrid, vSol, m_spAssTuner);
1364 gass_type::template PrepareTimestepElem<TElem>
1365 (vElemDisc, m_spApproxSpace->domain(), dd,
1366 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
1367 bNonRegularGrid, vSol, m_spAssTuner);
1374 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1382 if (m_spAssTuner->matrix_is_const())
return;
1386 update_disc_items();
1390 m_spAssTuner->resize(dd, J);
1393 const number time = vSol->time(0);
1397 std::vector<SubsetGroup> vSSGrp;
1402 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1407 if( m_spAssTuner->modify_solution_enabled() ){
1408 pModifyMemory = vSol->clone();
1409 pModifyU = pModifyMemory;
1411 for(
int type = 1; type <
CT_ALL; type = type << 1){
1412 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1413 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1414 if(m_vConstraint[i]->type() & type)
1415 m_vConstraint[i]->modify_solution(pModifyMemory, vSol, dd, type);
1417 }
UG_CATCH_THROW(
"'DomainDiscretization': Cannot modify solution.");
1421 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1424 const int si = unionSubsets[i];
1433 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1436 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1447 this->
template AssembleJacobian<RegularVertex>
1448 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1451 this->
template AssembleJacobian<RegularEdge>
1452 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1454 this->
template AssembleJacobian<ConstrainingEdge>
1455 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1458 this->
template AssembleJacobian<Triangle>
1459 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1460 this->
template AssembleJacobian<Quadrilateral>
1461 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1463 this->
template AssembleJacobian<ConstrainingTriangle>
1464 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1465 this->
template AssembleJacobian<ConstrainingQuadrilateral>
1466 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1469 this->
template AssembleJacobian<Tetrahedron>
1470 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1471 this->
template AssembleJacobian<Pyramid>
1472 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1473 this->
template AssembleJacobian<Prism>
1474 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1475 this->
template AssembleJacobian<Hexahedron>
1476 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1477 this->
template AssembleJacobian<Octahedron>
1478 (vSubsetElemDisc, dd, si, bNonRegularGrid, J, pModifyU, s_a0);
1481 UG_THROW(
"DomainDiscretization::assemble_jacobian (instationary):"
1482 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1485 UG_CATCH_THROW(
"DomainDiscretization::assemble_jacobian (instationary):"
1486 " Assembling of elements of Dimension " <<
dim <<
" in "
1487 " subset "<<si<<
" failed.");
1492 for(
int type = 1; type <
CT_ALL; type = type << 1){
1493 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1494 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1495 if(m_vConstraint[i]->type() & type)
1497 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
1498 m_vConstraint[i]->adjust_jacobian(J, *pModifyU->solution(0), dd, type, time, pModifyU,s_a0);
1507 J.set_layouts(dd->layouts());
1524 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1525 template <
typename TElem>
1529 int si,
bool bNonRegularGrid,
1535 if(m_spAssTuner->selected_elements_used())
1537 std::vector<TElem*> vElem;
1538 m_spAssTuner->collect_selected_elements(vElem, dd, si);
1542 gass_type::template AssembleJacobian<TElem>
1543 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
1544 bNonRegularGrid, J, vSol, s_a0, m_spAssTuner);
1548 gass_type::template AssembleJacobian<TElem>
1549 (vElemDisc, m_spApproxSpace->domain(), dd,
1550 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
1551 bNonRegularGrid, J, vSol, s_a0, m_spAssTuner);
1558 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1562 const std::vector<number>& vScaleMass,
1563 const std::vector<number>& vScaleStiff,
1568 update_disc_items();
1572 m_spAssTuner->resize(dd, d);
1576 std::vector<SubsetGroup> vSSGrp;
1581 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1586 if( m_spAssTuner->modify_solution_enabled() ){
1587 pModifyMemory = vSol->clone();
1588 pModifyU = pModifyMemory;
1590 for(
int type = 1; type <
CT_ALL; type = type << 1){
1591 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1592 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1593 if(m_vConstraint[i]->type() & type)
1594 m_vConstraint[i]->modify_solution(pModifyMemory, vSol, dd, type);
1596 }
UG_CATCH_THROW(
"'DomainDiscretization: Cannot modify solution.");
1600 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1603 const int si = unionSubsets[i];
1612 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1615 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1626 this->
template AssembleDefect<RegularVertex>
1627 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1630 this->
template AssembleDefect<RegularEdge>
1631 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1633 this->
template AssembleDefect<ConstrainingEdge>
1634 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1637 this->
template AssembleDefect<Triangle>
1638 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1639 this->
template AssembleDefect<Quadrilateral>
1640 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1642 this->
template AssembleDefect<ConstrainingTriangle>
1643 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1644 this->
template AssembleDefect<ConstrainingQuadrilateral>
1645 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1648 this->
template AssembleDefect<Tetrahedron>
1649 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1650 this->
template AssembleDefect<Pyramid>
1651 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1652 this->
template AssembleDefect<Prism>
1653 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1654 this->
template AssembleDefect<Hexahedron>
1655 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1656 this->
template AssembleDefect<Octahedron>
1657 (vSubsetElemDisc, dd, si, bNonRegularGrid, d, pModifyU, vScaleMass, vScaleStiff);
1660 UG_THROW(
"DomainDiscretization::assemble_defect (instationary):"
1661 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1664 UG_CATCH_THROW(
"DomainDiscretization::assemble_defect (instationary):"
1665 " Assembling of elements of Dimension " <<
dim <<
" in"
1666 " subset "<< si <<
" failed.");
1671 for(
int type = 1; type <
CT_ALL; type = type << 1){
1672 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1673 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1674 if(m_vConstraint[i]->type() & type)
1676 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
1677 m_vConstraint[i]->adjust_defect(d, *pModifyU->solution(0), dd, type, pModifyU->time(0), pModifyU, &vScaleMass, &vScaleStiff);
1702 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1703 template <
typename TElem>
1707 int si,
bool bNonRegularGrid,
1710 const std::vector<number>& vScaleMass,
1711 const std::vector<number>& vScaleStiff)
1714 if(m_spAssTuner->selected_elements_used())
1716 std::vector<TElem*> vElem;
1717 m_spAssTuner->collect_selected_elements(vElem, dd, si);
1721 gass_type::template AssembleDefect<TElem>
1722 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
1723 bNonRegularGrid, d, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
1728 gass_type::template AssembleDefect<TElem>
1729 (vElemDisc, m_spApproxSpace->domain(), dd,
1730 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
1731 bNonRegularGrid, d, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
1738 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1742 const std::vector<number>& vScaleMass,
1743 const std::vector<number>& vScaleStiff,
1748 update_disc_items();
1751 if (!m_spAssTuner->matrix_is_const())
1752 m_spAssTuner->resize(dd, mat);
1753 m_spAssTuner->resize(dd, rhs);
1757 std::vector<SubsetGroup> vSSGrp;
1762 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1765 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1768 const int si = unionSubsets[i];
1777 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1780 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1791 this->
template AssembleLinear<RegularVertex>
1792 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1795 this->
template AssembleLinear<RegularEdge>
1796 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1798 this->
template AssembleLinear<ConstrainingEdge>
1799 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1802 this->
template AssembleLinear<Triangle>
1803 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1804 this->
template AssembleLinear<Quadrilateral>
1805 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1807 this->
template AssembleLinear<ConstrainingTriangle>
1808 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1809 this->
template AssembleLinear<ConstrainingQuadrilateral>
1810 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1813 this->
template AssembleLinear<Tetrahedron>
1814 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1815 this->
template AssembleLinear<Pyramid>
1816 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1817 this->
template AssembleLinear<Prism>
1818 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1819 this->
template AssembleLinear<Hexahedron>
1820 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1821 this->
template AssembleLinear<Octahedron>
1822 (vSubsetElemDisc, dd, si, bNonRegularGrid, mat, rhs, vSol, vScaleMass, vScaleStiff);
1825 UG_THROW(
"DomainDiscretization::assemble_linear (instationary):"
1826 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1829 UG_CATCH_THROW(
"DomainDiscretization::assemble_linear (instationary):"
1830 " Assembling of elements of Dimension " <<
dim <<
" in "
1831 " subset "<<si<<
" failed.");
1836 for(
int type = 1; type <
CT_ALL; type = type << 1){
1837 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
1838 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
1839 if(m_vConstraint[i]->type() & type)
1841 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
1842 m_vConstraint[i]->adjust_linear(mat, rhs, dd, type, vSol->time(0));
1850 mat.set_layouts(dd->layouts());
1871 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1872 template <
typename TElem>
1876 int si,
bool bNonRegularGrid,
1880 const std::vector<number>& vScaleMass,
1881 const std::vector<number>& vScaleStiff)
1884 if(m_spAssTuner->selected_elements_used())
1886 std::vector<TElem*> vElem;
1887 m_spAssTuner->collect_selected_elements(vElem, dd, si);
1891 gass_type::template AssembleLinear<TElem>
1892 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
1893 bNonRegularGrid, A, rhs, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
1898 gass_type::template AssembleLinear<TElem>
1899 (vElemDisc, m_spApproxSpace->domain(), dd,
1900 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
1901 bNonRegularGrid, A, rhs, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
1908 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
1912 const std::vector<number>& vScaleMass,
1913 const std::vector<number>& vScaleStiff,
1918 update_disc_items();
1921 m_spAssTuner->resize(dd, rhs);
1925 std::vector<SubsetGroup> vSSGrp;
1930 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
1933 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
1936 const int si = unionSubsets[i];
1945 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
1948 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
1959 this->
template AssembleRhs<RegularVertex>
1960 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1963 this->
template AssembleRhs<RegularEdge>
1964 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1966 this->
template AssembleRhs<ConstrainingEdge>
1967 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1970 this->
template AssembleRhs<Triangle>
1971 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1972 this->
template AssembleRhs<Quadrilateral>
1973 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1975 this->
template AssembleRhs<ConstrainingTriangle>
1976 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1977 this->
template AssembleRhs<ConstrainingQuadrilateral>
1978 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1981 this->
template AssembleRhs<Tetrahedron>
1982 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1983 this->
template AssembleRhs<Pyramid>
1984 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1985 this->
template AssembleRhs<Prism>
1986 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1987 this->
template AssembleRhs<Hexahedron>
1988 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1989 this->
template AssembleRhs<Octahedron>
1990 (vSubsetElemDisc, dd, si, bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff);
1993 UG_THROW(
"DomainDiscretization::assemble_rhs (instationary):"
1994 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
1997 UG_CATCH_THROW(
"DomainDiscretization::assemble_rhs (instationary):"
1998 " Assembling of elements of Dimension " <<
dim <<
" in "
1999 " subset "<<si<<
" failed.");
2005 for(
int type = 1; type <
CT_ALL; type = type << 1){
2006 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
2007 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
2008 if(m_vConstraint[i]->type() & type)
2010 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
2011 m_vConstraint[i]->adjust_rhs(rhs, *(vSol->solution(0)), dd, type, vSol->time(0));
2035 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2036 template <
typename TElem>
2040 int si,
bool bNonRegularGrid,
2043 const std::vector<number>& vScaleMass,
2044 const std::vector<number>& vScaleStiff)
2047 if(m_spAssTuner->selected_elements_used())
2049 std::vector<TElem*> vElem;
2050 m_spAssTuner->collect_selected_elements(vElem, dd, si);
2054 gass_type::template AssembleRhs<TElem>
2055 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
2056 bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
2061 gass_type::template AssembleRhs<TElem>
2062 (vElemDisc, m_spApproxSpace->domain(), dd,
2063 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
2064 bNonRegularGrid, rhs, vSol, vScaleMass, vScaleStiff, m_spAssTuner);
2071 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2076 update_constraints();
2080 std::vector<int> vType(5);
2088 if (m_spAssTuner->single_index_assembling_enabled()) u.resize(1);
2093 for(
size_t i = 0; i < vType.size(); ++i){
2094 int type = vType[i];
2095 if(!(m_spAssTuner->constraint_type_enabled(type)))
continue;
2096 for(
size_t i = 0; i < m_vConstraint.size(); ++i)
2097 if(m_vConstraint[i]->type() & type)
2099 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
2100 m_vConstraint[i]->adjust_solution(u, dd, type, time);
2112 template <
typename TDomain,
typename T>
2115 for (std::size_t i = 0; i < vElemDisc.size(); ++i)
2119 if (err_est_data == NULL)
continue;
2120 if (
std::find (vErrEstData.begin(), vErrEstData.end(), err_est_data) != vErrEstData.end())
2122 if (err_est_data->
consider_me()) vErrEstData.push_back(err_est_data);
2131 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2146 const bool useErrorData = !m_vDomainElemError.empty();
2150 if (useErrorData) { update_error_items();}
2151 else { update_disc_items();}
2155 std::vector<SubsetGroup> vSSGrp;
2160 if (useErrorData) {
CreateSubsetGroups(vSSGrp, unionSubsets, m_vElemError, dd->subset_handler());}
2163 UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
2166 std::vector<IErrEstData<TDomain>*> vErrEstData;
2182 for (
size_t i = 0; i < vErrEstData.size(); ++i)
2183 vErrEstData[i]->alloc_err_est_data(dd->surface_view(), dd->grid_level());
2185 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot prepare the error estimator");
2190 for (
size_t i = 0; i < unionSubsets.
size(); ++i)
2193 const int si = unionSubsets[i];
2206 GetElemDiscItemOnSubset<IElemError<TDomain>,
IElemDisc<TDomain> > (vSubsetElemError, m_vElemDisc, vSSGrp, si);
2210 (vSubsetElemError, m_vElemError, vSSGrp, si);
2215 (vSubsetElemError, m_vElemDisc, vSSGrp, si);
2225 typename error_vector_type::iterator it = vSubsetElemError.begin();
2226 while (it != vSubsetElemError.end())
2228 if (!(*it)->err_est_enabled())
2229 it = vSubsetElemError.erase(it);
2240 this->
template AssembleErrorEstimator<RegularEdge>
2241 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2243 this->
template AssembleErrorEstimator<ConstrainingEdge>
2244 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2247 this->
template AssembleErrorEstimator<Triangle>
2248 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2249 this->
template AssembleErrorEstimator<Quadrilateral>
2250 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2252 this->
template AssembleErrorEstimator<ConstrainingTriangle>
2253 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2254 this->
template AssembleErrorEstimator<ConstrainingQuadrilateral>
2255 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2258 this->
template AssembleErrorEstimator<Tetrahedron>
2259 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2260 this->
template AssembleErrorEstimator<Pyramid>
2261 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2262 this->
template AssembleErrorEstimator<Prism>
2263 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2264 this->
template AssembleErrorEstimator<Hexahedron>
2265 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2266 this->
template AssembleErrorEstimator<Octahedron>
2267 (vSubsetElemError, dd, si, bNonRegularGrid, u);
2270 UG_THROW(
"DomainDiscretization::calc_error:"
2271 " Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
2275 " Assembling of elements of Dimension " <<
dim <<
" in "
2276 " subset "<<si<<
" failed.");
2282 for (
int type = 1; type <
CT_ALL; type = type << 1)
2284 if (!(m_spAssTuner->constraint_type_enabled(type)))
continue;
2285 for (
size_t i = 0; i < m_vConstraint.size(); ++i)
2286 if ((m_vConstraint[i]->type() & type) && m_vConstraint[i]->err_est_enabled())
2288 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
2289 m_vConstraint[i]->adjust_error(u, dd, type);
2298 for (std::size_t i = 0; i < vErrEstData.size(); ++i)
2299 vErrEstData[i]->summarize_err_est_data(m_spApproxSpace->domain());
2301 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot summarize the error estimator");
2307 m_mgElemErrors.attach_indicators(pMG);
2312 elem_iter_type elem_iter_end = sv->template end<elem_type> (gl,
SurfaceView::ALL);
2313 for (elem_iter_type elem = sv->template begin<elem_type> (gl,
SurfaceView::ALL); elem != elem_iter_end; ++elem)
2316 m_mgElemErrors.error(*elem) = 0.0;
2319 std::vector<MathVector<dim> > vCornerCoords = std::vector<MathVector<dim> >(0);
2323 for (std::size_t ee = 0; ee < vErrEstData.size(); ++ee)
2324 m_mgElemErrors.error(*elem) += vErrEstData[ee]->scaling_factor()
2325 * vErrEstData[ee]->get_elem_error_indicator(*elem, &vCornerCoords[0]);
2338 UG_THROW(
"Argument passed as output for error function is not a GridFunction of suitable type.");
2346 elem_iter_type elem_iter_end = sv->template end<elem_type> (gl,
SurfaceView::ALL);
2347 for (elem_iter_type elem = sv->template begin<elem_type> (gl,
SurfaceView::ALL); elem != elem_iter_end; ++elem)
2350 uVTK->
approx_space()->dof_distribution(gl)->indices(*elem, ind,
false);
2353 "Number of functions in grid function passed for error indicator values is not 1 on "
2357 "Number of DoFs in grid function passed for error indicator values is not 1 on "
2367 locU(0,0) = m_mgElemErrors.error(*elem);
2374 this->m_bErrorCalculated =
true;
2378 for(std::size_t i = 0; i < vErrEstData.size(); ++i)
2379 vErrEstData[i]->release_err_est_data();
2381 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot release the error estimator");
2394 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2395 template <
typename TElem>
2399 int si,
bool bNonRegularGrid,
2403 gass_type::template AssembleErrorEstimator<TElem>
2404 (vElemDisc, m_spApproxSpace->domain(), dd,
2405 dd->template begin<TElem>(si), dd->template end<TElem>(si),
2406 si, bNonRegularGrid, u);
2415 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2419 const std::vector<number>& vScaleMass,
2420 const std::vector<number>& vScaleStiff,
2429 const bool useErrorData = !m_vDomainElemError.empty();
2432 if (useErrorData) { update_error_items();}
2433 else { update_disc_items();}
2437 std::vector<SubsetGroup> vSSGrp;
2442 if (useErrorData) {
CreateSubsetGroups(vSSGrp, unionSubsets, m_vElemError, dd->subset_handler());}
2445 UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
2448 std::vector<IErrEstData<TDomain>*> vErrEstData;
2456 for (std::size_t i = 0; i < vErrEstData.size(); ++i)
2457 vErrEstData[i]->alloc_err_est_data(dd->surface_view(), dd->grid_level());
2459 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot prepare the error estimator");
2462 for (std::size_t i = 0; i < unionSubsets.
size(); ++i)
2465 const int si = unionSubsets[i];
2479 (vSubsetElemError, m_vElemError, vSSGrp, si);
2484 (vSubsetElemError, m_vElemDisc, vSSGrp, si);
2488 typename error_vector_type::iterator it = vSubsetElemError.begin();
2489 while (it != vSubsetElemError.end())
2491 if (!(*it)->err_est_enabled())
2492 it = vSubsetElemError.erase(it);
2502 this->
template AssembleErrorEstimator<RegularEdge>
2503 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2505 this->
template AssembleErrorEstimator<ConstrainingEdge>
2506 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2509 this->
template AssembleErrorEstimator<Triangle>
2510 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2511 this->
template AssembleErrorEstimator<Quadrilateral>
2512 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2514 this->
template AssembleErrorEstimator<ConstrainingTriangle>
2515 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2516 this->
template AssembleErrorEstimator<ConstrainingQuadrilateral>
2517 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2520 this->
template AssembleErrorEstimator<Tetrahedron>
2521 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2522 this->
template AssembleErrorEstimator<Pyramid>
2523 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2524 this->
template AssembleErrorEstimator<Prism>
2525 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2526 this->
template AssembleErrorEstimator<Hexahedron>
2527 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2528 this->
template AssembleErrorEstimator<Octahedron>
2529 (vSubsetElemError, dd, si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2532 UG_THROW(
"DomainDiscretization::calc_error:"
2533 " Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
2537 " Assembling of elements of Dimension " <<
dim <<
" in "
2538 " subset "<< si <<
"failed.");
2544 for (
int type = 1; type <
CT_ALL; type = type << 1)
2546 if (!(m_spAssTuner->constraint_type_enabled(type)))
continue;
2547 for (
size_t i = 0; i < m_vConstraint.size(); ++i)
2548 if ((m_vConstraint[i]->type() & type) && m_vConstraint[i]->err_est_enabled())
2550 m_vConstraint[i]->set_ass_tuner(m_spAssTuner);
2551 m_vConstraint[i]->adjust_error(*vSol->solution(0), dd, type, vSol->time(0),
2552 vSol, &vScaleMass, &vScaleStiff);
2561 for (std::size_t i = 0; i < vErrEstData.size(); ++i)
2562 vErrEstData[i]->summarize_err_est_data(m_spApproxSpace->domain());
2564 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot summarize the error estimator.");
2570 m_mgElemErrors.attach_indicators(pMG);
2575 elem_iter_type elem_iter_end = sv->template end<elem_type> (gl,
SurfaceView::ALL);
2576 for (elem_iter_type elem = sv->template begin<elem_type> (gl,
SurfaceView::ALL); elem != elem_iter_end; ++elem)
2579 m_mgElemErrors.error(*elem) = 0.0;
2582 std::vector<MathVector<dim> > vCornerCoords = std::vector<MathVector<dim> >(0);
2586 for (std::size_t ee = 0; ee < vErrEstData.size(); ++ee)
2587 m_mgElemErrors.error(*elem) += vErrEstData[ee]->scaling_factor()
2588 * vErrEstData[ee]->get_elem_error_indicator(*elem, &vCornerCoords[0]);
2601 UG_THROW(
"Argument passed as output for error function is not a GridFunction.");
2609 elem_iter_type elem_iter_end = sv->template end<elem_type> (gl,
SurfaceView::ALL);
2610 for (elem_iter_type elem = sv->template begin<elem_type> (gl,
SurfaceView::ALL); elem != elem_iter_end; ++elem)
2613 uVTK->
approx_space()->dof_distribution(gl)->indices(*elem, ind,
false);
2622 locU(0,0) = m_mgElemErrors.error(*elem);
2629 this->m_bErrorCalculated =
true;
2633 for(std::size_t i = 0; i < vErrEstData.size(); ++i)
2634 vErrEstData[i]->release_err_est_data();
2636 UG_CATCH_THROW(
"DomainDiscretization::calc_error: Cannot release the error estimator");
2651 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2652 template <
typename TElem>
2656 int si,
bool bNonRegularGrid,
2657 const std::vector<number>& vScaleMass,
2658 const std::vector<number>& vScaleStiff,
2662 gass_type::template AssembleErrorEstimator<TElem>
2663 (vElemDisc, m_spApproxSpace->domain(), dd,
2664 dd->template begin<TElem>(si), dd->template end<TElem>(si),
2665 si, bNonRegularGrid, vScaleMass, vScaleStiff, vSol);
2668 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2676 if (!this->m_bErrorCalculated)
2678 UG_THROW(
"Error indicators have to be calculated first by a call to 'calc_error'.");
2682 if (spMarkingStrategy.valid())
2688 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2695 if (m_bErrorCalculated)
2697 m_bErrorCalculated =
false;
2698 m_mgElemErrors.detach_indicators();
2703 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2708 return this->m_bErrorCalculated;
2714 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2724 update_disc_items();
2729 size_t num_subsets = sh->num_subsets();
2730 bool bNonRegularGrid =
false;
2731 for (
size_t si = 0; si < num_subsets; ++si)
2735 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
2740 gass_type::FinishTimestep(m_vElemDisc, dd, bNonRegularGrid, vSol, m_spAssTuner);
2742 UG_CATCH_THROW(
"DomainDiscretization::finish_timestep (instationary):" <<
2743 " Finishing time step failed.");
2751 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2758 update_disc_items();
2762 std::vector<SubsetGroup> vSSGrp;
2767 }
UG_CATCH_THROW(
"'DomainDiscretization': Can not create Subset Groups and Union.");
2770 for(
size_t i = 0; i < unionSubsets.
size(); ++i)
2773 const int si = unionSubsets[i];
2782 if(m_spAssTuner->regular_grid_forced()) bNonRegularGrid =
false;
2785 std::vector<IElemDisc<TDomain>*> vSubsetElemDisc;
2796 this->
template FinishTimestepElem<RegularVertex>
2797 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2800 this->
template FinishTimestepElem<RegularEdge>
2801 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2803 this->
template FinishTimestepElem<ConstrainingEdge>
2804 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2807 this->
template FinishTimestepElem<Triangle>
2808 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2809 this->
template FinishTimestepElem<Quadrilateral>
2810 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2812 this->
template FinishTimestepElem<ConstrainingTriangle>
2813 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2814 this->
template FinishTimestepElem<ConstrainingQuadrilateral>
2815 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2818 this->
template FinishTimestepElem<Tetrahedron>
2819 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2820 this->
template FinishTimestepElem<Pyramid>
2821 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2822 this->
template FinishTimestepElem<Prism>
2823 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2824 this->
template FinishTimestepElem<Hexahedron>
2825 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2826 this->
template FinishTimestepElem<Octahedron>
2827 (vSubsetElemDisc, dd, si, bNonRegularGrid, vSol);
2830 UG_THROW(
"DomainDiscretization::finish_timestep_elem (instationary):"
2831 "Dimension "<<
dim<<
" (subset="<<si<<
") not supported.");
2834 UG_CATCH_THROW(
"DomainDiscretization::finish_timestep_elem (instationary):"
2835 " Assembling of elements of Dimension " <<
dim <<
" in "
2836 " subset "<<si<<
" failed.");
2852 template <
typename TDomain,
typename TAlgebra,
typename TGlobAssembler>
2853 template <
typename TElem>
2857 int si,
bool bNonRegularGrid,
2861 if(m_spAssTuner->selected_elements_used())
2863 std::vector<TElem*> vElem;
2864 m_spAssTuner->collect_selected_elements(vElem, dd, si);
2868 gass_type::template FinishTimestepElem<TElem>
2869 (vElemDisc, m_spApproxSpace->domain(), dd, vElem.begin(), vElem.end(), si,
2870 bNonRegularGrid, vSol, m_spAssTuner);
2875 gass_type::template FinishTimestepElem<TElem>
2876 (vElemDisc, m_spApproxSpace->domain(), dd,
2877 dd->template begin<TElem>(si), dd->template end<TElem>(si), si,
2878 bNonRegularGrid, vSol, m_spAssTuner);
Definition: smart_pointer.h:296
const T * get() const
Definition: smart_pointer.h:409
T * get()
returns encapsulated pointer
Definition: smart_pointer.h:197
Definition: dof_distribution.h:51
void update_constraints()
Definition: domain_disc_impl.h:112
virtual void calc_error(const vector_type &u, ConstSmartPtr< DoFDistribution > dd, error_vector_type *u_vtk=NULL)
Definition: domain_disc_impl.h:2134
void update_elem_discs()
set the approximation space in the elem discs and extract IElemDiscs
Definition: domain_disc_impl.h:68
virtual bool is_error_valid()
returns whether current error values are valid
Definition: domain_disc_impl.h:2705
virtual void invalidate_error()
Definition: domain_disc_impl.h:2690
void AssembleJacobian(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &J, const vector_type &u)
Definition: domain_disc_impl.h:615
void AssembleErrorEstimator(const std::vector< IElemError< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, const vector_type &u)
Definition: domain_disc_impl.h:2397
virtual void finish_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
finishes time step
Definition: domain_disc_impl.h:2717
virtual void prepare_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
prepares time step element-wise
Definition: domain_disc_impl.h:1241
virtual void prepare_timestep(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, ConstSmartPtr< DoFDistribution > dd)
prepares time step
Definition: domain_disc_impl.h:1204
void update_disc_items()
Definition: domain_disc_impl.h:127
void AssembleMassMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &M, const vector_type &u)
Definition: domain_disc_impl.h:271
virtual void assemble_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles Defect
Definition: domain_disc_impl.h:648
virtual void mark_with_strategy(IRefiner &refiner, SmartPtr< IElementMarkingStrategy< TDomain > > strategy)
Definition: domain_disc_impl.h:2671
void AssembleRhs(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, vector_type &rhs, const vector_type &u)
Definition: domain_disc_impl.h:1124
virtual void assemble_mass_matrix(matrix_type &M, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles the mass matrix
Definition: domain_disc_impl.h:145
void AssembleDefect(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, vector_type &d, const vector_type &u)
Definition: domain_disc_impl.h:804
void AssembleLinear(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &A, vector_type &rhs)
Definition: domain_disc_impl.h:965
virtual void assemble_stiffness_matrix(matrix_type &A, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles the stiffness matrix
Definition: domain_disc_impl.h:305
virtual void assemble_rhs(vector_type &rhs, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles rhs
Definition: domain_disc_impl.h:998
virtual void assemble_linear(matrix_type &A, vector_type &b, ConstSmartPtr< DoFDistribution > dd)
Assembles Matrix and Right-Hand-Side for a linear problem.
Definition: domain_disc_impl.h:837
void FinishTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
Definition: domain_disc_impl.h:2855
virtual void finish_timestep_elem(ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< DoFDistribution > dd)
finishes timestep
Definition: domain_disc_impl.h:2753
void AssembleStiffnessMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, matrix_type &A, const vector_type &u)
Definition: domain_disc_impl.h:431
void PrepareTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol)
Definition: domain_disc_impl.h:1344
virtual void assemble_jacobian(matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd)
assembles Jacobian (or Approximation of Jacobian)
Definition: domain_disc_impl.h:471
void update_error_items()
Definition: domain_disc_impl.h:134
void update_elem_errors()
Definition: domain_disc_impl.h:89
virtual void adjust_solution(vector_type &u, ConstSmartPtr< DoFDistribution > dd)
sets dirichlet values in solution vector
Definition: domain_disc_impl.h:1156
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
SmartPtr< TDomain > domain()
returns domain
Definition: grid_function.h:342
SmartPtr< ApproximationSpace< TDomain > > approx_space()
returns approx space
Definition: grid_function.h:348
Definition: grid_level.h:42
@ TOP
Definition: grid_level.h:45
@ SURFACE
Definition: grid_level.h:48
TAlgebra::vector_type vector_type
Type of algebra vector.
Definition: assemble_interface.h:119
TAlgebra::matrix_type matrix_type
Type of algebra matrix.
Definition: assemble_interface.h:116
Definition: elem_disc_interface.h:800
Definition: elem_disc_interface.h:760
Abstract base class for element marking (in adaptive refinement)
Definition: error_elem_marking_strategy.h:125
Base class for error estimator data.
Definition: err_est_data.h:71
bool consider_me() const
virtual function granting get access to the m_consider member
Definition: err_est_data.h:95
The refiner interface allows to mark elements for refinement and to call refine.
Definition: refiner_interface.h:67
Definition: local_algebra.h:50
size_t num_dof(size_t fct) const
number of dofs for accessible function
Definition: local_algebra.h:117
size_t num_fct() const
number of functions
Definition: local_algebra.h:114
Definition: local_algebra.h:198
void resize(const LocalIndices &ind)
resize for current local indices
Definition: local_algebra.h:214
Group of subsets.
Definition: subset_group.h:51
bool regular_grid(size_t i) const
returns if a subset is a regular grid
Definition: subset_group.cpp:224
size_t size() const
number of subsets in this group
Definition: subset_group.h:122
Const iterator to traverse the surface of a multi-grid hierarchy.
Definition: surface_view.h:237
@ ALL
Definition: surface_view.h:102
time series of solutions and corresponding time point
Definition: solution_time_series.h:59
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
void CollectCornerCoordinates(std::vector< typename TAAPos::ValueType > &vCornerCoordsOut, const TElem &elem, const TAAPos &aaPos, bool clearContainer=true)
returns the corner coordinates of a geometric object
Definition: domain_util_impl.h:75
std::string ElementDebugInfo(const Grid &grid, GridObject *e)
Returns a string containing information on the given element.
Definition: debug_util.cpp:991
#define UG_CATCH_THROW(msg)
Definition: error.h:64
#define UG_THROW(msg)
Definition: error.h:57
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124
SM_edge_weight_map< typename T::value_type, ug::BidirectionalMatrix< T > > get(edge_weight_t, ug::BidirectionalMatrix< T > const &g)
Definition: bidirectional_boost.h:157
IndexLayout::Interface::iterator find(IndexLayout::Interface &interface, size_t i)
Definition: parallel_index_layout.h:77
@ CT_DIRICHLET
Definition: ass_tuner.h:59
@ CT_HANGING
Definition: ass_tuner.h:57
@ CT_ALL
Definition: ass_tuner.h:60
@ CT_MAY_DEPEND_ON_HANGING
Definition: ass_tuner.h:56
@ CT_ASSEMBLED
Definition: ass_tuner.h:55
@ CT_CONSTRAINTS
Definition: ass_tuner.h:58
void GetElemDiscOnSubset(std::vector< IElemDisc< TDomain > * > &vSubsetElemDisc, const std::vector< IElemDisc< TDomain > * > &vElemDisc, const std::vector< SubsetGroup > &vSSGrp, int si, bool clearVec)
Definition: subset_assemble_util.cpp:40
void CreateSubsetGroups(std::vector< SubsetGroup > &vSSGrp, SubsetGroup &unionSSGrp, std::vector< TElemIn * > vElemDisc, ConstSmartPtr< ISubsetHandler > pSH)
Definition: subset_assemble_util.h:59
static void prep_assemble_loop(std::vector< TElemDisc * > vElemDisc)
Definition: domain_disc_impl.h:49
void CollectIErrEstData(std::vector< IErrEstData< TDomain > * > &vErrEstData, const T &vElemDisc)
Definition: domain_disc_impl.h:2113
void GetLocalVector(LocalVector &lvec, const TVector &vec)
Definition: local_algebra.h:739
int DimensionOfSubset(const ISubsetHandler &sh, int si)
returns the current dimension of the subset
Definition: subset_dim_util.cpp:89
bool SubsetIsRegularGrid(const SubsetHandler &sh, int si)
returns if a subset is a regular grid
Definition: subset_dim_util.cpp:39
void AddLocalVector(TVector &vec, const LocalVector &lvec)
Definition: local_algebra.h:753
static void post_assemble_loop(std::vector< TElemDisc * > vElemDisc)
Definition: domain_disc_impl.h:58
#define PROFILE_FUNC_GROUP(groups)
Definition: profiler.h:258
Definition: domain_traits.h:53