24 #ifndef OptProblemContainer_H_
25 #define OptProblemContainer_H_
49 #include <lac/vector.h>
50 #include <lac/full_matrix.h>
51 #include <grid/tria_iterator.h>
52 #include <dofs/dof_handler.h>
53 #include <dofs/dof_accessor.h>
54 #include <dofs/dof_tools.h>
55 #include <fe/fe_system.h>
56 #include <fe/fe_values.h>
57 #include <fe/mapping.h>
58 #include <base/quadrature_lib.h>
59 #include <lac/block_sparsity_pattern.h>
60 #include <lac/compressed_simple_sparsity_pattern.h>
69 template<
typename VECTOR>
71 template<
typename VECTOR>
96 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
97 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
98 typename VECTOR,
int dopedim,
int dealdim,
99 template<
int,
int>
class FE = dealii::FESystem,
100 template<
int,
int>
class DH = dealii::DoFHandler>
105 CONSTRAINTS& constraints,
126 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>,
127 PDE, DD, SPARSITYPATTERN, VECTOR, dealdim>&
130 if (state_problem_ == NULL)
134 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE,
135 DH>, PDE, DD, SPARSITYPATTERN, VECTOR, dealdim>(
138 return *state_problem_;
144 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>&
159 ReInit(std::string algo_type);
174 ExceptionHandler_ = OH;
187 SetType(std::string type,
unsigned int num = 0);
206 template<
typename DATACONTAINER>
223 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
224 const std::map<std::string, const VECTOR*> &domain_values);
244 template<
typename FACEDATACONTAINER>
256 template<
typename FACEDATACONTAINER>
269 const std::map<std::string,
const dealii::Vector<double>*> &values,
270 const std::map<std::string, const VECTOR*> &block_values);
280 const std::map<std::string,
const dealii::Vector<double>*> &values,
281 const std::map<std::string, const VECTOR*> &block_values);
308 template<
typename DATACONTAINER>
311 dealii::Vector<double> &local_vector,
double scale,
321 template<
typename DATACONTAINER>
324 dealii::Vector<double> &local_vector,
double scale = 1.);
337 template<
typename DATACONTAINER>
340 dealii::Vector<double> &local_vector,
double scale = 1.);
355 template<
typename DATACONTAINER>
358 dealii::Vector<double> &local_vector,
double scale = 1.);
376 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
377 const std::map<std::string, const VECTOR*> &domain_values,
378 VECTOR& rhs_vector,
double scale = 1.);
405 template<
typename DATACONTAINER>
408 dealii::FullMatrix<double> &local_entry_matrix,
double scale = 1.,
409 double scale_ico = 1.);
424 template<
typename DATACONTAINER>
427 dealii::FullMatrix<double> &local_entry_matrix);
440 template<
typename DATACONTAINER>
443 dealii::FullMatrix<double> &local_entry_matrix);
453 template<
typename FACEDATACONTAINER>
456 dealii::Vector<double> &local_vector,
double scale,
468 template<
typename FACEDATACONTAINER>
471 dealii::Vector<double> &local_vector,
double scale,
481 template<
typename FACEDATACONTAINER>
483 FaceRhs(
const FACEDATACONTAINER& dc,
484 dealii::Vector<double> &local_vector,
double scale = 1.);
494 template<
typename FACEDATACONTAINER>
497 dealii::FullMatrix<double> &local_entry_matrix,
double scale = 1.,
498 double scale_ico = 1.);
507 template<
typename FACEDATACONTAINER>
510 dealii::FullMatrix<double> &local_entry_matrix,
double scale = 1.,
511 double scale_ico = 1.);
521 template<
typename FACEDATACONTAINER>
524 dealii::Vector<double> &local_vector,
double scale,
535 template<
typename FACEDATACONTAINER>
538 dealii::Vector<double> &local_vector,
double scale = 1.);
548 template<
typename FACEDATACONTAINER>
551 dealii::FullMatrix<double> &local_matrix,
double scale = 1.,
552 double scale_ico = 1.);
556 const std::map<std::string,
const dealii::Vector<double>*> &values,
557 const std::map<std::string, const VECTOR*> &block_values);
573 const FE<dealdim, dealdim>&
620 const std::vector<bool>& comp_mask,
627 const std::vector<bool>& comp_mask,
const DD* values);
631 const std::vector<unsigned int>&
633 const std::vector<unsigned int>&
635 const std::vector<bool>&
637 const std::vector<bool>&
642 const dealii::Function<dealdim> &
644 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
645 const std::map<std::string, const VECTOR*> &domain_values)
const;
651 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
652 const std::map<std::string, const VECTOR*> &domain_values)
const;
659 initial_values_ = values;
661 const dealii::Function<dealdim>&
664 return *initial_values_;
673 const std::vector<unsigned int>&
677 const std::vector<unsigned int>&
694 aux_functionals_.push_back(F);
695 if (functional_position_.find(F->GetName())
696 != functional_position_.end())
699 "You cant add two functionals with the same name.",
700 "OPTProblemContainer::AddFunctional");
702 functional_position_[F->GetName()] = aux_functionals_.size();
722 functional_for_ee_is_cost_ =
true;
723 functional_for_ee_num_ = dealii::numbers::invalid_unsigned_int;
727 functional_for_ee_is_cost_ =
false;
732 if (aux_functionals_[i]->
GetName() == functional_name)
736 functional_for_ee_num_ = i;
744 "Can't find functional " + functional_name
745 +
" in aux_functionals_",
746 "Optproblem::SetFunctionalForErrorEstimation");
756 return aux_functionals_.size();
781 const std::vector<unsigned int>&
786 const dealii::ConstraintMatrix&
815 assert(ExceptionHandler_);
816 return ExceptionHandler_;
824 assert(OutputHandler_);
825 return OutputHandler_;
913 typename std::map<std::string, const ConstraintVector<VECTOR> *>::iterator it =
914 auxiliary_constraints_.find(name);
915 if (it == auxiliary_constraints_.end())
918 "OptProblemContainer::GetAuxiliaryConstraint");
931 template<
typename INTEGRATOR>
941 typename std::map<std::string, const ControlVector<VECTOR> *>::iterator it =
942 auxiliary_controls_.begin();
943 for (; it != auxiliary_controls_.end(); it++)
945 if (dopedim == dealdim)
947 integrator.AddDomainData(it->first,
948 &(it->second->GetSpacialVector()));
950 else if (dopedim == 0)
952 integrator.AddParamData(it->first,
953 &(it->second->GetSpacialVectorCopy()));
958 "OptProblemContainer::AddAuxiliaryToIntegrator");
964 typename std::map<std::string, const StateVector<VECTOR> *>::iterator it =
965 auxiliary_state_.begin();
966 for (; it != auxiliary_state_.end(); it++)
968 integrator.AddDomainData(it->first,
969 &(it->second->GetSpacialVector()));
973 typename std::map<std::string, const ConstraintVector<VECTOR> *>::iterator it =
974 auxiliary_constraints_.begin();
975 for (; it != auxiliary_constraints_.end(); it++)
977 integrator.AddDomainData(it->first +
"_local",
978 &(it->second->GetSpacialVector(
"local")));
979 integrator.AddParamData(it->first +
"_global",
980 &(it->second->GetGlobalConstraints()));
994 template<
typename INTEGRATOR>
1004 typename std::map<std::string, const ControlVector<VECTOR> *>::iterator it =
1005 auxiliary_controls_.begin();
1006 for (; it != auxiliary_controls_.end(); it++)
1008 if (dopedim == dealdim)
1010 integrator.DeleteDomainData(it->first);
1012 else if (dopedim == 0)
1014 integrator.DeleteParamData(it->first);
1015 it->second->UnLockCopy();
1020 "OptProblemContainer::AddAuxiliaryToIntegrator");
1026 typename std::map<std::string, const StateVector<VECTOR> *>::iterator it =
1027 auxiliary_state_.begin();
1028 for (; it != auxiliary_state_.end(); it++)
1030 integrator.DeleteDomainData(it->first);
1034 typename std::map<std::string, const ConstraintVector<VECTOR> *>::iterator it =
1035 auxiliary_constraints_.begin();
1036 for (; it != auxiliary_constraints_.end(); it++)
1038 integrator.DeleteDomainData(it->first +
"_local");
1039 integrator.DeleteParamData(it->first +
"_global");
1045 const std::map<std::string, unsigned int>&
1048 return functional_position_;
1054 return this->
GetPDE().GetStateNBlocks();
1059 std::vector<unsigned int>&
1062 return this->
GetPDE().GetControlBlockComponent();
1066 std::vector<unsigned int>&
1069 return this->
GetPDE().GetStateBlockComponent();
1075 template<
typename DATACONTAINER>
1078 dealii::Vector<double> &local_vector,
double scale,
1082 || this->
GetType() ==
"adjoint_hessian")
1084 this->
GetPDE().Init_ElementEquation(edc, local_vector, scale,
1090 "OptProblemContainer::Init_ElementEquation");
1094 template<
typename DATACONTAINER>
1097 dealii::Vector<double> &local_vector,
double scale)
1100 if (this->
GetType() ==
"adjoint")
1105 != std::string::npos)
1108 != std::string::npos)
1115 else if (this->
GetType() ==
"tangent")
1117 this->
GetPDE().Init_ElementRhs_QT(edc, local_vector, scale);
1119 else if (this->
GetType() ==
"adjoint_hessian")
1124 != std::string::npos)
1127 != std::string::npos)
1137 "OptProblemContainer::Init_ElementRhs");
1143 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
1144 const std::map<std::string, const VECTOR*> &domain_values,
1145 VECTOR& rhs_vector,
double scale = 1.)
1147 if (this->
GetType() ==
"adjoint")
1152 != std::string::npos)
1155 != std::string::npos)
1163 else if (this->
GetType() ==
"tangent")
1167 else if (this->
GetType() ==
"adjoint_hessian")
1172 != std::string::npos)
1175 != std::string::npos)
1186 "OptProblemContainer::Init_PointRhs");
1190 template<
typename DATACONTAINER>
1193 dealii::FullMatrix<double> &local_entry_matrix,
double scale,
1197 || this->
GetType() ==
"adjoint_hessian")
1199 this->
GetPDE().Init_ElementMatrix(edc, local_entry_matrix, scale,
1205 "OptProblemContainer::Init_ElementMatrix");
1218 return functional_for_ee_is_cost_;
1229 return constraints_;
1234 return constraints_;
1241 typename std::map<std::string, const VECTOR*>::const_iterator it =
1243 if (it == values.end())
1246 "OptProblemContainer::GetBlockVector");
1250 const dealii::Vector<double>*
1251 GetVector(
const std::map<std::string,
const Vector<double>*>& values,
1254 typename std::map<std::string, const Vector<double>*>::const_iterator it =
1256 if (it == values.end())
1259 "OptProblemContainer::GetVector");
1267 std::string algo_type_;
1269 bool functional_for_ee_is_cost_;
1270 double c_interval_length_, interval_length_;
1271 unsigned int functional_for_ee_num_;
1272 std::vector<FUNCTIONAL_INTERFACE*> aux_functionals_;
1273 std::map<std::string, unsigned int> functional_position_;
1274 FUNCTIONAL* functional_;
1275 CONSTRAINTS* constraints_;
1278 std::vector<unsigned int> control_dirichlet_colors_;
1279 std::vector<unsigned int> control_transposed_dirichlet_colors_;
1280 std::vector<std::vector<bool> > control_dirichlet_comps_;
1281 std::vector<const DOpEWrapper::Function<dealdim>*> control_dirichlet_values_;
1287 std::vector<unsigned int> dirichlet_colors_;
1288 std::vector<std::vector<bool> > dirichlet_comps_;
1289 std::vector<PrimalDirichletData<DD, VECTOR, dealdim>*> primal_dirichlet_values_;
1290 std::vector<TangentDirichletData<DD, VECTOR, dealdim>*> tangent_dirichlet_values_;
1291 const dealii::Function<dealdim>* zero_dirichlet_values_;
1293 const dealii::Function<dealdim>* initial_values_;
1295 std::vector<unsigned int> control_boundary_equation_colors_;
1296 std::vector<unsigned int> state_boundary_equation_colors_;
1297 std::vector<unsigned int> adjoint_boundary_equation_colors_;
1299 std::vector<unsigned int> boundary_functional_colors_;
1301 std::map<std::string, const ControlVector<VECTOR>*> auxiliary_controls_;
1302 std::map<std::string, const StateVector<VECTOR>*> auxiliary_state_;
1303 std::map<std::string, const ConstraintVector<VECTOR>*> auxiliary_constraints_;
1309 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>,
1310 PDE, DD, SPARSITYPATTERN, VECTOR, dealdim> * state_problem_;
1314 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>,
1315 PDE, DD, SPARSITYPATTERN, VECTOR, dealdim> ;
1319 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1320 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1321 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1322 template<
int,
int>
class DH>
1325 FUNCTIONAL& functional, PDE& pde, CONSTRAINTS& constraints,
1328 &constraints), STH_(&STH), state_problem_(NULL)
1330 ExceptionHandler_ = NULL;
1331 OutputHandler_ = NULL;
1332 zero_dirichlet_values_ =
new ZeroFunction<dealdim>(
1333 this->
GetPDE().GetStateNComponents());
1335 functional_position_[functional_->GetName()] = 0;
1337 functional_for_ee_num_ = dealii::numbers::invalid_unsigned_int;
1338 c_interval_length_ = 1.;
1339 interval_length_ = 1.;
1344 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1345 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1346 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1347 template<
int,
int>
class DH>
1349 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::~OptProblemContainer()
1351 if (zero_dirichlet_values_ != NULL)
1353 delete zero_dirichlet_values_;
1356 for (
unsigned int i = 0;
1357 i < transposed_control_gradient_dirichlet_values_.size(); i++)
1359 if (transposed_control_gradient_dirichlet_values_[i] != NULL)
1360 delete transposed_control_gradient_dirichlet_values_[i];
1362 for (
unsigned int i = 0;
1363 i < transposed_control_hessian_dirichlet_values_.size(); i++)
1365 if (transposed_control_hessian_dirichlet_values_[i] != NULL)
1366 delete transposed_control_hessian_dirichlet_values_[i];
1368 for (
unsigned int i = 0; i < primal_dirichlet_values_.size(); i++)
1370 if (primal_dirichlet_values_[i] != NULL)
1371 delete primal_dirichlet_values_[i];
1373 for (
unsigned int i = 0; i < tangent_dirichlet_values_.size(); i++)
1375 if (tangent_dirichlet_values_[i] != NULL)
1376 delete tangent_dirichlet_values_[i];
1378 if (state_problem_ != NULL)
1380 delete state_problem_;
1386 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1387 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1388 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1389 template<
int,
int>
class DH>
1392 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ReInit(
1393 std::string algo_type)
1395 if (state_problem_ != NULL)
1397 delete state_problem_;
1398 state_problem_ = NULL;
1401 if (algo_type_ != algo_type && algo_type_ !=
"")
1404 "OptProblemContainer::ReInit");
1408 algo_type_ = algo_type;
1409 this->SetTypeInternal(
"");
1411 if (algo_type_ ==
"reduced")
1413 GetSpaceTimeHandler()->ReInit(this->GetPDE().GetControlNBlocks(),
1414 this->GetPDE().GetControlBlockComponent(),
1415 this->GetPDE().GetStateNBlocks(),
1416 this->GetPDE().GetStateBlockComponent());
1421 "OptProblemContainer::ReInit");
1428 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1429 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1430 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1431 template<
int,
int>
class DH>
1434 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetType(
1435 std::string type,
unsigned int num)
1437 if (this->GetType() != type || this->GetTypeNum() != num)
1439 this->SetTypeNumInternal(num);
1440 this->SetTypeInternal(type);
1441 this->GetPDE().SetProblemType(type);
1442 if (functional_for_ee_num_ != dealii::numbers::invalid_unsigned_int)
1443 aux_functionals_[functional_for_ee_num_]->SetProblemType(type);
1444 this->GetConstraints()->SetProblemType(type, num);
1446 #if dope_dimension > 0
1447 if(dealdim == dopedim)
1452 if(this->GetType() ==
"state" ||this->GetType() ==
"adjoint"
1453 || this->GetType() ==
"adjoint_for_ee" || this->GetType() ==
"cost_functional"
1454 || this->GetType() ==
"aux_functional" || this->GetType() ==
"functional_for_ee"
1455 || this->GetType() ==
"tangent" || this->GetType() ==
"adjoint_hessian"
1456 || this->GetType() ==
"error_evaluation"
1457 || this->GetType().find(
"constraints") != std::string::npos)
1459 GetSpaceTimeHandler()->SetDoFHandlerOrdering(1,0);
1461 else if (this->GetType() ==
"gradient"||this->GetType() ==
"hessian"||this->GetType() ==
"hessian_inverse" || this->GetType() ==
"global_constraint_gradient"|| this->GetType() ==
"global_constraint_hessian")
1463 GetSpaceTimeHandler()->SetDoFHandlerOrdering(0,1);
1467 throw DOpEException(
"problem_type_ : "+this->GetType()+
" not implemented!",
"OptProblemContainer::SetType");
1473 throw DOpEException(
"dopedim not implemented",
"OptProblemContainer::SetType");
1481 if (this->GetType() ==
"state" || this->GetType() ==
"adjoint"
1482 || this->GetType() ==
"adjoint_for_ee"
1483 || this->GetType() ==
"functional_for_ee"
1484 || this->GetType() ==
"cost_functional"
1485 || this->GetType() ==
"aux_functional"
1486 || this->GetType() ==
"tangent"
1487 || this->GetType() ==
"error_evaluation"
1488 || this->GetType() ==
"adjoint_hessian")
1490 GetSpaceTimeHandler()->SetDoFHandlerOrdering(0, 0);
1492 else if (this->GetType() ==
"gradient"
1493 || this->GetType() ==
"hessian_inverse"
1494 || this->GetType() ==
"hessian")
1496 GetSpaceTimeHandler()->SetDoFHandlerOrdering(0, 0);
1501 "problem_type_ : " + this->GetType() +
" not implemented!",
1502 "OptProblemContainer::SetType");
1512 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1513 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1514 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1515 template<
int,
int>
class DH>
1516 template<
typename DATACONTAINER>
1519 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementFunctional(
1520 const DATACONTAINER& edc)
1523 if (this->GetType() ==
"cost_functional")
1526 return GetFunctional()->ElementValue(edc);
1528 else if (this->GetType() ==
"aux_functional")
1531 return aux_functionals_[this->GetTypeNum()]->ElementValue(edc);
1533 else if (this->GetType() ==
"functional_for_ee")
1535 return aux_functionals_[functional_for_ee_num_]->ElementValue(edc);
1537 else if (this->GetType().find(
"constraints") != std::string::npos)
1539 return GetConstraints()->ElementValue(edc);
1544 "OptProblemContainer::ElementFunctional");
1549 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1550 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1551 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1552 template<
int,
int>
class DH>
1555 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::PointFunctional(
1556 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
1557 const std::map<std::string, const VECTOR*> &domain_values)
1559 if (this->GetType() ==
"cost_functional")
1562 return GetFunctional()->PointValue(
1563 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
1564 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
1568 else if (this->GetType() ==
"aux_functional")
1571 return aux_functionals_[this->GetTypeNum()]->PointValue(
1572 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
1573 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
1577 else if (this->GetType() ==
"functional_for_ee")
1580 return aux_functionals_[functional_for_ee_num_]->PointValue(
1581 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
1582 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
1585 else if (this->GetType().find(
"constraints") != std::string::npos)
1587 return GetConstraints()->PointValue(
1588 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
1589 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
1596 "OptProblemContainer::PointFunctional");
1602 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1603 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1604 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1605 template<
int,
int>
class DH>
1606 template<
typename FACEDATACONTAINER>
1609 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::BoundaryFunctional(
1610 const FACEDATACONTAINER& fdc)
1612 if (this->GetType() ==
"cost_functional")
1615 return GetFunctional()->BoundaryValue(fdc);
1617 else if (this->GetType() ==
"aux_functional")
1620 return aux_functionals_[this->GetTypeNum()]->BoundaryValue(fdc);
1622 else if (this->GetType() ==
"functional_for_ee")
1625 return aux_functionals_[functional_for_ee_num_]->BoundaryValue(fdc);
1627 else if (this->GetType().find(
"constraints") != std::string::npos)
1629 return GetConstraints()->BoundaryValue(fdc);
1634 "OptProblemContainer::BoundaryFunctional");
1640 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1641 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1642 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1643 template<
int,
int>
class DH>
1644 template<
typename FACEDATACONTAINER>
1647 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::FaceFunctional(
1648 const FACEDATACONTAINER& fdc)
1650 if (this->GetType() ==
"cost_functional")
1653 return GetFunctional()->FaceValue(fdc);
1655 else if (this->GetType() ==
"aux_functional")
1658 return aux_functionals_[this->GetTypeNum()]->FaceValue(fdc);
1660 else if (this->GetType() ==
"functional_for_ee")
1663 return aux_functionals_[functional_for_ee_num_]->FaceValue(fdc);
1668 "OptProblemContainer::FaceFunctional");
1674 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1675 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1676 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1677 template<
int,
int>
class DH>
1680 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::AlgebraicFunctional(
1681 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
1682 const std::map<std::string, const VECTOR*> &domain_values)
1684 if (this->GetType() ==
"cost_functional")
1687 return GetFunctional()->AlgebraicValue(param_values, domain_values);
1689 else if (this->GetType() ==
"aux_functional")
1692 return aux_functionals_[this->GetTypeNum()]->AlgebraicValue(
1693 param_values, domain_values);
1695 else if (this->GetType() ==
"functional_for_ee")
1698 return aux_functionals_[functional_for_ee_num_]->AlgebraicValue(
1699 param_values, domain_values);
1704 "OptProblemContainer::AlgebraicFunctional");
1710 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1711 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1712 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1713 template<
int,
int>
class DH>
1714 template<
typename DATACONTAINER>
1717 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementEquation(
1718 const DATACONTAINER& edc, dealii::Vector<double> &local_vector,
1719 double scale,
double scale_ico)
1722 if (this->GetType() ==
"state")
1725 this->GetPDE().
ElementEquation(edc, local_vector, scale*interval_length_, scale_ico*interval_length_);
1727 else if ((this->GetType() ==
"adjoint")
1728 || (this->GetType() ==
"adjoint_for_ee"))
1731 this->GetPDE().ElementEquation_U(edc, local_vector, scale*interval_length_,
1732 scale_ico*interval_length_);
1734 else if (this->GetType() ==
"adjoint_hessian")
1737 this->GetPDE().ElementEquation_UTT(edc, local_vector, scale*interval_length_,
1738 scale_ico*interval_length_);
1740 else if (this->GetType() ==
"tangent")
1743 this->GetPDE().ElementEquation_UT(edc, local_vector, scale*interval_length_,
1744 scale_ico*interval_length_);
1746 else if ((this->GetType() ==
"gradient")
1747 || (this->GetType() ==
"hessian"))
1750 this->GetPDE().ControlElementEquation(edc, local_vector, scale*c_interval_length_);
1755 "OptProblemContainer::ElementEquation");
1761 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1762 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1763 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1764 template<
int,
int>
class DH>
1767 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::AlgebraicResidual(
1769 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
1770 const std::map<std::string, const VECTOR*> &domain_values)
1772 if (this->GetType() ==
"gradient")
1775 return GetFunctional()->AlgebraicGradient_Q(residual, param_values,
1781 "OptProblemContainer::AlgebraicFunctional");
1787 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1788 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1789 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1790 template<
int,
int>
class DH>
1791 template<
typename DATACONTAINER>
1794 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementTimeEquation(
1795 const DATACONTAINER& edc, dealii::Vector<double> &local_vector,
1799 if (this->GetType() ==
"state")
1803 else if (this->GetType() ==
"adjoint"
1804 || this->GetType() ==
"adjoint_for_ee")
1806 this->GetPDE().ElementTimeEquation_U(edc, local_vector, scale);
1808 else if (this->GetType() ==
"adjoint_hessian")
1810 this->GetPDE().ElementTimeEquation_UTT(edc, local_vector, scale);
1812 else if (this->GetType() ==
"tangent")
1814 this->GetPDE().ElementTimeEquation_UT(edc, local_vector, scale);
1816 else if ((this->GetType() ==
"gradient")
1817 || (this->GetType() ==
"hessian"))
1820 "OptProblemContainer::ElementTimeEquation");
1825 "OptProblemContainer::ElementTimeEquation");
1831 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1832 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1833 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1834 template<
int,
int>
class DH>
1835 template<
typename DATACONTAINER>
1838 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementTimeEquationExplicit(
1839 const DATACONTAINER& edc, dealii::Vector<double> &local_vector,
1843 if (this->GetType() ==
"state")
1848 else if (this->GetType() ==
"adjoint"
1849 || this->GetType() ==
"adjoint_for_ee")
1851 this->GetPDE().ElementTimeEquationExplicit_U(edc, local_vector,
1854 else if (this->GetType() ==
"adjoint_hessian")
1856 this->GetPDE().ElementTimeEquationExplicit_UTT(edc, local_vector,
1859 else if (this->GetType() ==
"tangent")
1861 this->GetPDE().ElementTimeEquationExplicit_UT(edc, local_vector,
1864 else if ((this->GetType() ==
"gradient")
1865 || (this->GetType() ==
"hessian"))
1868 "OptProblemContainer::ElementTimeEquationExplicit");
1873 "OptProblemContainer::ElementTimeEquationExplicit");
1879 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1880 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1881 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1882 template<
int,
int>
class DH>
1883 template<
typename FACEDATACONTAINER>
1886 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::FaceEquation(
1887 const FACEDATACONTAINER& fdc,
1888 dealii::Vector<double> &local_vector,
double scale,
1891 if (this->GetType() ==
"state")
1894 this->GetPDE().
FaceEquation(fdc, local_vector, scale*interval_length_, scale_ico*interval_length_);
1896 else if (this->GetType() ==
"adjoint"
1897 || this->GetType() ==
"adjoint_for_ee")
1900 this->GetPDE().FaceEquation_U(fdc, local_vector, scale*interval_length_,
1901 scale_ico*interval_length_);
1903 else if (this->GetType() ==
"adjoint_hessian")
1906 this->GetPDE().FaceEquation_UTT(fdc, local_vector, scale*interval_length_,
1907 scale_ico*interval_length_);
1909 else if (this->GetType() ==
"tangent")
1912 this->GetPDE().FaceEquation_UT(fdc, local_vector, scale*interval_length_,
1913 scale_ico*interval_length_);
1923 "OptProblemContainer::FaceEquation");
1929 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1930 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1931 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1932 template<
int,
int>
class DH>
1933 template<
typename FACEDATACONTAINER>
1936 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::InterfaceEquation(
1937 const FACEDATACONTAINER& fdc,
1938 dealii::Vector<double> &local_vector,
double scale,
1941 if (this->GetType() ==
"state")
1944 scale_ico*interval_length_);
1946 else if (this->GetType() ==
"adjoint"
1947 || this->GetType() ==
"adjoint_for_ee")
1950 this->GetPDE().InterfaceEquation_U(fdc, local_vector, scale*interval_length_,
1951 scale_ico*interval_length_);
1956 "OptProblemContainer::InterfaceEquation");
1961 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
1962 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
1963 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
1964 template<
int,
int>
class DH>
1965 template<
typename FACEDATACONTAINER>
1968 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::BoundaryEquation(
1969 const FACEDATACONTAINER& fdc,
1970 dealii::Vector<double> &local_vector,
double scale,
1973 if (this->GetType() ==
"state")
1977 scale_ico*interval_length_);
1979 else if (this->GetType() ==
"adjoint"
1980 || this->GetType() ==
"adjoint_for_ee")
1983 this->GetPDE().BoundaryEquation_U(fdc, local_vector, scale*interval_length_,
1984 scale_ico*interval_length_);
1986 else if (this->GetType() ==
"adjoint_hessian")
1989 this->GetPDE().BoundaryEquation_UTT(fdc, local_vector, scale*interval_length_,
1990 scale_ico*interval_length_);
1992 else if (this->GetType() ==
"tangent")
1995 this->GetPDE().BoundaryEquation_UT(fdc, local_vector, scale*interval_length_,
1996 scale_ico*interval_length_);
2006 "OptProblemContainer::ElementBoundaryEquation");
2012 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2013 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2014 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2015 template<
int,
int>
class DH>
2016 template<
typename DATACONTAINER>
2019 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementRhs(
2020 const DATACONTAINER& edc, dealii::Vector<double> &local_vector,
2023 if (this->GetType() ==
"state")
2026 this->GetPDE().ElementRightHandSide(edc, local_vector, scale*interval_length_);
2028 else if (this->GetType() ==
"adjoint")
2031 if(GetFunctional()->NeedTime())
2033 if (GetFunctional()->GetType().find(
"domain") != std::string::npos)
2035 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2037 GetFunctional()->ElementValue_U(edc, local_vector, scale*interval_length_);
2041 GetFunctional()->ElementValue_U(edc, local_vector, scale);
2044 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2046 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2047 "OptProblemContainer::ElementRhs");
2052 else if (this->GetType() ==
"adjoint_for_ee")
2055 if (aux_functionals_[functional_for_ee_num_]->NeedTime())
2057 if (aux_functionals_[functional_for_ee_num_]->GetType().find(
"domain") != std::string::npos)
2059 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos)
2061 aux_functionals_[functional_for_ee_num_]->ElementValue_U(edc,
2062 local_vector, scale*interval_length_);
2066 aux_functionals_[functional_for_ee_num_]->ElementValue_U(edc, local_vector, scale);
2068 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos && aux_functionals_[functional_for_ee_num_]->GetType().find(
"timelocal") != std::string::npos)
2070 throw DOpEException(
"Conflicting functional types: "+ aux_functionals_[functional_for_ee_num_]->GetType(),
2071 "OptProblemContainer::ElementRhs");
2076 else if (this->GetType() ==
"tangent")
2080 this->GetPDE().ElementEquation_QT(edc, local_vector, scale*interval_length_, scale*interval_length_);
2082 else if (this->GetType() ==
"adjoint_hessian")
2085 if(GetFunctional()->NeedTime())
2087 if (GetFunctional()->GetType().find(
"domain") != std::string::npos)
2089 if (GetFunctional()->GetType().find(
"domain") != std::string::npos)
2091 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2093 GetFunctional()->ElementValue_UU(edc, local_vector, scale*interval_length_);
2094 GetFunctional()->ElementValue_QU(edc, local_vector, scale*interval_length_);
2098 GetFunctional()->ElementValue_UU(edc, local_vector, scale);
2099 GetFunctional()->ElementValue_QU(edc, local_vector, scale);
2101 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2103 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2104 "OptProblemContainer::ElementRhs");
2110 this->GetPDE().ElementEquation_UU(edc, local_vector, scale*interval_length_, scale*interval_length_);
2111 this->GetPDE().ElementEquation_QU(edc, local_vector, scale*interval_length_, scale*interval_length_);
2113 this->GetPDE().ElementTimeEquationExplicit_UU(edc, local_vector,
2116 else if (this->GetType() ==
"gradient")
2118 if (GetSpaceTimeHandler()->GetControlType()
2121 this->GetPDE().Init_ElementRhs_Q(edc, local_vector, scale);
2124 if(GetFunctional()->NeedTime())
2126 if (GetFunctional()->GetType().find(
"domain") != std::string::npos)
2128 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2130 GetFunctional()->ElementValue_Q(edc, local_vector, scale*interval_length_);
2134 GetFunctional()->ElementValue_Q(edc, local_vector, scale);
2136 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2138 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2139 "OptProblemContainer::ElementRhs");
2144 this->GetPDE().ElementEquation_Q(edc, local_vector, scale*interval_length_, scale*interval_length_);
2146 else if (this->GetType() ==
"hessian")
2148 if (GetSpaceTimeHandler()->GetControlType()
2151 this->GetPDE().Init_ElementRhs_QTT(edc, local_vector, scale);
2152 this->GetPDE().Init_ElementRhs_QQ(edc, local_vector, scale);
2154 if(GetFunctional()->NeedTime())
2156 if (GetFunctional()->GetType().find(
"domain") != std::string::npos)
2158 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2160 GetFunctional()->ElementValue_QQ(edc, local_vector, scale*interval_length_);
2161 GetFunctional()->ElementValue_UQ(edc, local_vector, scale*interval_length_);
2165 GetFunctional()->ElementValue_QQ(edc, local_vector, scale);
2166 GetFunctional()->ElementValue_UQ(edc, local_vector, scale);
2168 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2170 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2171 "OptProblemContainer::ElementRhs");
2177 this->GetPDE().ElementEquation_QTT(edc, local_vector, scale*interval_length_, scale*interval_length_);
2178 this->GetPDE().ElementEquation_UQ(edc, local_vector, scale*interval_length_, scale*interval_length_);
2179 this->GetPDE().ElementEquation_QQ(edc, local_vector, scale*interval_length_, scale*interval_length_);
2181 else if (this->GetType() ==
"global_constraint_gradient")
2183 assert(interval_length_==1.);
2184 GetConstraints()->ElementValue_Q(edc, local_vector, scale);
2186 else if (this->GetType() ==
"global_constraint_hessian")
2188 assert(interval_length_==1.);
2189 GetConstraints()->ElementValue_QQ(edc, local_vector, scale);
2194 "OptProblemContainer::ElementRhs");
2201 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2202 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2203 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2204 template<
int,
int>
class DH>
2207 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::PointRhs(
2208 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
2209 const std::map<std::string, const VECTOR*> &domain_values,
2210 VECTOR& rhs_vector,
double scale)
2213 if (this->GetType() ==
"adjoint")
2216 if(GetFunctional()->NeedTime())
2218 if (GetFunctional()->GetType().find(
"point") != std::string::npos)
2220 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2222 GetFunctional()->PointValue_U(
2223 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2224 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2225 domain_values, rhs_vector, scale*interval_length_);
2229 GetFunctional()->PointValue_U(
2230 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2231 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2232 domain_values, rhs_vector, scale);
2234 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2236 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2237 "OptProblemContainer::PointRhs");
2242 else if (this->GetType() ==
"adjoint_for_ee")
2245 if (aux_functionals_[functional_for_ee_num_]->NeedTime())
2247 if (aux_functionals_[functional_for_ee_num_]->GetType().find(
"point") != std::string::npos)
2249 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos)
2251 aux_functionals_[functional_for_ee_num_]->PointValue_U(
2252 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2253 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2254 domain_values, rhs_vector, scale*interval_length_);
2258 aux_functionals_[functional_for_ee_num_]->PointValue_U(
2259 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2260 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2261 domain_values, rhs_vector, scale);
2263 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos && aux_functionals_[functional_for_ee_num_]->GetType().find(
"timelocal") != std::string::npos)
2265 throw DOpEException(
"Conflicting functional types: "+ aux_functionals_[functional_for_ee_num_]->GetType(),
2266 "OptProblemContainer::PointRhs");
2271 else if (this->GetType() ==
"adjoint_hessian")
2274 if(GetFunctional()->NeedTime())
2276 if (GetFunctional()->GetType().find(
"point") != std::string::npos)
2278 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2280 GetFunctional()->PointValue_UU(
2281 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2282 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2283 domain_values, rhs_vector, scale*interval_length_);
2284 GetFunctional()->PointValue_QU(
2285 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2286 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2287 domain_values, rhs_vector, scale*interval_length_);
2291 GetFunctional()->PointValue_UU(
2292 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2293 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2294 domain_values, rhs_vector, scale);
2295 GetFunctional()->PointValue_QU(
2296 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2297 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2298 domain_values, rhs_vector, scale);
2300 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2302 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2303 "OptProblemContainer::PointRhs");
2308 else if (this->GetType() ==
"gradient")
2311 if(GetFunctional()->NeedTime())
2313 if (GetFunctional()->GetType().find(
"point") != std::string::npos)
2315 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2317 GetFunctional()->PointValue_Q(
2318 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2319 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2320 domain_values, rhs_vector, scale*interval_length_);
2324 GetFunctional()->PointValue_Q(
2325 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2326 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2327 domain_values, rhs_vector, scale);
2329 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2331 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2332 "OptProblemContainer::PointRhs");
2337 else if (this->GetType() ==
"hessian")
2340 if(GetFunctional()->NeedTime())
2342 if (GetFunctional()->GetType().find(
"point") != std::string::npos)
2344 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2346 GetFunctional()->PointValue_QQ(
2347 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2348 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2349 domain_values, rhs_vector, scale*interval_length_);
2350 GetFunctional()->PointValue_UQ(
2351 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2352 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2353 domain_values, rhs_vector, scale*interval_length_);
2357 GetFunctional()->PointValue_QQ(
2358 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2359 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2360 domain_values, rhs_vector, scale);
2361 GetFunctional()->PointValue_UQ(
2362 this->GetSpaceTimeHandler()->GetControlDoFHandler(),
2363 this->GetSpaceTimeHandler()->GetStateDoFHandler(), param_values,
2364 domain_values, rhs_vector, scale);
2366 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2368 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2369 "OptProblemContainer::PointRhs");
2376 throw DOpEException(
"Not implemented",
"OptProblem::PointRhs");
2383 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2384 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2385 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2386 template<
int,
int>
class DH>
2387 template<
typename FACEDATACONTAINER>
2390 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::FaceRhs(
2391 const FACEDATACONTAINER& fdc,
2392 dealii::Vector<double> &local_vector,
double scale)
2395 if (this->GetType() ==
"state")
2398 this->GetPDE().FaceRightHandSide(fdc, local_vector, scale*interval_length_);
2400 else if (this->GetType() ==
"adjoint")
2403 if(GetFunctional()->NeedTime())
2405 if (GetFunctional()->GetType().find(
"face") != std::string::npos)
2407 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2409 GetFunctional()->FaceValue_U(fdc, local_vector, scale*interval_length_);
2413 GetFunctional()->FaceValue_U(fdc, local_vector, scale);
2416 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2418 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2419 "OptProblemContainer::FaceRhs");
2424 else if (this->GetType() ==
"adjoint_for_ee")
2427 if (aux_functionals_[functional_for_ee_num_]->NeedTime())
2429 if (aux_functionals_[functional_for_ee_num_]->GetType().find(
"face")
2430 != std::string::npos)
2432 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos)
2434 aux_functionals_[functional_for_ee_num_]->FaceValue_U(fdc,
2435 local_vector, scale*interval_length_);
2439 aux_functionals_[functional_for_ee_num_]->FaceValue_U(fdc,
2440 local_vector, scale);
2442 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos && aux_functionals_[functional_for_ee_num_]->GetType().find(
"timelocal") != std::string::npos)
2444 throw DOpEException(
"Conflicting functional types: "+ aux_functionals_[functional_for_ee_num_]->GetType(),
2445 "OptProblemContainer::FaceRhs");
2451 else if (this->GetType() ==
"tangent")
2455 this->GetPDE().FaceEquation_QT(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2457 else if (this->GetType() ==
"adjoint_hessian")
2460 if(GetFunctional()->NeedTime())
2462 if (GetFunctional()->GetType().find(
"face") != std::string::npos)
2464 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2466 GetFunctional()->FaceValue_UU(fdc, local_vector, scale*interval_length_);
2467 GetFunctional()->FaceValue_QU(fdc, local_vector, scale*interval_length_);
2471 GetFunctional()->FaceValue_UU(fdc, local_vector, scale);
2472 GetFunctional()->FaceValue_QU(fdc, local_vector, scale);
2474 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2476 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2477 "OptProblemContainer::FaceRhs");
2483 this->GetPDE().FaceEquation_UU(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2484 this->GetPDE().FaceEquation_QU(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2486 else if (this->GetType() ==
"gradient")
2489 if(GetFunctional()->NeedTime())
2491 if (GetFunctional()->GetType().find(
"face") != std::string::npos)
2493 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2495 GetFunctional()->FaceValue_Q(fdc, local_vector, scale*interval_length_);
2499 GetFunctional()->FaceValue_Q(fdc, local_vector, scale);
2501 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2503 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2504 "OptProblemContainer::FaceRhs");
2510 this->GetPDE().FaceEquation_Q(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2512 else if (this->GetType() ==
"hessian")
2515 if(GetFunctional()->NeedTime())
2517 if (GetFunctional()->GetType().find(
"face") != std::string::npos)
2519 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2521 GetFunctional()->FaceValue_QQ(fdc, local_vector, scale*interval_length_);
2522 GetFunctional()->FaceValue_UQ(fdc, local_vector, scale*interval_length_);
2526 GetFunctional()->FaceValue_QQ(fdc, local_vector, scale);
2527 GetFunctional()->FaceValue_UQ(fdc, local_vector, scale);
2529 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2531 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2532 "OptProblemContainer::FaceRhs");
2538 this->GetPDE().FaceEquation_QTT(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2539 this->GetPDE().FaceEquation_UQ(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2540 this->GetPDE().FaceEquation_QQ(fdc, local_vector, scale*interval_length_, scale*interval_length_);
2545 "OptProblemContainer::FaceRhs");
2552 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2553 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2554 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2555 template<
int,
int>
class DH>
2556 template<
typename FACEDATACONTAINER>
2559 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::BoundaryRhs(
2560 const FACEDATACONTAINER& fdc,
2561 dealii::Vector<double> &local_vector,
double scale)
2564 if (this->GetType() ==
"state")
2567 this->GetPDE().BoundaryRightHandSide(fdc, local_vector, scale*interval_length_);
2569 else if (this->GetType() ==
"adjoint")
2572 if(GetFunctional()->NeedTime())
2574 if (GetFunctional()->GetType().find(
"boundary") != std::string::npos)
2576 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2578 GetFunctional()->BoundaryValue_U(fdc, local_vector, scale*interval_length_);
2582 GetFunctional()->BoundaryValue_U(fdc, local_vector, scale);
2584 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2586 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2587 "OptProblemContainer::BoundaryRhs");
2592 else if (this->GetType() ==
"adjoint_for_ee")
2595 if (aux_functionals_[functional_for_ee_num_]->NeedTime())
2597 if (aux_functionals_[functional_for_ee_num_]->GetType().find(
2598 "boundary") != std::string::npos)
2600 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos)
2602 aux_functionals_[functional_for_ee_num_]->BoundaryValue_U(fdc,
2603 local_vector, scale*interval_length_);
2607 aux_functionals_[functional_for_ee_num_]->BoundaryValue_U(fdc,
2608 local_vector, scale);
2610 if(aux_functionals_[functional_for_ee_num_]->GetType().find(
"timedistributed") != std::string::npos && aux_functionals_[functional_for_ee_num_]->GetType().find(
"timelocal") != std::string::npos)
2612 throw DOpEException(
"Conflicting functional types: "+ aux_functionals_[functional_for_ee_num_]->GetType(),
2613 "OptProblemContainer::BoundaryRhs");
2618 else if (this->GetType() ==
"tangent")
2622 this->GetPDE().BoundaryEquation_QT(fdc, local_vector, scale*interval_length_,
2623 scale*interval_length_);
2625 else if (this->GetType() ==
"adjoint_hessian")
2628 if(GetFunctional()->NeedTime())
2630 if (GetFunctional()->GetType().find(
"boundary") != std::string::npos)
2632 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2634 GetFunctional()->BoundaryValue_UU(fdc, local_vector, scale*interval_length_);
2635 GetFunctional()->BoundaryValue_QU(fdc, local_vector, scale*interval_length_);
2639 GetFunctional()->BoundaryValue_UU(fdc, local_vector, scale);
2640 GetFunctional()->BoundaryValue_QU(fdc, local_vector, scale);
2642 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2644 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2645 "OptProblemContainer::BoundaryRhs");
2651 this->GetPDE().BoundaryEquation_UU(fdc, local_vector, scale*interval_length_,
2652 scale*interval_length_);
2653 this->GetPDE().BoundaryEquation_QU(fdc, local_vector, scale*interval_length_,
2654 scale*interval_length_);
2656 else if (this->GetType() ==
"gradient")
2659 if(GetFunctional()->NeedTime())
2661 if (GetFunctional()->GetType().find(
"boundary") != std::string::npos)
2663 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2665 GetFunctional()->BoundaryValue_Q(fdc, local_vector, scale*interval_length_);
2669 GetFunctional()->BoundaryValue_Q(fdc, local_vector, scale);
2671 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2673 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2674 "OptProblemContainer::BoundaryRhs");
2680 this->GetPDE().BoundaryEquation_Q(fdc, local_vector, scale*interval_length_,
2681 scale*interval_length_);
2683 else if (this->GetType() ==
"hessian")
2686 if(GetFunctional()->NeedTime())
2688 if (GetFunctional()->GetType().find(
"boundary") != std::string::npos)
2690 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos)
2692 GetFunctional()->BoundaryValue_QQ(fdc, local_vector, scale*interval_length_);
2693 GetFunctional()->BoundaryValue_UQ(fdc, local_vector, scale*interval_length_);
2697 GetFunctional()->BoundaryValue_QQ(fdc, local_vector, scale);
2698 GetFunctional()->BoundaryValue_UQ(fdc, local_vector, scale);
2700 if(GetFunctional()->GetType().find(
"timedistributed") != std::string::npos && GetFunctional()->GetType().find(
"timelocal") != std::string::npos)
2702 throw DOpEException(
"Conflicting functional types: "+ GetFunctional()->GetType(),
2703 "OptProblemContainer::BoundaryRhs");
2709 this->GetPDE().BoundaryEquation_QTT(fdc, local_vector, scale*interval_length_,
2710 scale*interval_length_);
2711 this->GetPDE().BoundaryEquation_UQ(fdc, local_vector, scale*interval_length_,
2712 scale*interval_length_);
2713 this->GetPDE().BoundaryEquation_QQ(fdc, local_vector, scale*interval_length_,
2714 scale*interval_length_);
2719 "OptProblemContainer::BoundaryRhs");
2726 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2727 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2728 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2729 template<
int,
int>
class DH>
2730 template<
typename DATACONTAINER>
2733 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementMatrix(
2734 const DATACONTAINER& edc,
2735 dealii::FullMatrix<double> &local_entry_matrix,
double scale,
2739 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
2742 this->GetPDE().
ElementMatrix(edc, local_entry_matrix, scale*interval_length_, scale_ico*interval_length_);
2744 else if (this->GetType() ==
"adjoint"
2745 || this->GetType() ==
"adjoint_for_ee"
2746 || this->GetType() ==
"adjoint_hessian")
2749 this->GetPDE().ElementMatrix_T(edc, local_entry_matrix, scale*interval_length_,
2750 scale_ico*interval_length_);
2752 else if ((this->GetType() ==
"gradient")
2753 || (this->GetType() ==
"hessian"))
2756 this->GetPDE().ControlElementMatrix(edc, local_entry_matrix, scale*c_interval_length_);
2761 "OptProblemContainer::ElementMatrix");
2768 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2769 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2770 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2771 template<
int,
int>
class DH>
2772 template<
typename DATACONTAINER>
2775 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementTimeMatrix(
2776 const DATACONTAINER& edc, FullMatrix<double> &local_entry_matrix)
2779 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
2784 else if (this->GetType() ==
"adjoint"
2785 || this->GetType() ==
"adjoint_for_ee"
2786 || this->GetType() ==
"adjoint_hessian")
2788 this->GetPDE().ElementTimeMatrix_T(edc, local_entry_matrix);
2790 else if ((this->GetType() ==
"gradient")
2791 || (this->GetType() ==
"hessian"))
2794 "OptProblemContainer::ElementTimeMatrix");
2799 "OptProblemContainer::ElementTimeMatrix");
2806 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2807 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2808 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2809 template<
int,
int>
class DH>
2810 template<
typename DATACONTAINER>
2813 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ElementTimeMatrixExplicit(
2814 const DATACONTAINER& edc,
2815 dealii::FullMatrix<double> &local_entry_matrix)
2818 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
2822 else if (this->GetType() ==
"adjoint"
2823 || this->GetType() ==
"adjoint_hessian")
2825 this->GetPDE().ElementTimeMatrixExplicit_T(edc, local_entry_matrix);
2827 else if ((this->GetType() ==
"gradient")
2828 || (this->GetType() ==
"hessian"))
2831 "OptProblemContainer::ElementTimeMatrixExplicit");
2836 "OptProblemContainer::ElementTimeMatrixExplicit");
2843 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2844 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2845 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2846 template<
int,
int>
class DH>
2847 template<
typename FACEDATACONTAINER>
2850 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::FaceMatrix(
2851 const FACEDATACONTAINER& fdc, FullMatrix<double> &local_entry_matrix,
2852 double scale,
double scale_ico)
2854 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
2857 this->GetPDE().
FaceMatrix(fdc, local_entry_matrix, scale*interval_length_, scale_ico*interval_length_);
2859 else if (this->GetType() ==
"adjoint"
2860 || this->GetType() ==
"adjoint_for_ee"
2861 || this->GetType() ==
"adjoint_hessian")
2864 this->GetPDE().FaceMatrix_T(fdc, local_entry_matrix, scale*interval_length_,
2865 scale_ico*interval_length_);
2875 "OptProblemContainer::NewtonFaceMatrix");
2882 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2883 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2884 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2885 template<
int,
int>
class DH>
2886 template<
typename FACEDATACONTAINER>
2889 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::InterfaceMatrix(
2890 const FACEDATACONTAINER& fdc, FullMatrix<double> &local_entry_matrix,
2891 double scale,
double scale_ico)
2893 if (this->GetType() ==
"state")
2895 this->GetPDE().
InterfaceMatrix(fdc, local_entry_matrix, scale*interval_length_,
2896 scale_ico*interval_length_);
2898 else if (this->GetType() ==
"adjoint"
2899 || this->GetType() ==
"adjoint_for_ee"
2900 || this->GetType() ==
"adjoint_hessian")
2902 this->GetPDE().InterfaceMatrix_T(fdc, local_entry_matrix, scale*interval_length_,
2903 scale_ico*interval_length_);
2908 "OptProblemContainer::NewtonInterfaceMatrix");
2914 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2915 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2916 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2917 template<
int,
int>
class DH>
2918 template<
typename FACEDATACONTAINER>
2921 CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::BoundaryMatrix(
2922 const FACEDATACONTAINER& fdc, FullMatrix<double> &local_matrix,
2923 double scale,
double scale_ico)
2925 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
2928 this->GetPDE().
BoundaryMatrix(fdc, local_matrix, scale*interval_length_,
2929 scale_ico*interval_length_);
2931 else if (this->GetType() ==
"adjoint"
2932 || this->GetType() ==
"adjoint_for_ee"
2933 || this->GetType() ==
"adjoint_hessian")
2936 this->GetPDE().BoundaryMatrix_T(fdc, local_matrix, scale*interval_length_,
2937 scale_ico*interval_length_);
2947 "OptProblemContainer::ElementBoundaryMatrix");
2952 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2953 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2954 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2955 template<
int,
int>
class DH>
2958 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ComputeLocalControlConstraints(
2959 VECTOR& constraints,
2960 const std::map<std::string,
const dealii::Vector<double>*> &,
2961 const std::map<std::string, const VECTOR*> &block_values)
2963 if (this->GetType() ==
"constraints")
2965 if (this->GetSpaceTimeHandler()->GetNLocalConstraints() != 0)
2967 const VECTOR& control = *GetBlockVector(block_values,
"control");
2968 this->GetConstraints()->EvaluateLocalControlConstraints(control,
2975 "OptProblemContainer::ComputeLocalConstraints");
2981 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
2982 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
2983 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
2984 template<
int,
int>
class DH>
2987 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDoFType()
const
2989 if (this->GetType() ==
"state" || this->GetType() ==
"adjoint"
2990 || this->GetType() ==
"adjoint_for_ee" || this->GetType() ==
"tangent"
2991 || this->GetType() ==
"adjoint_hessian")
2995 else if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian")
2996 || (this->GetType() ==
"hessian_inverse"))
3003 "OptProblemContainer::GetDoFType");
3009 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3010 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3011 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3012 template<
int,
int>
class DH>
3013 const FE<dealdim, dealdim>&
3015 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFESystem()
const
3017 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
3018 || this->GetType() ==
"adjoint_for_ee" || this->GetType() ==
"tangent"
3019 || this->GetType() ==
"adjoint_hessian")
3021 return this->GetSpaceTimeHandler()->
GetFESystem(
"state");
3023 else if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian")
3024 || (this->GetType() ==
"global_constraint_gradient"))
3026 #if dope_dimension > 0
3027 if(dopedim == dealdim)
3028 return this->GetSpaceTimeHandler()->GetFESystem(
"control");
3030 throw DOpEException(
"Non matching dimensions!",
"OptProblemContainer::GetFESystem");
3032 return this->GetSpaceTimeHandler()->GetFESystem(
"state");
3038 "OptProblemContainer::GetFESystem");
3044 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3045 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3046 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3047 template<
int,
int>
class DH>
3050 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetUpdateFlags()
const
3054 if (this->GetType().find(
"aux_functional") != std::string::npos)
3058 else if (this->GetType().find(
"functional") != std::string::npos)
3060 r = this->GetFunctional()->GetUpdateFlags();
3062 else if (this->GetType().find(
"constraints") != std::string::npos)
3064 r = this->GetConstraints()->GetUpdateFlags();
3066 else if (this->GetType() ==
"functional_for_ee")
3068 r = aux_functionals_[functional_for_ee_num_]->GetUpdateFlags();
3072 r = this->GetPDE().GetUpdateFlags();
3073 if (this->GetType() ==
"adjoint_hessian" || this->GetType() ==
"adjoint"
3074 || (this->GetType() ==
"hessian")
3075 || (this->GetType() ==
"gradient"))
3077 r = r | this->GetFunctional()->GetUpdateFlags();
3079 else if (this->GetType() ==
"adjoint_for_ee")
3081 r = r | aux_functionals_[functional_for_ee_num_]->GetUpdateFlags();
3084 return r | update_JxW_values;
3089 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3090 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3091 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3092 template<
int,
int>
class DH>
3095 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFaceUpdateFlags()
const
3098 if (this->GetType().find(
"aux_functional") != std::string::npos)
3102 else if (this->GetType().find(
"functional") != std::string::npos)
3104 r = this->GetFunctional()->GetFaceUpdateFlags();
3106 else if (this->GetType().find(
"constraints") != std::string::npos)
3108 r = this->GetConstraints()->GetFaceUpdateFlags();
3110 else if (this->GetType() ==
"functional_for_ee")
3112 r = aux_functionals_[functional_for_ee_num_]->GetUpdateFlags();
3116 r = this->GetPDE().GetFaceUpdateFlags();
3117 if (this->GetType() ==
"adjoint_hessian" || this->GetType() ==
"adjoint"
3118 || (this->GetType() ==
"hessian"))
3120 r = r | this->GetFunctional()->GetFaceUpdateFlags();
3122 else if (this->GetType() ==
"adjoint_for_ee")
3125 | aux_functionals_[functional_for_ee_num_]->GetFaceUpdateFlags();
3128 return r | update_JxW_values;
3133 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3134 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3135 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3136 template<
int,
int>
class DH>
3139 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFunctionalType()
const
3141 if (this->GetType() ==
"aux_functional")
3143 return aux_functionals_[this->GetTypeNum()]->
GetType();
3145 else if (this->GetType() ==
"functional_for_ee")
3147 return aux_functionals_[functional_for_ee_num_]->GetType();
3149 return GetFunctional()->GetType();
3154 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3155 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3156 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3157 template<
int,
int>
class DH>
3160 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFunctionalName()
const
3162 if (this->GetType() ==
"aux_functional")
3164 return aux_functionals_[this->GetTypeNum()]->
GetName();
3166 else if (this->GetType() ==
"functional_for_ee")
3168 return aux_functionals_[functional_for_ee_num_]->GetName();
3170 return GetFunctional()->GetName();
3175 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3176 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3177 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3178 template<
int,
int>
class DH>
3181 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetConstraintType()
const
3183 return GetConstraints()->
GetType();
3188 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3189 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3190 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3191 template<
int,
int>
class DH>
3194 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetTime(
double time,
3197 GetSpaceTimeHandler()->SetInterval(interval);
3200 interval_length_ = GetSpaceTimeHandler()->GetStepSize();
3204 c_interval_length_ = 1.;
3208 c_interval_length_ = GetSpaceTimeHandler()->GetStepSize();
3212 for (
unsigned int i = 0;
3213 i < transposed_control_gradient_dirichlet_values_.size(); i++)
3214 transposed_control_gradient_dirichlet_values_[i]->SetTime(time);
3215 for (
unsigned int i = 0;
3216 i < transposed_control_hessian_dirichlet_values_.size(); i++)
3217 transposed_control_hessian_dirichlet_values_[i]->SetTime(time);
3218 for (
unsigned int i = 0; i < primal_dirichlet_values_.size(); i++)
3219 primal_dirichlet_values_[i]->SetTime(time);
3220 for (
unsigned int i = 0; i < tangent_dirichlet_values_.size(); i++)
3221 tangent_dirichlet_values_[i]->SetTime(time);
3222 for (
unsigned int i = 0; i < control_dirichlet_values_.size(); i++)
3223 control_dirichlet_values_[i]->SetTime(time);
3225 GetFunctional()->SetTime(time);
3226 for (
unsigned int i = 0; i < aux_functionals_.size(); i++)
3227 aux_functionals_[i]->SetTime(time);
3229 this->GetPDE().SetTime(time);
3233 typename std::map<std::string, const ControlVector<VECTOR> *>::iterator it =
3234 auxiliary_controls_.begin();
3235 for (; it != auxiliary_controls_.end(); it++)
3237 it->second->SetTime(time, interval);
3241 typename std::map<std::string, const StateVector<VECTOR> *>::iterator it =
3242 auxiliary_state_.begin();
3243 for (; it != auxiliary_state_.end(); it++)
3245 it->second->SetTime(time, interval);
3249 typename std::map<std::string, const ConstraintVector<VECTOR> *>::iterator it =
3250 auxiliary_constraints_.begin();
3251 for (; it != auxiliary_constraints_.end(); it++)
3253 it->second->SetTime(time, interval);
3261 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3262 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3263 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3264 template<
int,
int>
class DH>
3267 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::ComputeSparsityPattern(
3268 SPARSITYPATTERN & sparsity)
const
3270 if (this->GetType() ==
"state" || this->GetType() ==
"tangent"
3271 || this->GetType() ==
"adjoint_for_ee" || this->GetType() ==
"adjoint"
3272 || this->GetType() ==
"adjoint_hessian")
3274 this->GetSpaceTimeHandler()->ComputeStateSparsityPattern(sparsity);
3276 else if ((this->GetType() ==
"gradient")
3277 || (this->GetType() ==
"hessian"))
3279 #if dope_dimension > 0
3280 this->GetSpaceTimeHandler()->ComputeControlSparsityPattern(sparsity);
3283 "OptProblemContainer::ComputeSparsityPattern");
3289 "OptProblemContainer::ComputeSparsityPattern");
3295 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3296 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3297 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3298 template<
int,
int>
class DH>
3301 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::PostProcessConstraints(
3308 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3309 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3310 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3311 template<
int,
int>
class DH>
3314 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::AddAuxiliaryControl(
3317 if (auxiliary_controls_.find(name) != auxiliary_controls_.end())
3320 "Adding multiple Data with name " + name +
" is prohibited!",
3321 "OptProblemContainer::AddAuxiliaryControl");
3323 auxiliary_controls_.insert(
3329 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3330 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3331 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3332 template<
int,
int>
class DH>
3335 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::AddAuxiliaryState(
3338 if (auxiliary_state_.find(name) != auxiliary_state_.end())
3341 "Adding multiple Data with name " + name +
" is prohibited!",
3342 "OptProblemContainer::AddAuxiliaryState");
3344 auxiliary_state_.insert(
3349 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3350 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3351 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3352 template<
int,
int>
class DH>
3355 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::AddAuxiliaryConstraint(
3358 if (auxiliary_constraints_.find(name) != auxiliary_constraints_.end())
3361 "Adding multiple Data with name " + name +
" is prohibited!",
3362 "OptProblemContainer::AddAuxiliaryConstraint");
3364 auxiliary_constraints_.insert(
3369 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3370 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3371 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3372 template<
int,
int>
class DH>
3375 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetAuxiliaryControl(
3376 std::string name)
const
3378 typename std::map<std::string, const ControlVector<VECTOR> *>::const_iterator it =
3379 auxiliary_controls_.find(name);
3380 if (it == auxiliary_controls_.end())
3382 throw DOpEException(
"Could not find Data with name " + name,
3383 "OptProblemContainer::GetAuxiliaryControl");
3390 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3391 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3392 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3393 template<
int,
int>
class DH>
3396 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetAuxiliaryState(
3397 std::string name)
const
3399 typename std::map<std::string, const StateVector<VECTOR> *>::const_iterator it =
3400 auxiliary_state_.find(name);
3401 if (it == auxiliary_state_.end())
3403 throw DOpEException(
"Could not find Data with name " + name,
3404 "OptProblemContainer::GetAuxiliaryState");
3411 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3412 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3413 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3414 template<
int,
int>
class DH>
3417 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::DeleteAuxiliaryControl(
3420 typename std::map<std::string, const ControlVector<VECTOR> *>::iterator it =
3421 auxiliary_controls_.find(name);
3422 if (it == auxiliary_controls_.end())
3425 "Deleting Data " + name +
" is impossible! Data not found",
3426 "OptProblemContainer::DeleteAuxiliaryControl");
3428 auxiliary_controls_.erase(it);
3433 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3434 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3435 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3436 template<
int,
int>
class DH>
3439 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::DeleteAuxiliaryState(
3442 typename std::map<std::string, const StateVector<VECTOR> *>::iterator it =
3443 auxiliary_state_.find(name);
3444 if (it == auxiliary_state_.end())
3447 "Deleting Data " + name +
" is impossible! Data not found",
3448 "OptProblemContainer::DeleteAuxiliaryState");
3450 auxiliary_state_.erase(it);
3455 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3456 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3457 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3458 template<
int,
int>
class DH>
3461 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::DeleteAuxiliaryConstraint(
3464 typename std::map<std::string, const ConstraintVector<VECTOR> *>::iterator it =
3465 auxiliary_constraints_.find(name);
3466 if (it == auxiliary_constraints_.end())
3469 "Deleting Data " + name +
" is impossible! Data not found",
3470 "OptProblemContainer::DeleteAuxiliaryConstraint");
3472 auxiliary_constraints_.erase(it);
3477 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3478 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3479 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3480 template<
int,
int>
class DH>
3483 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFunctional()
3485 if (this->GetType() ==
"aux_functional"
3486 || this->GetType() ==
"functional_for_ee")
3498 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3499 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3500 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3501 template<
int,
int>
class DH>
3504 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetFunctional()
const
3506 if (this->GetType() ==
"aux_functional"
3507 || this->GetType() ==
"functional_for_ee")
3518 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3519 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3520 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3521 template<
int,
int>
class DH>
3524 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::HasFaces()
const
3526 if (this->GetType().find(
"aux_functional") != std::string::npos)
3528 return aux_functionals_[this->GetTypeNum()]->
HasFaces();
3530 else if (this->GetType().find(
"functional") != std::string::npos)
3532 return this->GetFunctional()->HasFaces();
3534 else if (this->GetType().find(
"constraint") != std::string::npos)
3536 return this->GetConstraints()->HasFaces();
3540 if ((this->GetType() ==
"state") || (this->GetType() ==
"tangent")
3541 || (this->GetType() ==
"gradient"))
3543 return this->GetPDE().HasFaces();
3545 else if ((this->GetType() ==
"adjoint")
3546 || (this->GetType() ==
"adjoint_hessian")
3547 || (this->GetType() ==
"hessian"))
3549 return this->GetPDE().HasFaces() || this->GetFunctional()->HasFaces();
3551 else if (this->GetType() ==
"adjoint_for_ee")
3553 return this->GetPDE().HasFaces()
3554 || aux_functionals_[functional_for_ee_num_]->HasFaces();
3558 throw DOpEException(
"Unknown Type: '" + this->GetType() +
"'!",
3559 "OptProblemContainer::HasFaces");
3566 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3567 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3568 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3569 template<
int,
int>
class DH>
3572 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::HasPoints()
const
3574 if (this->GetType().find(
"constraint") != std::string::npos
3575 || (this->GetType() ==
"functional")
3576 || this->GetType() ==
"aux_functional" || (this->GetType() ==
"state")
3577 || (this->GetType() ==
"tangent"))
3582 else if ((this->GetType() ==
"adjoint")
3583 || (this->GetType() ==
"adjoint_hessian")
3584 || (this->GetType() ==
"hessian"))
3586 return this->GetFunctional()->
HasPoints();
3588 else if (this->GetType() ==
"adjoint_for_ee")
3590 return aux_functionals_[functional_for_ee_num_]->HasPoints();
3592 else if (this->GetType() ==
"gradient")
3594 return this->GetFunctional()->HasPoints();
3598 throw DOpEException(
"Unknown Type: '" + this->GetType() +
"'!",
3599 "OptProblem::HasPoints");
3606 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3607 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3608 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3609 template<
int,
int>
class DH>
3612 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::HasInterfaces()
const
3614 if (this->GetType().find(
"aux_functional") != std::string::npos)
3618 else if (this->GetType().find(
"functional") != std::string::npos)
3622 else if (this->GetType().find(
"constraint") != std::string::npos)
3628 if ((this->GetType() ==
"state") || this->GetType() ==
"adjoint_for_ee"
3629 || (this->GetType() ==
"tangent") || (this->GetType() ==
"gradient")
3630 || (this->GetType() ==
"adjoint")
3631 || (this->GetType() ==
"adjoint_hessian")
3632 || (this->GetType() ==
"hessian"))
3638 throw DOpEException(
"Unknown Type: '" + this->GetType() +
"'!",
3639 "OptProblemContainer::HasFaces");
3646 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3647 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3648 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3649 template<
int,
int>
class DH>
3652 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetControlDirichletBoundaryColors(
3653 unsigned int color,
const std::vector<bool>& comp_mask,
3658 unsigned int comp = control_dirichlet_colors_.size();
3659 for (
unsigned int i = 0; i < control_dirichlet_colors_.size(); ++i)
3661 if (control_dirichlet_colors_[i] == color)
3667 if (comp != control_dirichlet_colors_.size())
3669 std::stringstream s;
3670 s <<
"ControlDirichletColor" << color <<
" has multiple occurences !";
3672 "OptProblemContainer::SetControlDirichletBoundary");
3674 control_dirichlet_colors_.push_back(color);
3675 control_dirichlet_comps_.push_back(comp_mask);
3676 control_dirichlet_values_.push_back(values);
3681 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3682 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3683 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3684 template<
int,
int>
class DH>
3687 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetDirichletBoundaryColors(
3688 unsigned int color,
const std::vector<bool>& comp_mask,
3692 assert(values->n_components() == comp_mask.size());
3694 unsigned int comp = dirichlet_colors_.size();
3695 for (
unsigned int i = 0; i < dirichlet_colors_.size(); ++i)
3697 if (dirichlet_colors_[i] == color)
3703 if (comp != dirichlet_colors_.size())
3705 std::stringstream s;
3706 s <<
"DirichletColor" << color <<
" has multiple occurrences !";
3708 "OptProblemContainer::SetDirichletBoundary");
3710 dirichlet_colors_.push_back(color);
3711 dirichlet_comps_.push_back(comp_mask);
3714 primal_dirichlet_values_.push_back(data);
3717 tangent_dirichlet_values_.push_back(tdata);
3719 if (values->NeedsControl())
3721 control_transposed_dirichlet_colors_.push_back(color);
3725 transposed_control_gradient_dirichlet_values_.push_back(gdata);
3729 transposed_control_hessian_dirichlet_values_.push_back(hdata);
3735 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3736 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3737 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3738 template<
int,
int>
class DH>
3739 const std::vector<unsigned int>&
3741 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDirichletColors()
const
3743 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
3744 || this->GetType() ==
"adjoint_for_ee"
3745 || (this->GetType() ==
"tangent")
3746 || (this->GetType() ==
"adjoint_hessian"))
3748 return dirichlet_colors_;
3750 else if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian")
3751 || (this->GetType() ==
"global_constraint_gradient"))
3753 return control_dirichlet_colors_;
3758 "OptProblemContainer::GetDirichletColors");
3763 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3764 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3765 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3766 template<
int,
int>
class DH>
3767 const std::vector<unsigned int>&
3769 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetTransposedDirichletColors()
const
3771 if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian"))
3773 return control_transposed_dirichlet_colors_;
3778 "OptProblemContainer::GetTransposedDirichletColors");
3784 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3785 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3786 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3787 template<
int,
int>
class DH>
3788 const std::vector<bool>&
3790 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDirichletCompMask(
3791 unsigned int color)
const
3793 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
3794 || this->GetType() ==
"adjoint_for_ee"
3795 || (this->GetType() ==
"tangent")
3796 || (this->GetType() ==
"adjoint_hessian"))
3798 unsigned int comp = dirichlet_colors_.size();
3799 for (
unsigned int i = 0; i < dirichlet_colors_.size(); ++i)
3801 if (dirichlet_colors_[i] == color)
3807 if (comp == dirichlet_colors_.size())
3809 std::stringstream s;
3810 s <<
"DirichletColor" << color <<
" has not been found !";
3812 "OptProblemContainer::GetDirichletCompMask");
3814 return dirichlet_comps_[comp];
3816 else if ((this->GetType() ==
"gradient")
3817 || (this->GetType() ==
"hessian"))
3819 unsigned int comp = control_dirichlet_colors_.size();
3820 for (
unsigned int i = 0; i < control_dirichlet_colors_.size(); ++i)
3822 if (control_dirichlet_colors_[i] == color)
3828 if (comp == control_dirichlet_colors_.size())
3830 std::stringstream s;
3831 s <<
"ControlDirichletColor" << color <<
" has not been found !";
3833 "OptProblemContainer::GetDirichletCompMask");
3835 return control_dirichlet_comps_[comp];
3840 "OptProblemContainer::GetDirichletCompMask");
3845 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3846 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3847 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3848 template<
int,
int>
class DH>
3849 const std::vector<bool>&
3851 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetTransposedDirichletCompMask(
3852 unsigned int color)
const
3854 if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian"))
3856 unsigned int comp = dirichlet_colors_.size();
3857 for (
unsigned int i = 0; i < dirichlet_colors_.size(); ++i)
3859 if (dirichlet_colors_[i] == color)
3865 if (comp == dirichlet_colors_.size())
3867 std::stringstream s;
3868 s <<
"DirichletColor" << color <<
" has not been found !";
3870 "OptProblemContainer::GetDirichletCompMask");
3872 return dirichlet_comps_[comp];
3877 "OptProblemContainer::GetTransposedDirichletCompMask");
3883 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3884 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3885 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3886 template<
int,
int>
class DH>
3887 const Function<dealdim>&
3889 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDirichletValues(
3891 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
3892 const std::map<std::string, const VECTOR*> &domain_values)
const
3895 unsigned int col = dirichlet_colors_.size();
3896 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
3897 || this->GetType() ==
"adjoint_for_ee"
3898 || (this->GetType() ==
"tangent")
3899 || (this->GetType() ==
"adjoint_hessian"))
3901 for (
unsigned int i = 0; i < dirichlet_colors_.size(); ++i)
3903 if (dirichlet_colors_[i] == color)
3909 if (col == dirichlet_colors_.size())
3911 std::stringstream s;
3912 s <<
"DirichletColor" << color <<
" has not been found !";
3914 "OptProblemContainer::GetDirichletValues");
3917 else if (this->GetType() ==
"gradient" || (this->GetType() ==
"hessian"))
3919 col = control_dirichlet_colors_.size();
3920 for (
unsigned int i = 0; i < control_dirichlet_colors_.size(); ++i)
3922 if (control_dirichlet_colors_[i] == color)
3928 if (col == control_dirichlet_colors_.size())
3930 std::stringstream s;
3931 s <<
"ControlDirichletColor" << color <<
" has not been found !";
3933 "OptProblemContainer::GetDirichletValues");
3939 "OptProblemContainer::GetDirichletValues");
3942 if (this->GetType() ==
"state")
3944 primal_dirichlet_values_[col]->ReInit(param_values, domain_values,
3946 return *(primal_dirichlet_values_[col]);
3948 else if (this->GetType() ==
"tangent")
3950 tangent_dirichlet_values_[col]->ReInit(param_values, domain_values,
3952 return *(tangent_dirichlet_values_[col]);
3954 else if (this->GetType() ==
"adjoint"
3955 || this->GetType() ==
"adjoint_for_ee"
3956 || (this->GetType() ==
"adjoint_hessian"))
3958 return *(zero_dirichlet_values_);
3960 else if (this->GetType() ==
"gradient" || (this->GetType() ==
"hessian"))
3962 return *(control_dirichlet_values_[col]);
3967 "OptProblemContainer::GetDirichletValues");
3972 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
3973 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
3974 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
3975 template<
int,
int>
class DH>
3978 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetTransposedDirichletValues(
3980 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
3981 const std::map<std::string, const VECTOR*> &domain_values)
const
3983 unsigned int col = control_transposed_dirichlet_colors_.size();
3984 if (this->GetType() ==
"gradient" || (this->GetType() ==
"hessian"))
3986 for (
unsigned int i = 0;
3987 i < control_transposed_dirichlet_colors_.size(); ++i)
3989 if (control_transposed_dirichlet_colors_[i] == color)
3995 if (col == control_transposed_dirichlet_colors_.size())
3997 std::stringstream s;
3998 s <<
"TransposedControlDirichletColor" << color
3999 <<
" has not been found !";
4001 "OptProblemContainer::GetTransposedDirichletValues");
4007 "OptProblemContainer::GetTransposedDirichletValues");
4010 if (this->GetType() ==
"gradient")
4012 transposed_control_gradient_dirichlet_values_[col]->ReInit(param_values,
4013 domain_values, color);
4014 return *(transposed_control_gradient_dirichlet_values_[col]);
4016 else if (this->GetType() ==
"hessian")
4018 transposed_control_hessian_dirichlet_values_[col]->ReInit(param_values,
4019 domain_values, color);
4020 return *(transposed_control_hessian_dirichlet_values_[col]);
4025 "OptProblemContainer::GetTransposedDirichletValues");
4031 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4032 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4033 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4034 template<
int,
int>
class DH>
4035 const std::vector<unsigned int>&
4037 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetBoundaryEquationColors()
const
4039 if (this->GetType() ==
"state" || this->GetType() ==
"tangent")
4041 return state_boundary_equation_colors_;
4043 else if (this->GetType() ==
"adjoint"
4044 || this->GetType() ==
"adjoint_for_ee"
4045 || this->GetType() ==
"adjoint_hessian")
4047 return adjoint_boundary_equation_colors_;
4049 else if (this->GetType() ==
"gradient" || (this->GetType() ==
"hessian")
4050 || (this->GetType() ==
"global_constraint_gradient"))
4052 return control_boundary_equation_colors_;
4057 "OptProblemContainer::GetBoundaryEquationColors");
4063 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4064 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4065 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4066 template<
int,
int>
class DH>
4069 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetControlBoundaryEquationColors(
4073 unsigned int comp = control_boundary_equation_colors_.size();
4074 for (
unsigned int i = 0; i < control_boundary_equation_colors_.size();
4077 if (control_boundary_equation_colors_[i] == color)
4083 if (comp != control_boundary_equation_colors_.size())
4085 std::stringstream s;
4086 s <<
"Boundary Equation Color" << color
4087 <<
" has multiple occurences !";
4089 "OptProblemContainer::SetControlBoundaryEquationColors");
4091 control_boundary_equation_colors_.push_back(color);
4096 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4097 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4098 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4099 template<
int,
int>
class DH>
4102 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetBoundaryEquationColors(
4106 unsigned int comp = state_boundary_equation_colors_.size();
4107 for (
unsigned int i = 0; i < state_boundary_equation_colors_.size();
4110 if (state_boundary_equation_colors_[i] == color)
4116 if (comp != state_boundary_equation_colors_.size())
4118 std::stringstream s;
4119 s <<
"Boundary Equation Color" << color
4120 <<
" has multiple occurences !";
4122 "OptProblemContainer::SetBoundaryEquationColors");
4124 state_boundary_equation_colors_.push_back(color);
4127 unsigned int comp = adjoint_boundary_equation_colors_.size();
4128 for (
unsigned int i = 0; i < adjoint_boundary_equation_colors_.size();
4131 if (adjoint_boundary_equation_colors_[i] == color)
4137 if (comp != adjoint_boundary_equation_colors_.size())
4144 adjoint_boundary_equation_colors_.push_back(color);
4151 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4152 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4153 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4154 template<
int,
int>
class DH>
4155 const std::vector<unsigned int>&
4157 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetBoundaryFunctionalColors()
const
4159 if (this->GetType() ==
"cost_functional"
4160 || this->GetType() ==
"aux_functional"
4161 || this->GetType() ==
"functional_for_ee")
4163 return boundary_functional_colors_;
4168 "OptProblemContainer::GetBoundaryFunctionalColors");
4174 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4175 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4176 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4177 template<
int,
int>
class DH>
4180 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::SetBoundaryFunctionalColors(
4184 unsigned int comp = boundary_functional_colors_.size();
4185 for (
unsigned int i = 0; i < boundary_functional_colors_.size(); ++i)
4187 if (boundary_functional_colors_[i] == color)
4193 if (comp != boundary_functional_colors_.size())
4195 std::stringstream s;
4196 s <<
"Boundary Functional Color" << color
4197 <<
" has multiple occurences !";
4199 "OptProblemContainer::SetBoundaryFunctionalColors");
4201 boundary_functional_colors_.push_back(color);
4204 unsigned int comp = adjoint_boundary_equation_colors_.size();
4205 for (
unsigned int i = 0; i < adjoint_boundary_equation_colors_.size();
4208 if (adjoint_boundary_equation_colors_[i] == color)
4214 if (comp != adjoint_boundary_equation_colors_.size())
4221 adjoint_boundary_equation_colors_.push_back(color);
4228 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4229 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4230 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4231 template<
int,
int>
class DH>
4234 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetControlNBlocks()
const
4241 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4242 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4243 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4244 template<
int,
int>
class DH>
4247 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetStateNBlocks()
const
4254 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4255 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4256 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4257 template<
int,
int>
class DH>
4260 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetNBlocks()
const
4262 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint_for_ee")
4263 || (this->GetType() ==
"adjoint") || (this->GetType() ==
"tangent")
4264 || (this->GetType() ==
"adjoint_hessian"))
4266 return this->GetStateNBlocks();
4268 else if ((this->GetType() ==
"gradient")
4269 || (this->GetType() ==
"hessian"))
4271 return this->GetControlNBlocks();
4276 "OptProblemContainer::GetNBlocks");
4282 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4283 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4284 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4285 template<
int,
int>
class DH>
4288 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDoFsPerBlock(
4289 unsigned int b)
const
4291 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
4292 || (this->GetType() ==
"adjoint_for_ee")
4293 || (this->GetType() ==
"tangent")
4294 || (this->GetType() ==
"adjoint_hessian"))
4296 return GetSpaceTimeHandler()->GetStateDoFsPerBlock(b);
4298 else if ((this->GetType() ==
"gradient")
4299 || (this->GetType() ==
"hessian"))
4301 return GetSpaceTimeHandler()->GetControlDoFsPerBlock(b);
4306 "OptProblemContainer::GetDoFsPerBlock");
4312 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4313 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4314 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4315 template<
int,
int>
class DH>
4316 const std::vector<unsigned int>&
4318 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDoFsPerBlock()
const
4320 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
4321 || (this->GetType() ==
"adjoint_for_ee")
4322 || (this->GetType() ==
"tangent")
4323 || (this->GetType() ==
"adjoint_hessian"))
4325 return GetSpaceTimeHandler()->GetStateDoFsPerBlock();
4327 else if ((this->GetType() ==
"gradient")
4328 || (this->GetType() ==
"hessian"))
4330 return GetSpaceTimeHandler()->GetControlDoFsPerBlock();
4335 "OptProblemContainer::GetDoFsPerBlock");
4341 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4342 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4343 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4344 template<
int,
int>
class DH>
4345 const dealii::ConstraintMatrix&
4347 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::GetDoFConstraints()
const
4349 if ((this->GetType() ==
"state") || (this->GetType() ==
"adjoint")
4350 || (this->GetType() ==
"adjoint_for_ee")
4351 || (this->GetType() ==
"tangent")
4352 || (this->GetType() ==
"adjoint_hessian"))
4354 return GetSpaceTimeHandler()->GetStateDoFConstraints();
4356 else if ((this->GetType() ==
"gradient") || (this->GetType() ==
"hessian")
4357 || (this->GetType() ==
"global_constraint_gradient"))
4359 return GetSpaceTimeHandler()->GetControlDoFConstraints();
4364 "OptProblemContainer::GetDoFConstraints");
4370 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4371 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4372 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4373 template<
int,
int>
class DH>
4376 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::NeedTimeFunctional()
const
4378 if (this->GetType() ==
"cost_functional")
4379 return GetFunctional()->NeedTime();
4380 else if (this->GetType() ==
"aux_functional")
4381 return aux_functionals_[this->GetTypeNum()]->NeedTime();
4382 else if (this->GetType() ==
"functional_for_ee")
4383 return aux_functionals_[functional_for_ee_num_]->NeedTime();
4386 "OptProblemContainer::NeedTimeFunctional");
4391 template<
typename FUNCTIONAL_INTERFACE,
typename FUNCTIONAL,
typename PDE,
4392 typename DD,
typename CONSTRAINTS,
typename SPARSITYPATTERN,
4393 typename VECTOR,
int dopedim,
int dealdim,
template<
int,
int>
class FE,
4394 template<
int,
int>
class DH>
4397 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>::HasControlInDirichletData()
const
4399 return (!control_transposed_dirichlet_colors_.empty());
void ElementTimeMatrix(const DATACONTAINER &dc, dealii::FullMatrix< double > &local_entry_matrix)
void ElementMatrix(const DATACONTAINER &dc, dealii::FullMatrix< double > &local_entry_matrix, double scale=1., double scale_ico=1.)
Definition: optproblemcontainer.h:2733
void DeleteAuxiliaryState(std::string name)
Definition: optproblemcontainer.h:3439
DOpEOutputHandler< VECTOR > * GetOutputHandler()
Definition: optproblemcontainer.h:822
void Init_PointRhs(const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values, VECTOR &rhs_vector, double scale=1.)
Definition: optproblemcontainer.h:1142
OptProblemContainer(FUNCTIONAL &functional, PDE &pde, CONSTRAINTS &constraints, SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim > &STH)
Definition: optproblemcontainer.h:1324
void BoundaryEquation(const FACEDATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale, double scale_ico)
Definition: optproblemcontainer.h:1968
dealii::UpdateFlags GetUpdateFlags() const
Definition: optproblemcontainer.h:3050
Definition: stateproblem.h:48
const ConstraintVector< VECTOR > * GetAuxiliaryConstraint(std::string name)
Definition: optproblemcontainer.h:911
unsigned int GetNFunctionals() const
Definition: optproblemcontainer.h:754
double FaceFunctional(const FACEDATACONTAINER &fdc)
Definition: optproblemcontainer.h:1647
void Init_ElementEquation(const DATACONTAINER &edc, dealii::Vector< double > &local_vector, double scale, double scale_ico)
Definition: optproblemcontainer.h:1077
void RegisterOutputHandler(DOpEOutputHandler< VECTOR > *OH)
Definition: optproblemcontainer.h:164
void BoundaryRhs(const FACEDATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: optproblemcontainer.h:2559
Definition: constraintvector.h:48
double AlgebraicFunctional(const std::map< std::string, const dealii::Vector< double > * > &values, const std::map< std::string, const VECTOR * > &block_values)
Definition: optproblemcontainer.h:1680
void ComputeLocalControlConstraints(VECTOR &constraints, const std::map< std::string, const dealii::Vector< double > * > &values, const std::map< std::string, const VECTOR * > &block_values)
Definition: optproblemcontainer.h:2958
void ElementTimeMatrixExplicit(const DATACONTAINER &dc, dealii::FullMatrix< double > &local_entry_matrix)
Definition: optproblemcontainer.h:2813
void ElementTimeEquationExplicit(const DATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: optproblemcontainer.h:1838
const std::vector< unsigned int > & GetBoundaryFunctionalColors() const
Definition: optproblemcontainer.h:4157
void SetTime(double time, const TimeIterator &interval, bool initial=false)
Definition: optproblemcontainer.h:3194
void ElementRhs(const DATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: optproblemcontainer.h:2019
void ReInit(std::string algo_type)
Definition: optproblemcontainer.h:1392
const VECTOR * GetBlockVector(const std::map< std::string, const VECTOR * > &values, std::string name)
Definition: optproblemcontainer.h:1238
Definition: dopetypes.h:106
const dealii::Function< dealdim > & GetInitialValues() const
Definition: optproblemcontainer.h:662
const FE< dealdim, dealdim > & GetFESystem() const
Definition: optproblemcontainer.h:3015
void PostProcessConstraints(ConstraintVector< VECTOR > &g) const
Definition: optproblemcontainer.h:3301
dealii::UpdateFlags GetFaceUpdateFlags() const
Definition: optproblemcontainer.h:3095
std::string GetFunctionalType() const
Definition: optproblemcontainer.h:3139
void AddFunctional(FUNCTIONAL_INTERFACE *F)
Definition: optproblemcontainer.h:692
FUNCTIONAL * GetFunctional()
Definition: optproblemcontainer.h:3483
Definition: tangentdirichletdata.h:39
bool HasInterfaces() const
Definition: optproblemcontainer.h:3612
double BoundaryFunctional(const FACEDATACONTAINER &fdc)
Definition: optproblemcontainer.h:1609
double ElementFunctional(const DATACONTAINER &edc)
Definition: optproblemcontainer.h:1519
std::string GetType() const
Definition: problemcontainer_internal.h:109
const std::vector< unsigned int > & GetBoundaryEquationColors() const
Definition: optproblemcontainer.h:4037
void SetDirichletBoundaryColors(unsigned int color, const std::vector< bool > &comp_mask, const DD *values)
Definition: optproblemcontainer.h:3687
const std::vector< unsigned int > & GetDoFsPerBlock() const
Definition: optproblemcontainer.h:4318
void SetControlBoundaryEquationColors(unsigned int color)
Definition: optproblemcontainer.h:4069
void PointRhs(const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values, VECTOR &rhs_vector, double scale=1.)
Definition: optproblemcontainer.h:2207
Definition: problemcontainer_internal.h:38
Definition: optproblemcontainer.h:70
void GetControlBoxConstraints(VECTOR &lb, VECTOR &ub) const
Definition: optproblemcontainer.h:566
void AddAuxiliaryControl(const ControlVector< VECTOR > *c, std::string name)
Definition: optproblemcontainer.h:3314
const std::vector< unsigned int > & GetDirichletColors() const
Definition: optproblemcontainer.h:3741
bool HasPoints() const
Definition: optproblemcontainer.h:3572
std::string GetDoFType() const
Definition: optproblemcontainer.h:2987
virtual std::string GetName() const
Definition: optproblemcontainer.h:115
void ElementEquation(const DATACONTAINER &edc, dealii::Vector< double > &local_vector, double scale, double scale_ico)
Definition: optproblemcontainer.h:1717
void ElementTimeEquation(const DATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: optproblemcontainer.h:1794
const std::vector< bool > & GetDirichletCompMask(unsigned int color) const
Definition: optproblemcontainer.h:3790
void SetType(std::string type, unsigned int num=0)
Definition: optproblemcontainer.h:1434
double PointFunctional(const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values)
Definition: optproblemcontainer.h:1555
Definition: timeiterator.h:63
Definition: dopetypes.h:105
unsigned int GetNBlocks() const
Definition: optproblemcontainer.h:4260
const StateVector< VECTOR > * GetAuxiliaryState(std::string name) const
Definition: optproblemcontainer.h:3396
const dealii::Function< dealdim > & GetDirichletValues(unsigned int color, const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values) const
Definition: optproblemcontainer.h:3889
Definition: controlvector.h:49
void Init_ElementMatrix(const DATACONTAINER &edc, dealii::FullMatrix< double > &local_entry_matrix, double scale, double scale_ico)
Definition: optproblemcontainer.h:1192
StateProblem< OptProblemContainer< FUNCTIONAL_INTERFACE, FUNCTIONAL, PDE, DD, CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >, PDE, DD, SPARSITYPATTERN, VECTOR, dealdim > & GetStateProblem()
Definition: optproblemcontainer.h:128
const PDE & GetPDE() const
Definition: problemcontainer_internal.h:103
bool EEFunctionalIsCost() const
Definition: optproblemcontainer.h:1216
const dealii::ConstraintMatrix & GetDoFConstraints() const
Definition: optproblemcontainer.h:4347
std::string GetConstraintType() const
Definition: optproblemcontainer.h:3181
Definition: optproblemcontainer.h:101
unsigned int GetStateNBlocks()
Definition: optproblemcontainer.h:1052
void FaceEquation(const FACEDATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale, double scale_ico)
Definition: optproblemcontainer.h:1886
void AddAuxiliaryConstraint(const ConstraintVector< VECTOR > *c, std::string name)
Definition: optproblemcontainer.h:3355
const ControlVector< VECTOR > * GetAuxiliaryControl(std::string name) const
Definition: optproblemcontainer.h:3375
DOpEExceptionHandler< VECTOR > * GetExceptionHandler()
Definition: optproblemcontainer.h:813
void FaceRhs(const FACEDATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: optproblemcontainer.h:2390
const SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim > * GetSpaceTimeHandler() const
Definition: optproblemcontainer.h:844
void RegisterExceptionHandler(DOpEExceptionHandler< VECTOR > *OH)
Definition: optproblemcontainer.h:172
Definition: transposedhessiandirichletdata.h:41
CONSTRAINTS * GetConstraints()
Definition: optproblemcontainer.h:1227
void FaceMatrix(const FACEDATACONTAINER &dc, dealii::FullMatrix< double > &local_entry_matrix, double scale=1., double scale_ico=1.)
void DeleteAuxiliaryFromIntegrator(INTEGRATOR &integrator)
Definition: optproblemcontainer.h:996
const dealii::Vector< double > * GetVector(const std::map< std::string, const Vector< double > * > &values, std::string name)
Definition: optproblemcontainer.h:1251
SpaceTimeHandler< FE, DH, SPARSITYPATTERN, VECTOR, dopedim, dealdim > * GetSpaceTimeHandler()
Definition: optproblemcontainer.h:852
const CONSTRAINTS * GetConstraints() const
Definition: optproblemcontainer.h:1232
bool HasFaces() const
Definition: optproblemcontainer.h:3524
Definition: primaldirichletdata.h:41
const std::vector< unsigned int > & GetTransposedDirichletColors() const
Definition: optproblemcontainer.h:3769
Definition: statevector.h:50
const TransposedDirichletDataInterface< dealdim > & GetTransposedDirichletValues(unsigned int color, const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values) const
Definition: optproblemcontainer.h:3978
void ComputeSparsityPattern(SPARSITYPATTERN &sparsity) const
Definition: optproblemcontainer.h:3267
void AlgebraicResidual(VECTOR &residual, const std::map< std::string, const dealii::Vector< double > * > &values, const std::map< std::string, const VECTOR * > &block_values)
Definition: optproblemcontainer.h:1767
void InterfaceEquation(const FACEDATACONTAINER &dc, dealii::Vector< double > &local_vector, double scale, double scale_ico)
Definition: optproblemcontainer.h:1936
Definition: spacetimehandler.h:71
OptProblemContainer< FUNCTIONAL_INTERFACE, FUNCTIONAL, PDE, DD, CONSTRAINTS, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > & GetBaseProblem()
Definition: optproblemcontainer.h:145
void SetFunctionalForErrorEstimation(std::string functional_name)
Definition: optproblemcontainer.h:718
unsigned int GetStateNBlocks() const
Definition: optproblemcontainer.h:4247
std::vector< unsigned int > & GetControlBlockComponent()
Definition: optproblemcontainer.h:1060
void AddAuxiliaryState(const StateVector< VECTOR > *c, std::string name)
Definition: optproblemcontainer.h:3335
bool NeedTimeFunctional() const
Definition: optproblemcontainer.h:4376
std::string GetFunctionalName() const
Definition: optproblemcontainer.h:3160
Definition: transposeddirichletdatainterface.h:37
unsigned int GetControlNBlocks() const
Definition: optproblemcontainer.h:4234
const std::vector< bool > & GetTransposedDirichletCompMask(unsigned int color) const
Definition: optproblemcontainer.h:3851
virtual ~OptProblemContainer()
Definition: optproblemcontainer.h:1349
bool HasControlInDirichletData() const
Definition: optproblemcontainer.h:4397
std::vector< unsigned int > & GetStateBlockComponent()
Definition: optproblemcontainer.h:1067
void SetInitialValues(const dealii::Function< dealdim > *values)
Definition: optproblemcontainer.h:657
Definition: dopeexception.h:35
Definition: transposedgradientdirichletdata.h:41
void AddAuxiliaryToIntegrator(INTEGRATOR &integrator)
Definition: optproblemcontainer.h:933
void SetBoundaryEquationColors(unsigned int color)
Definition: optproblemcontainer.h:4102
void SetControlDirichletBoundaryColors(unsigned int color, const std::vector< bool > &comp_mask, const DOpEWrapper::Function< dealdim > *values)
Definition: optproblemcontainer.h:3652
void DeleteAuxiliaryConstraint(std::string name)
Definition: optproblemcontainer.h:3461
const std::map< std::string, unsigned int > & GetFunctionalPosition() const
Definition: optproblemcontainer.h:1046
void SetBoundaryFunctionalColors(unsigned int color)
Definition: optproblemcontainer.h:4180
void DeleteAuxiliaryControl(std::string name)
Definition: optproblemcontainer.h:3417
void BoundaryMatrix(const FACEDATACONTAINER &dc, dealii::FullMatrix< double > &local_matrix, double scale=1., double scale_ico=1.)
void Init_ElementRhs(const DATACONTAINER &edc, dealii::Vector< double > &local_vector, double scale)
Definition: optproblemcontainer.h:1096
void InterfaceMatrix(const FACEDATACONTAINER &dc, dealii::FullMatrix< double > &local_entry_matrix, double scale=1., double scale_ico=1.)
Definition: optproblemcontainer.h:72