57 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
58 template <
typename TElem,
typename TIterator>
65 int si,
bool bNonRegularGrid,
71 m_extrapol.check_dd (dd);
74 if(iterBegin == iterEnd)
return;
85 vElemDisc, dd->function_pattern(), bNonRegularGrid);
88 Eval.prepare_elem_loop(
id, si);
94 int g_level = dd->grid_level().level ();
96 g_level = dd->multi_grid()->top_level ();
99 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
105 if(!spAssTuner->element_used(elem))
continue;
111 int elem_status = m_extrapol.check_elem_lsf
113 if (elem_status < 0)
continue;
114 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
117 dd->indices(elem, ind,
Eval.use_hanging());
131 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
133 UG_CATCH_THROW(
"AssembleStiffnessMatrix Cannot prepare element.");
139 Eval.add_jac_A_elem(locA, locU, elem, vCornerCoords);
141 UG_CATCH_THROW(
"AssembleStiffnessMatrix: Cannot compute Jacobian (A).");
145 spAssTuner->add_local_mat_to_global(A, locA, dd);
147 UG_CATCH_THROW(
"AssembleStiffnessMatrix: Cannot add local matrix.");
153 if (m_extrapol.corner_inside (base_co))
159 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
164 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
166 UG_CATCH_THROW(
"AssembleStiffnessMatrix Cannot prepare element.");
172 Eval.add_jac_A_elem(locA, locU, elem, vCornerCoords);
174 UG_CATCH_THROW(
"AssembleStiffnessMatrix: Cannot compute Jacobian (A).");
177 m_extrapol.template eliminate_extrapolated<TElem> (locA, base_co);
181 spAssTuner->add_local_mat_to_global(A, locA, dd);
183 UG_CATCH_THROW(
"AssembleStiffnessMatrix: Cannot add local matrix.");
191 Eval.finish_elem_loop();
193 UG_CATCH_THROW(
"AssembleStiffnessMatrix: Cannot finish element loop.");
196 UG_CATCH_THROW(
"AssembleStiffnessMatrix': Cannot create Data Evaluator.");
215 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
216 template <
typename TElem,
typename TIterator>
223 int si,
bool bNonRegularGrid,
229 m_extrapol.check_dd (dd);
232 if(iterBegin == iterEnd)
return;
244 vElemDisc, dd->function_pattern(), bNonRegularGrid);
247 Eval.prepare_elem_loop(
id, si);
253 int g_level = dd->grid_level().level ();
255 g_level = dd->multi_grid()->top_level ();
258 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
264 if(!spAssTuner->element_used(elem))
continue;
270 int elem_status = m_extrapol.check_elem_lsf
272 if (elem_status < 0)
continue;
273 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
276 dd->indices(elem, ind,
Eval.use_hanging());
290 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
298 Eval.add_jac_M_elem(locM, locU, elem, vCornerCoords);
300 UG_CATCH_THROW(
"AssembleMassMatrix: Cannot compute Jacobian (M).");
304 spAssTuner->add_local_mat_to_global(M, locM, dd);
312 if (m_extrapol.corner_inside (base_co))
318 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
323 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
331 Eval.add_jac_M_elem(locM, locU, elem, vCornerCoords);
333 UG_CATCH_THROW(
"AssembleMassMatrix: Cannot compute Jacobian (M).");
336 m_extrapol.template eliminate_extrapolated<TElem> (locM, base_co);
340 spAssTuner->add_local_mat_to_global(M, locM, dd);
350 Eval.finish_elem_loop();
352 UG_CATCH_THROW(
"AssembleMassMatrix: Cannot finish element loop.");
355 UG_CATCH_THROW(
"AssembleMassMatrix: Cannot create Data Evaluator.");
373 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
374 template <
typename TElem,
typename TIterator>
381 int si,
bool bNonRegularGrid,
387 m_extrapol.check_dd (dd);
390 if(iterBegin == iterEnd)
return;
402 vElemDisc, dd->function_pattern(), bNonRegularGrid);
405 Eval.prepare_elem_loop(
id, si);
411 int g_level = dd->grid_level().level ();
413 g_level = dd->multi_grid()->top_level ();
416 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
422 if(!spAssTuner->element_used(elem))
continue;
428 int elem_status = m_extrapol.check_elem_lsf
430 if (elem_status < 0)
continue;
431 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
434 dd->indices(elem, ind,
Eval.use_hanging());
448 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
450 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot prepare element.");
458 Eval.add_jac_A_elem(locJ, locU, elem, vCornerCoords);
460 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot compute Jacobian (A).");
464 spAssTuner->add_local_mat_to_global(J, locJ, dd);
466 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot add local matrix.");
472 if (m_extrapol.corner_inside (base_co))
478 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
483 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
485 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot prepare element.");
493 Eval.add_jac_A_elem(locJ, locU, elem, vCornerCoords);
495 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot compute Jacobian (A).");
498 m_extrapol.template eliminate_extrapolated<TElem> (locJ, base_co);
502 spAssTuner->add_local_mat_to_global(J, locJ, dd);
504 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot add local matrix.");
512 Eval.finish_elem_loop();
514 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot finish element loop.");
517 UG_CATCH_THROW(
"(stationary) AssembleJacobian: Cannot create Data Evaluator.");
538 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
539 template <
typename TElem,
typename TIterator>
546 int si,
bool bNonRegularGrid,
553 m_extrapol.check_dd (dd);
556 if(iterBegin == iterEnd)
return;
575 vElemDisc, dd->function_pattern(), bNonRegularGrid,
577 Eval.set_time_point(0);
580 Eval.prepare_elem_loop(
id, si);
586 int g_level = dd->grid_level().level ();
588 g_level = dd->multi_grid()->top_level ();
591 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
597 if(!spAssTuner->element_used(elem))
continue;
603 int elem_status = m_extrapol.check_elem_lsf
605 if (elem_status < 0)
continue;
606 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
609 dd->indices(elem, ind,
Eval.use_hanging());
621 if(
Eval.time_series_needed())
627 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
629 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot prepare element.");
642 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot compute Jacobian (A).");
649 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot compute Jacobian (M).");
653 spAssTuner->add_local_mat_to_global(J, locJ, dd);
655 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot add local matrix.");
661 if (m_extrapol.corner_inside (base_co))
667 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
670 if(
Eval.time_series_needed())
673 for (
size_t i = 0; i < locTimeSeries.
size (); i++)
674 m_extrapol.template extrapolate_sol_by_lsf<TElem>
675 (locTimeSeries.
solution (i), base_co);
681 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
683 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot prepare element.");
696 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot compute Jacobian (A).");
703 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot compute Jacobian (M).");
706 m_extrapol.template eliminate_extrapolated<TElem> (locJ, base_co);
710 spAssTuner->add_local_mat_to_global(J, locJ, dd);
712 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot add local matrix.");
720 Eval.finish_elem_loop();
722 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot finish element loop.");
725 UG_CATCH_THROW(
"(instationary) AssembleJacobian: Cannot create Data Evaluator.");
744 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
745 template <
typename TElem,
typename TIterator>
752 int si,
bool bNonRegularGrid,
758 m_extrapol.check_dd (dd);
761 if(iterBegin == iterEnd)
return;
773 vElemDisc, dd->function_pattern(), bNonRegularGrid);
776 Eval.prepare_elem_loop(
id, si);
782 int g_level = dd->grid_level().level ();
784 g_level = dd->multi_grid()->top_level ();
787 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
793 if(!spAssTuner->element_used(elem))
continue;
799 int elem_status = m_extrapol.check_elem_lsf
801 if (elem_status < 0)
continue;
802 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
805 dd->indices(elem, ind,
Eval.use_hanging());
819 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind);
821 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot prepare element.");
825 if( spAssTuner->modify_solution_enabled() )
829 spAssTuner->modify_LocalSol(modLocU, locU, dd);
842 Eval.add_def_A_elem(locD, locU, elem, vCornerCoords);
844 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot compute Defect (A).");
850 Eval.add_rhs_elem(tmpLocD, elem, vCornerCoords);
854 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot compute Rhs.");
858 spAssTuner->add_local_vec_to_global(d, locD, dd);
860 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot add local vector.");
866 if (m_extrapol.corner_inside (base_co))
872 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
877 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind);
879 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot prepare element.");
883 if( spAssTuner->modify_solution_enabled() )
887 spAssTuner->modify_LocalSol(modLocU, locU, dd);
900 Eval.add_def_A_elem(locD, locU, elem, vCornerCoords);
902 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot compute Defect (A).");
908 Eval.add_rhs_elem(tmpLocD, elem, vCornerCoords);
912 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot compute Rhs.");
915 m_extrapol.template clear_outer_vectors<TElem> (locD, base_co);
919 spAssTuner->add_local_vec_to_global(d, locD, dd);
921 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot add local vector.");
929 Eval.finish_elem_loop();
931 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot finish element loop.");
934 UG_CATCH_THROW(
"(stationary) AssembleDefect: Cannot create Data Evaluator.");
955 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
956 template <
typename TElem,
typename TIterator>
963 int si,
bool bNonRegularGrid,
966 const std::vector<number>& vScaleMass,
967 const std::vector<number>& vScaleStiff,
971 m_extrapol.check_dd (dd);
974 if(iterBegin == iterEnd)
return;
983 if(vScaleMass.size() != vScaleStiff.size())
984 UG_THROW(
"(instationary) AssembleDefect: s_a and s_m must have same size.");
986 if(vSol->size() < vScaleStiff.size())
987 UG_THROW(
"(instationary) AssembleDefect: Time stepping scheme needs at "
988 "least "<<vScaleStiff.size()<<
" time steps, but only "<<
989 vSol->size() <<
" passed.");
999 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1000 &locTimeSeries, &vScaleMass, &vScaleStiff);
1003 Eval.prepare_elem_loop(
id, si);
1009 int g_level = dd->grid_level().level ();
1011 g_level = dd->multi_grid()->top_level ();
1014 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
1017 TElem* elem = *iter;
1020 if(!spAssTuner->element_used(elem))
continue;
1026 int elem_status = m_extrapol.check_elem_lsf
1028 if (elem_status < 0)
continue;
1029 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
1032 dd->indices(elem, ind,
Eval.use_hanging());
1038 if (elem_status > 0)
1047 for(
size_t t = 0; t < vScaleStiff.size(); ++t)
1049 number scale_stiff = vScaleStiff[t];
1053 Eval.set_time_point(t);
1058 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
false);
1060 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot prepare element.");
1069 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Defect (M).");
1074 if(scale_stiff != 0.0)
1084 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Defect (A).");
1095 UG_CATCH_THROW(
"(instationary) AssembleDefect explizit: Cannot compute Defect (A).");
1098 const number dt = vSol->time(0)-vSol->time(1);
1106 if(scale_stiff != 0.0)
1120 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Rhs.");
1125 spAssTuner->add_local_vec_to_global(d, locD, dd);
1127 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot add local vector.");
1133 if (m_extrapol.corner_inside (base_co))
1142 for(
size_t t = 0; t < vScaleStiff.size(); ++t)
1144 number scale_stiff = vScaleStiff[t];
1148 Eval.set_time_point(t);
1151 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
1156 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
false);
1158 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot prepare element.");
1167 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Defect (M).");
1172 if(scale_stiff != 0.0)
1182 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Defect (A).");
1193 UG_CATCH_THROW(
"(instationary) AssembleDefect explizit: Cannot compute Defect (A).");
1196 const number dt = vSol->time(0)-vSol->time(1);
1204 if(scale_stiff != 0.0)
1218 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot compute Rhs.");
1222 m_extrapol.template clear_outer_vectors<TElem>(locD, base_co);
1226 spAssTuner->add_local_vec_to_global(d, locD, dd);
1228 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot add local vector.");
1236 Eval.finish_elem_loop();
1238 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot finish element loop.");
1241 UG_CATCH_THROW(
"(instationary) AssembleDefect: Cannot create Data Evaluator.");
1261 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1262 template <
typename TElem,
typename TIterator>
1267 TIterator iterBegin,
1269 int si,
bool bNonRegularGrid,
1275 m_extrapol.check_dd (dd);
1278 if(iterBegin == iterEnd)
return;
1290 vElemDisc, dd->function_pattern(), bNonRegularGrid);
1293 Eval.prepare_elem_loop(
id, si);
1299 int g_level = dd->grid_level().level ();
1301 g_level = dd->multi_grid()->top_level ();
1304 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
1307 TElem* elem = *iter;
1310 if(!spAssTuner->element_used(elem))
continue;
1316 int elem_status = m_extrapol.check_elem_lsf
1318 if (elem_status < 0)
continue;
1319 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
1322 dd->indices(elem, ind,
Eval.use_hanging());
1330 Eval.prepare_elem(locRhs, elem,
id, vCornerCoords, ind,
true);
1332 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot prepare element.");
1341 Eval.add_jac_A_elem(locA, locRhs, elem, vCornerCoords);
1343 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot compute Jacobian (A).");
1348 Eval.add_rhs_elem(locRhs, elem, vCornerCoords);
1350 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot compute Rhs.");
1353 if (elem_status == 0)
1354 m_extrapol.template eliminate_extrapolated<TElem> (locA, locRhs);
1358 spAssTuner->add_local_mat_to_global(A, locA, dd);
1359 spAssTuner->add_local_vec_to_global(rhs, locRhs, dd);
1361 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot add local vector/matrix.");
1367 Eval.finish_elem_loop();
1369 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot finish element loop.");
1372 UG_CATCH_THROW(
"(stationary) AssembleLinear: Cannot create Data Evaluator.");
1395 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1396 template <
typename TElem,
typename TIterator>
1401 TIterator iterBegin,
1403 int si,
bool bNonRegularGrid,
1407 const std::vector<number>& vScaleMass,
1408 const std::vector<number>& vScaleStiff,
1412 m_extrapol.check_dd (dd);
1415 if(iterBegin == iterEnd)
return;
1424 if(vScaleMass.size() != vScaleStiff.size())
1425 UG_THROW(
"(instationary) AssembleLinear: s_a and s_m must have same size.");
1427 if(vSol->size() < vScaleStiff.size())
1428 UG_THROW(
"(instationary) AssembleLinear: Time stepping scheme needs at "
1429 "least "<<vScaleStiff.size()<<
" time steps, but only "<<
1430 vSol->size() <<
" passed.");
1440 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1441 &locTimeSeries, &vScaleMass, &vScaleStiff);
1444 Eval.prepare_elem_loop(
id, si);
1450 int g_level = dd->grid_level().level ();
1452 g_level = dd->multi_grid()->top_level ();
1455 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
1458 TElem* elem = *iter;
1461 if(!spAssTuner->element_used(elem))
continue;
1467 int elem_status = m_extrapol.check_elem_lsf
1469 if (elem_status < 0)
continue;
1470 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
1473 dd->indices(elem, ind,
Eval.use_hanging());
1480 if (elem_status > 0)
1484 Eval.set_time_point(0);
1487 locA = 0.0; locRhs = 0.0;
1498 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
1500 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot prepare element.");
1509 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (M).");
1520 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (A).");
1531 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Rhs.");
1537 for(
size_t t = 1; t < vScaleStiff.size(); ++t)
1541 Eval.set_time_point(t);
1546 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
false);
1548 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot prepare element.");
1557 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (M).");
1566 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (A).");
1575 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Rhs.");
1580 spAssTuner->add_local_mat_to_global(A, locA, dd);
1581 spAssTuner->add_local_vec_to_global(rhs, locRhs, dd);
1583 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot add local vector/matrix.");
1589 if (m_extrapol.corner_inside (base_co))
1593 Eval.set_time_point(0);
1596 locA = 0.0; locRhs = 0.0;
1605 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
1610 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
true);
1612 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot prepare element.");
1621 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (M).");
1632 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (A).");
1643 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Rhs.");
1649 for(
size_t t = 1; t < vScaleStiff.size(); ++t)
1653 Eval.set_time_point(t);
1656 m_extrapol.template extrapolate_sol_by_lsf<TElem> (locU, base_co);
1661 Eval.prepare_elem(locU, elem,
id, vCornerCoords, ind,
false);
1663 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot prepare element.");
1672 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (M).");
1681 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Jacobian (A).");
1690 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot compute Rhs.");
1694 m_extrapol.template eliminate_extrapolated<TElem> (locA, locRhs, base_co);
1698 spAssTuner->add_local_mat_to_global(A, locA, dd);
1699 spAssTuner->add_local_vec_to_global(rhs, locRhs, dd);
1701 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot add local vector/matrix.");
1709 Eval.finish_elem_loop();
1711 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot finish element loop.");
1714 UG_CATCH_THROW(
"(instationary) AssembleLinear: Cannot create Data Evaluator.");
1717 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1723 bool bNonRegularGrid,
1739 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1741 Eval.set_time_point(0);
1748 Eval.prepare_timestep(future_time, vSol->time(0), &vp, algebra_index);
1750 UG_CATCH_THROW(
"(instationary) PrepareTimestep: Cannot prepare timestep.");
1753 UG_CATCH_THROW(
"(instationary) PrepareTimestep: Cannot create Data Evaluator.");
1775 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1776 template <
typename TElem,
typename TIterator>
1781 TIterator iterBegin,
1783 int si,
bool bNonRegularGrid,
1788 m_extrapol.check_dd (dd);
1791 if(iterBegin == iterEnd)
return;
1809 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1811 Eval.set_time_point(0);
1814 Eval.prepare_elem_loop(
id, si);
1820 int g_level = dd->grid_level().level ();
1822 g_level = dd->multi_grid()->top_level ();
1825 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
1828 TElem* elem = *iter;
1831 if(!spAssTuner->element_used(elem))
continue;
1837 int elem_status = m_extrapol.check_elem_lsf
1839 if (elem_status < 0)
continue;
1840 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
1843 dd->indices(elem, ind,
Eval.use_hanging());
1852 if(
Eval.time_series_needed())
1858 Eval.prepare_timestep_elem(vSol->time(0), locU, elem, vCornerCoords);
1860 UG_CATCH_THROW(
"(instationary) PrepareTimestepElem: Cannot prepare timestep.");
1864 UG_CATCH_THROW(
"(instationary) PrepareTimestepElem: Cannot create Data Evaluator.");
1867 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1873 bool bNonRegularGrid,
1888 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1890 Eval.set_time_point(0);
1897 Eval.finish_timestep(vSol->time(0), &vp, algebra_index);
1899 UG_CATCH_THROW(
"(instationary) FinishTimestep: Cannot prepare time step.");
1902 UG_CATCH_THROW(
"(instationary) FinishTimestep: Cannot create Data Evaluator.");
1922 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
1923 template <
typename TElem,
typename TIterator>
1928 TIterator iterBegin,
1930 int si,
bool bNonRegularGrid,
1935 m_extrapol.check_dd (dd);
1938 if(iterBegin == iterEnd)
return;
1957 vElemDisc, dd->function_pattern(), bNonRegularGrid,
1959 Eval.set_time_point(0);
1962 Eval.prepare_elem_loop(
id, si);
1968 int g_level = dd->grid_level().level ();
1970 g_level = dd->multi_grid()->top_level ();
1973 for(TIterator iter = iterBegin; iter != iterEnd; ++iter)
1976 TElem* elem = *iter;
1979 if(!spAssTuner->element_used(elem))
continue;
1985 int elem_status = m_extrapol.check_elem_lsf
1987 if (elem_status < 0)
continue;
1988 if (m_bAssembleOnlyCut && elem_status > 0)
continue;
1991 dd->indices(elem, ind,
Eval.use_hanging());
2000 if(
Eval.time_series_needed())
2006 Eval.finish_timestep_elem(locTimeSeries.
time(0), locU, elem, vCornerCoords);
2008 UG_CATCH_THROW(
"(instationary) FinishTimestepElem: Cannot finish timestep.");
2012 UG_CATCH_THROW(
"(instationary) FinishTimestepElem: Cannot create Data Evaluator");
2033 template <
typename TDomain,
typename TAlgebra,
typename TExtrapolation>
2034 template <
typename TElem,
typename TIterator>
2038 TIterator iterBegin,
2040 int si,
bool bNonRegularGrid,
bool bAsTimeDependent)
2043 if(iterBegin == iterEnd)
return;
2055 vElemDisc, dd->function_pattern(), bNonRegularGrid,
2056 bAsTimeDependent? &locTimeSeries : NULL);
2057 Eval.set_time_point(0);
2060 Eval.prepare_elem_loop(
id, si);
2064 Eval.finish_elem_loop();
The AssemblingTuner class combines tools to adapt the assembling routine.
Definition: ass_tuner.h:90
Evaluation for IElemDisc.
Definition: data_evaluator.h:169
@ TOP
Definition: grid_level.h:45
Definition: elem_disc_interface.h:800
void FinishTimestep(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:1870
void PrepareTimestep(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, number future_time, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:1720
TAlgebra algebra_type
Algebra type.
Definition: dom_disc_embb.h:166
void AssembleMassMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &M, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:218
void AssembleDefect(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, vector_type &d, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:747
void AssembleLinear(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &A, vector_type &rhs, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:1264
void InitAllExports(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, bool bAsTimeDependent)
Definition: dom_disc_embb_impl.h:2036
void AssembleStiffnessMatrix(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &A, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:60
void FinishTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:1925
void PrepareTimestepElem(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:1778
algebra_type::vector_type vector_type
Vector type in the algebra.
Definition: dom_disc_embb.h:172
algebra_type::matrix_type matrix_type
Matrix type in the algebra.
Definition: dom_disc_embb.h:175
void AssembleJacobian(const std::vector< IElemDisc< domain_type > * > &vElemDisc, ConstSmartPtr< domain_type > spDomain, ConstSmartPtr< DoFDistribution > dd, TIterator iterBegin, TIterator iterEnd, int si, bool bNonRegularGrid, matrix_type &J, const vector_type &u, ConstSmartPtr< AssemblingTuner< TAlgebra > > spAssTuner)
Definition: dom_disc_embb_impl.h:376
Definition: local_algebra.h:50
Definition: local_algebra.h:422
void resize(const LocalIndices &ind)
resize for same ind in row and column
Definition: local_algebra.h:445
this_type & scale_append(number s, const this_type &rhs)
add scaled matrix
Definition: local_algebra.h:523
Definition: local_algebra.h:198
this_type & scale_append(number s, const this_type &rhs)
add a scaled vector
Definition: local_algebra.h:292
void resize(const LocalIndices &ind)
resize for current local indices
Definition: local_algebra.h:214
time series of local vectors
Definition: solution_time_series.h:167
void read_values(ConstSmartPtr< VectorTimeSeries< TVector > > vecTimeSeries, LocalIndices &ind)
extract local values from global vectors
Definition: solution_time_series.h:196
void read_times(ConstSmartPtr< VectorTimeSeries< TVector > > vecTimeSeries)
extract time points
Definition: solution_time_series.h:208
number time(size_t i) const
returns time point i
Definition: solution_time_series.h:176
const LocalVector & solution(size_t i) const
returns the local vector for the i'th time point
Definition: solution_time_series.h:182
size_t size() const
returns number of time points
Definition: solution_time_series.h:173
a mathematical Vector with N entries.
Definition: math_vector.h:97
time series of solutions and corresponding time point
Definition: solution_time_series.h:59
Definition: grid_base_object_traits.h:68
#define UG_CATCH_THROW(msg)
Definition: error.h:64
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
SmartPtr< typename TAlgebra::vector_type > Eval(SmartPtr< VecScaleAddClass< TAlgebra > > vsac)
Definition: bridge_mat_vec_operations.h:141
const int NUM_VERTICES
Definition: hexahedron_rules.h:45
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
@ PT_INSTATIONARY
Definition: data_evaluator.h:42
@ PT_STATIONARY
Definition: data_evaluator.h:42
@ NONE
Definition: data_import.h:44
@ STIFF
Definition: data_import.h:46
@ RHS
Definition: data_import.h:47
@ EXPL
Definition: data_import.h:48
@ MASS
Definition: data_import.h:45
void FillCornerCoordinates(typename TDomain::position_type vCornerCoordsOut[], const TElem &elem, const TDomain &domain)
returns the corner coordinates of a geometric object
Definition: domain_util_impl.h:114
void GetLocalVector(LocalVector &lvec, const TVector &vec)
Definition: local_algebra.h:739
Definition: elem_disc_interface.h:77
size_t id()
Definition: util_algebra_dependent.h:130
static AlgebraTypeIDProvider & instance()
Definition: util_algebra_dependent.h:107