1 #ifndef YANGMILLS_LM_HPP
2 #define YANGMILLS_LM_HPP
6 #include <boost/math/constants/constants.hpp>
8 #include <Eigen/Sparse>
9 #include <unsupported/Eigen/SparseExtra>
60 typedef std::function<Eigen::Vector3d(
const double &,
const Eigen::Vector3d &)>
TForcingTermType;
61 typedef std::function<Eigen::Vector3d(
const double &,
const Eigen::Vector3d &)>
TElectricFieldType;
62 typedef std::function<Eigen::Vector3d(
const double &,
const Eigen::Vector3d &)>
TMagneticFieldType;
77 std::ostream & output = std::cout
86 const Eigen::VectorXd & interp_f,
87 const Eigen::VectorXd & interp_dE,
88 const Eigen::VectorXd & interp_A,
89 const Eigen::VectorXd & E_old,
90 const Eigen::VectorXd & A_old,
93 double nonlinear_coeff
97 const Eigen::VectorXd & E_i,
98 const Eigen::VectorXd & A_i,
99 const Eigen::VectorXd & Elambdac_k,
100 const Eigen::VectorXd & sysVec,
103 double nonlinear_coeff
107 const Eigen::VectorXd & v,
108 const Eigen::VectorXd & u
112 const Eigen::VectorXd & Elambda_k,
113 const Eigen::VectorXd & E_i,
114 const Eigen::VectorXd & A_i,
115 const Eigen::VectorXd & sysVec,
118 double nonlinear_coeff
127 const Eigen::MatrixXd & Ah,
128 const double nonlinear_coeff,
134 boost::multi_array<double, 3> & ebkt_T,
135 const Eigen::VectorXd & v
139 Eigen::MatrixXd
L2v_Bkt(
size_t iT,
140 boost::multi_array<double, 3> & intPciPcjPgk,
141 const Eigen::VectorXd & v,
147 boost::multi_array<double, 3> & ebkt_T,
148 const Eigen::VectorXd & v_T,
149 const Eigen::MatrixXd & L2prod
238 const std::vector<Eigen::VectorXd> & list_dofs
242 template<
typename outValue,
typename TFct>
243 std::function<outValue(
const Eigen::Vector3d &)>
contractPara(
const TFct &F,
double t)
const
245 std::function<outValue(
const Eigen::Vector3d &)> f = [&F, t](
const Eigen::Vector3d &x) -> outValue {
return F(t, x);};
249 template<
typename outValue,
typename Fct,
typename TFct>
253 for (
size_t i = 0; i < TF.size(); i++){
254 f.emplace_back(contractPara<outValue>(TF[i], t));
263 Eigen::VectorXd
computeConstraint(
const Eigen::VectorXd & E,
const Eigen::VectorXd & A,
const double nonlinear_coeff);
272 std::vector<Eigen::MatrixXd>
273 _compute_local_contribution(
279 void _assemble_local_contribution(
281 const std::vector<Eigen::MatrixXd> & lsT,
282 std::vector<std::list<Eigen::Triplet<double>>> & triplets,
283 std::vector<Eigen::VectorXd> & vecs
287 boost::multi_array<double, 3> epsBkt_F(
size_t iF)
const;
290 boost::multi_array<double, 3> _compute_detnij_Pot_PkF(
size_t iF)
const;
293 boost::multi_array<double, 3> _compute_detnij_PkF(
size_t iF)
const;
296 boost::multi_array<double, 3> epsBkt_T(
size_t iT)
const;
299 boost::multi_array<double, 3> _compute_crossij_Pot_T(
size_t iT)
const;
302 boost::multi_array<double, 3> _compute_crossij_T(
size_t iT)
const;
305 boost::multi_array<double, 3> _integral_ijk(
size_t iT)
const;
308 boost::multi_array<double, 3> _int_Pci_bktPcjPgk(
size_t iT)
const;
312 std::ostream & m_output;
329 template<
typename outValue,
typename Fct>
330 std::vector<Fct>
sumLA(
const std::vector<Fct> & LAF,
const std::vector<Fct> & LAG,
double lambda)
332 std::vector<Fct> values;
333 for (
size_t i = 0; i < LAF.size(); i++){
334 values.emplace_back([&, i, lambda](
double t,
const Eigen::Vector3d & x)-> outValue {
return LAF[i](t, x) + lambda * LAG[i](t, x);});
343 static const double PI = boost::math::constants::pi<double>();
355 return Eigen::Vector3d(
356 -0.5*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)),
357 sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)),
358 -0.5*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1))
363 return Eigen::Vector3d(
364 0.5*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)),
365 -sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)),
366 0.5*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))
372 return Eigen::Vector3d(
373 0.5*pow(sin(
PI*x(1)), 2)*cos(t),
374 sin(t)*pow(cos(
PI*x(2)), 2),
375 0.5*cos(t)*pow(cos(
PI*x(0)), 2)
384 return Eigen::Vector3d(
385 -0.5*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)),
386 sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)),
387 -0.5*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))
393 return Eigen::Vector3d(
394 -0.5*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)),
395 sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)),
396 -0.5*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1))
402 return Eigen::Vector3d(-0.5*sin(t)*pow(sin(
PI*x(1)), 2),
403 cos(t)*pow(cos(
PI*x(2)), 2),
404 -0.5*sin(t)*pow(cos(
PI*x(0)), 2)
413 return Eigen::Vector3d(
414 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0)),
416 -1.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*cos(
PI*x(2))
422 return Eigen::Vector3d(
423 1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(
PI*x(0)),
425 -1.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(
PI*x(2))
431 return Eigen::Vector3d(
432 2*
PI*sin(
PI*x(2))*cos(t)*cos(
PI*x(2)),
433 -1.0*
PI*sin(t)*sin(
PI*x(0))*cos(
PI*x(0)),
434 1.0*
PI*sin(t)*sin(
PI*x(1))*cos(
PI*x(1))
443 return Eigen::Vector3d(
444 -0.5*pow(sin(t), 2)*sin(
PI*x(1))*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) + 0.5*sin(t)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2),
445 -0.25*pow(sin(t), 2)*sin(
PI*x(0))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)),
446 0.5*pow(sin(t), 2)*pow(sin(
PI*x(1)), 3)*cos(
PI*x(0))*cos(
PI*x(2)) - 0.5*sin(t)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3)
452 return Eigen::Vector3d(
453 0.5*sin(t)*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) - 0.5*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2),
454 0.25*sin(t)*sin(
PI*x(0))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*sin(t)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)),
455 -0.5*sin(t)*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + 0.5*sin(
PI*x(0))*pow(cos(t), 2)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3)
461 return Eigen::Vector3d(
473 return Eigen::Vector3d(
474 -0.5*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)),
475 sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)),
476 -0.5*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))
481 return Eigen::Vector3d(
482 -0.5*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)),
483 sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)),
484 -0.5*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1))
490 return Eigen::Vector3d(
491 -0.5*sin(t)*pow(sin(
PI*x(1)), 2),
492 cos(t)*pow(cos(
PI*x(2)), 2),
493 -0.5*sin(t)*pow(cos(
PI*x(0)), 2)
502 return Eigen::Vector3d(
503 -0.5*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)) + 1.5*pow(
PI, 2)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)),
504 -3.0*pow(
PI, 2)*sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)),
505 -0.5*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)) + 1.5*pow(
PI, 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))
511 return Eigen::Vector3d(
512 -0.5*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) + 1.5*pow(
PI, 2)*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)),
513 -3.0*pow(
PI, 2)*sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)) + sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)),
514 -0.5*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)) + 1.5*pow(
PI, 2)*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1))
520 return Eigen::Vector3d(
521 -0.5*sin(t)*pow(sin(
PI*x(1)), 2) + 1.0*pow(
PI, 2)*sin(t)*pow(sin(
PI*x(1)), 2) - 1.0*pow(
PI, 2)*sin(t)*pow(cos(
PI*x(1)), 2),
522 2*pow(
PI, 2)*pow(sin(
PI*x(2)), 2)*cos(t) - 2*pow(
PI, 2)*cos(t)*pow(cos(
PI*x(2)), 2) + cos(t)*pow(cos(
PI*x(2)), 2),
523 -1.0*pow(
PI, 2)*sin(t)*pow(sin(
PI*x(0)), 2) - 0.5*sin(t)*pow(cos(
PI*x(0)), 2) + 1.0*pow(
PI, 2)*sin(t)*pow(cos(
PI*x(0)), 2)
532 return Eigen::Vector3d(
533 0.5*(0.25*sin(t)*sin(
PI*x(0))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*sin(t)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*pow(cos(
PI*x(0)), 2) + (-1.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(
PI*x(2)) - 0.5*sin(t)*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + 0.5*sin(
PI*x(0))*pow(cos(t), 2)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3))*cos(t)*pow(cos(
PI*x(2)), 2) + 0.75*
PI*pow(sin(t), 2)*sin(
PI*x(0))*sin(
PI*x(2))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1)) - 2.25*
PI*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) - 0.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(2)), 3),
534 0.5*(-1.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(
PI*x(2)) - 0.5*sin(t)*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + 0.5*sin(
PI*x(0))*pow(cos(t), 2)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3))*sin(t)*pow(sin(
PI*x(1)), 2) - 0.5*(1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(
PI*x(0)) + 0.5*sin(t)*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) - 0.5*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2))*sin(t)*pow(cos(
PI*x(0)), 2) - 0.5*
PI*pow(sin(t), 2)*sin(
PI*x(0))*pow(sin(
PI*x(1)), 3)*cos(
PI*x(2)) - 0.5*
PI*pow(sin(t), 2)*sin(
PI*x(0))*sin(
PI*x(1))*pow(cos(
PI*x(1)), 2)*cos(
PI*x(2)) - 0.5*
PI*pow(sin(t), 2)*sin(
PI*x(1))*sin(
PI*x(2))*pow(cos(
PI*x(0)), 3) + 2.0*
PI*sin(t)*pow(sin(
PI*x(2)), 2)*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) - 1.0*
PI*sin(t)*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3),
535 -0.5*(0.25*sin(t)*sin(
PI*x(0))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*sin(t)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*pow(sin(
PI*x(1)), 2) - (1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(
PI*x(0)) + 0.5*sin(t)*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) - 0.5*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2))*cos(t)*pow(cos(
PI*x(2)), 2) - 1.0*
PI*pow(sin(t), 2)*pow(sin(
PI*x(0)), 2)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*
PI*pow(sin(t), 2)*sin(
PI*x(0))*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(1)) - 0.25*
PI*pow(sin(t), 2)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(1))*cos(
PI*x(2)) + 1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*pow(cos(
PI*x(2)), 2)
541 return Eigen::Vector3d(
542 -0.5*(-0.25*pow(sin(t), 2)*sin(
PI*x(0))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*pow(cos(
PI*x(0)), 2) - (0.5*pow(sin(t), 2)*pow(sin(
PI*x(1)), 3)*cos(
PI*x(0))*cos(
PI*x(2)) - 0.5*sin(t)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3) - 1.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*cos(
PI*x(2)))*cos(t)*pow(cos(
PI*x(2)), 2) - 0.75*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(2))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1)) + 2.25*
PI*sin(t)*pow(sin(
PI*x(1)), 2)*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) + 0.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*pow(cos(t), 2)*pow(cos(
PI*x(2)), 3),
543 0.5*(-0.5*pow(sin(t), 2)*sin(
PI*x(1))*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) + 0.5*sin(t)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2) + 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0)))*sin(t)*pow(cos(
PI*x(0)), 2) - 0.5*(0.5*pow(sin(t), 2)*pow(sin(
PI*x(1)), 3)*cos(
PI*x(0))*cos(
PI*x(2)) - 0.5*sin(t)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3) - 1.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*cos(
PI*x(2)))*sin(t)*pow(sin(
PI*x(1)), 2) + 0.5*
PI*sin(t)*sin(
PI*x(0))*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(2)) + 0.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(1)), 2)*cos(
PI*x(2)) + 0.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*pow(cos(
PI*x(0)), 3) - 2.0*
PI*pow(sin(
PI*x(2)), 2)*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) + 1.0*
PI*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3),
544 0.5*(-0.25*pow(sin(t), 2)*sin(
PI*x(0))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*pow(sin(
PI*x(1)), 2) + (-0.5*pow(sin(t), 2)*sin(
PI*x(1))*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) + 0.5*sin(t)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2) + 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0)))*cos(t)*pow(cos(
PI*x(2)), 2) + 1.0*
PI*sin(t)*pow(sin(
PI*x(0)), 2)*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*
PI*sin(t)*sin(
PI*x(0))*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(1)) + 0.25*
PI*sin(t)*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(1))*cos(
PI*x(2)) - 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*pow(cos(
PI*x(2)), 2)
550 return Eigen::Vector3d(
551 0.5*(-0.25*pow(sin(t), 2)*sin(
PI*x(0))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)) - 0.5*(0.25*sin(t)*sin(
PI*x(0))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*sin(t)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)) + (0.5*pow(sin(t), 2)*pow(sin(
PI*x(1)), 3)*cos(
PI*x(0))*cos(
PI*x(2)) - 0.5*sin(t)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3) - 1.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*cos(
PI*x(2)))*sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)) - (-1.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(
PI*x(2)) - 0.5*sin(t)*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + 0.5*sin(
PI*x(0))*pow(cos(t), 2)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3))*sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)),
552 -0.5*(-0.5*pow(sin(t), 2)*sin(
PI*x(1))*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) + 0.5*sin(t)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2) + 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0)))*sin(t)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)) + 0.5*(0.5*pow(sin(t), 2)*pow(sin(
PI*x(1)), 3)*cos(
PI*x(0))*cos(
PI*x(2)) - 0.5*sin(t)*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3) - 1.5*
PI*sin(
PI*x(0))*sin(
PI*x(1))*cos(t)*cos(
PI*x(2)))*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) - 0.5*(-1.5*
PI*sin(t)*sin(
PI*x(0))*sin(
PI*x(1))*cos(
PI*x(2)) - 0.5*sin(t)*pow(sin(
PI*x(1)), 3)*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)) + 0.5*sin(
PI*x(0))*pow(cos(t), 2)*cos(
PI*x(1))*pow(cos(
PI*x(2)), 3))*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.5*(1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(
PI*x(0)) + 0.5*sin(t)*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) - 0.5*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)),
553 -0.5*(-0.25*pow(sin(t), 2)*sin(
PI*x(0))*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) + 0.25*pow(sin(t), 2)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(
PI*x(0))*cos(
PI*x(1)))*sin(t)*sin(
PI*x(0))*cos(
PI*x(1))*cos(
PI*x(2)) + 0.5*(0.25*sin(t)*sin(
PI*x(0))*cos(t)*pow(cos(
PI*x(0)), 2)*cos(
PI*x(1))*cos(
PI*x(2)) - 0.25*sin(t)*pow(sin(
PI*x(1)), 2)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1)))*sin(
PI*x(0))*cos(t)*cos(
PI*x(1))*cos(
PI*x(2)) - (-0.5*pow(sin(t), 2)*sin(
PI*x(1))*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) + 0.5*sin(t)*sin(
PI*x(2))*cos(t)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2) + 1.5*
PI*sin(
PI*x(1))*sin(
PI*x(2))*cos(t)*cos(
PI*x(0)))*sin(t)*sin(
PI*x(1))*cos(
PI*x(0))*cos(
PI*x(2)) + (1.5*
PI*sin(t)*sin(
PI*x(1))*sin(
PI*x(2))*cos(
PI*x(0)) + 0.5*sin(t)*sin(
PI*x(1))*cos(t)*pow(cos(
PI*x(0)), 3)*cos(
PI*x(2)) - 0.5*sin(
PI*x(2))*pow(cos(t), 2)*cos(
PI*x(0))*cos(
PI*x(1))*pow(cos(
PI*x(2)), 2))*sin(
PI*x(1))*cos(t)*cos(
PI*x(0))*cos(
PI*x(2)));
564 linear_E1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
565 return Eigen::Vector3d(-x(2), -x(1), -x(0));
569 linear_E2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
570 return Eigen::Vector3d(-x(2), -x(0), -x(1));
574 linear_E3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
575 return Eigen::Vector3d(-x(1) - x(2), -x(0) - x(2), -x(0) - x(1));
582 linear_A1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
583 return Eigen::Vector3d(t*x(2), t*x(1), t*x(0));
587 linear_A2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
588 return Eigen::Vector3d(t*x(2), t*x(0), t*x(1));
592 linear_A3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
593 return Eigen::Vector3d(t*x(1) + t*x(2), t*x(0) + t*x(2), t*x(0) + t*x(1));
601 return Eigen::Vector3d(
610 return Eigen::Vector3d(
619 return Eigen::Vector3d(
631 return Eigen::Vector3d(
632 1.0*t*x(0)*(t*x(0) + t*x(1)) - 1.0*t*x(1)*(t*x(0) + t*x(2)),
633 1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(1)),
634 -1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(2))
640 return Eigen::Vector3d(
641 1.0*t*x(0)*(t*x(0) + t*x(2)) - 1.0*t*x(1)*(t*x(0) + t*x(1)),
642 -1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(1)),
643 1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(2))
649 return Eigen::Vector3d(
650 -1.0*pow(t, 2)*pow(x(0), 2) + 1.0*pow(t, 2)*pow(x(1), 2),
651 1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2),
652 1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)
660 linear_dtE1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
661 return Eigen::Vector3d(0, 0, 0);
664 linear_dtE2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
665 return Eigen::Vector3d(0, 0, 0);
669 linear_dtE3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
670 return Eigen::Vector3d(0, 0, 0);
678 return Eigen::Vector3d(0, 0, 0);
683 return Eigen::Vector3d(0, 0, 0);
688 return Eigen::Vector3d(0, 0, 0);
696 return Eigen::Vector3d(1.0*pow(t, 2)*x(0) + 1.0*pow(t, 2)*x(1) - t*x(0)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) + t*x(1)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) - 1.0*t*(t*x(0) + t*x(1)) - (t*x(0) + t*x(1))*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(1)) + t) + (t*x(0) + t*x(2))*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(2)) + t), 1.0*pow(t, 2)*x(1) + 1.0*pow(t, 2)*x(2) - t*x(1)*(-1.0*pow(t, 2)*pow(x(0), 2) + 1.0*pow(t, 2)*pow(x(1), 2)) + t*x(2)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) - 1.0*t*(t*x(1) + t*x(2)) + (t*x(0) + t*x(1))*(1.0*t*x(0)*(t*x(0) + t*x(2)) - 1.0*t*x(1)*(t*x(0) + t*x(1)) + t) - (t*x(1) + t*x(2))*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(2)) + t), 1.0*pow(t, 2)*x(0) + 1.0*pow(t, 2)*x(2) + t*x(0)*(-1.0*pow(t, 2)*pow(x(0), 2) + 1.0*pow(t, 2)*pow(x(1), 2)) - t*x(2)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) - 1.0*t*(t*x(0) + t*x(2)) - (t*x(0) + t*x(2))*(1.0*t*x(0)*(t*x(0) + t*x(2)) - 1.0*t*x(1)*(t*x(0) + t*x(1)) + t) + (t*x(1) + t*x(2))*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(1)) + t)
702 return Eigen::Vector3d(-1.0*pow(t, 2)*x(0) - 1.0*pow(t, 2)*x(1) - t*x(0)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) + t*x(1)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) + 1.0*t*(t*x(0) + t*x(1)) - 1.0*t*(t*x(1) + t*x(2)) + (t*x(0) + t*x(1))*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(1))) - (t*x(0) + t*x(2))*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(2))), -1.0*pow(t, 2)*x(0) - 1.0*pow(t, 2)*x(2) + t*x(0)*(-1.0*pow(t, 2)*pow(x(0), 2) + 1.0*pow(t, 2)*pow(x(1), 2)) - t*x(2)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) - (t*x(0) + t*x(1))*(1.0*t*x(0)*(t*x(0) + t*x(1)) - 1.0*t*x(1)*(t*x(0) + t*x(2))) + (t*x(1) + t*x(2))*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(2))), -1.0*pow(t, 2)*x(1) - 1.0*pow(t, 2)*x(2) - t*x(1)*(-1.0*pow(t, 2)*pow(x(0), 2) + 1.0*pow(t, 2)*pow(x(1), 2)) + t*x(2)*(1.0*pow(t, 2)*x(0)*x(2) - 1.0*pow(t, 2)*x(1)*x(2)) - 1.0*t*(t*x(0) + t*x(1)) + 1.0*t*(t*x(1) + t*x(2)) + (t*x(0) + t*x(2))*(1.0*t*x(0)*(t*x(0) + t*x(1)) - 1.0*t*x(1)*(t*x(0) + t*x(2))) - (t*x(1) + t*x(2))*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(1)))
708 return Eigen::Vector3d(1.0*pow(t, 2)*x(0) - 1.0*pow(t, 2)*x(1) + 1.0*pow(t, 2)*x(2) + t*x(0)*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(2))) + t*x(0)*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(1)) + t) - t*x(1)*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(1))) - t*x(1)*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(2)) + t), 1.0*pow(t, 2)*x(2) - t*x(0)*(1.0*t*x(0)*(t*x(0) + t*x(2)) - 1.0*t*x(1)*(t*x(0) + t*x(1)) + t) + t*x(1)*(1.0*t*x(0)*(t*x(0) + t*x(1)) - 1.0*t*x(1)*(t*x(0) + t*x(2))) - t*x(2)*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(2))) + t*x(2)*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(2)) + t), 2.0*pow(t, 2)*x(1) - 1.0*pow(t, 2)*x(2) - t*x(0)*(1.0*t*x(0)*(t*x(0) + t*x(1)) - 1.0*t*x(1)*(t*x(0) + t*x(2))) + t*x(1)*(1.0*t*x(0)*(t*x(0) + t*x(2)) - 1.0*t*x(1)*(t*x(0) + t*x(1)) + t) + t*x(2)*(1.0*t*x(1)*(t*x(1) + t*x(2)) - 1.0*t*x(2)*(t*x(0) + t*x(1))) - t*x(2)*(-1.0*t*x(0)*(t*x(1) + t*x(2)) + 1.0*t*x(2)*(t*x(0) + t*x(1)) + t)
720 const_E1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
721 return Eigen::Vector3d::Zero();
725 const_E2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
726 return Eigen::Vector3d::Zero();
730 const_E3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
731 return Eigen::Vector3d::Zero();
738 const_A1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
739 return Eigen::Vector3d(0.2, 0.4, 0.6);
743 const_A2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
744 return Eigen::Vector3d(0.8, 1.0, 1.2);
748 const_A3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
749 return Eigen::Vector3d(1.4, 1.6, 1.8);
757 return Eigen::Vector3d(0, 0, 0);
762 return Eigen::Vector3d(0, 0, 0);
767 return Eigen::Vector3d(0, 0, 0);
775 return Eigen::Vector3d(-0.12, 0.24, -0.12);
780 return Eigen::Vector3d(0.24, -0.48, 0.24);
785 return Eigen::Vector3d(-0.12, 0.24, -0.12);
792 const_dtE1 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
793 return Eigen::Vector3d(0, 0, 0);
796 const_dtE2 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
797 return Eigen::Vector3d(0, 0, 0);
801 const_dtE3 = [](
const double t,
const Eigen::Vector3d & x) -> Eigen::Vector3d {
802 return Eigen::Vector3d(0, 0, 0);
810 return Eigen::Vector3d(0, 0, 0);
815 return Eigen::Vector3d(0, 0, 0);
820 return Eigen::Vector3d(0, 0, 0);
828 return Eigen::Vector3d(1.656, 0.144, -1.368);
833 return Eigen::Vector3d(0.432, 0, -0.432);
838 return Eigen::Vector3d(-0.792, -0.144, 0.504);
862 AssembledSystems(std::vector<Eigen::SparseMatrix<double>> sys, std::vector<Eigen::VectorXd> vec):
868 std::vector<Eigen::SparseMatrix<double>>
systems;
Construct all polynomial spaces for the DDR sequence.
Definition: ddrcore.hpp:62
Discrete Lie algebra valued Hcurl space.
Definition: laxcurl.hpp:18
Discrete Lie algebra valued Hdiv space: local operators, L2 product and global interpolator.
Definition: laxdiv.hpp:20
Discrete Lie algebra valued H1 space: local operators, L2 product and global interpolator.
Definition: laxgrad.hpp:18
Lie algebra class: mass matrix, structure constants and Lie bracket.
Definition: liealgebra.hpp:17
Discrete Hcurl space: local operators, L2 product and global interpolator.
Definition: xcurl.hpp:19
Discrete Hdiv space: local operators, L2 product and global interpolator.
Definition: xdiv.hpp:20
Discrete H1 space: local operators, L2 product and global interpolator.
Definition: xgrad.hpp:18
size_t dimension() const
Returns the dimension of the global space (all DOFs for all geometric entities)
Definition: localdofspace.hpp:80
static const double PI
Definition: ddr-magnetostatics.hpp:186
double pressure_scaling
Definition: ddr-stokes.hpp:249
static YangMills::TMagneticFieldType linear_B2_nonlinear
Definition: laddr-yangmills-lm.hpp:639
AssembleSystems(std::vector< Eigen::MatrixXd > sys, std::vector< Eigen::VectorXd > vec)
Constructor.
Definition: laddr-yangmills-lm.hpp:849
const LAXCurl & laXCurl() const
Returns the space LAXCurl.
Definition: laddr-yangmills-lm.hpp:177
static YangMills::TElectricFieldType trigonometric_dtE3
Definition: laddr-yangmills-lm.hpp:489
static YangMills::TLAForcingTermType const_f_linear
Definition: laddr-yangmills-lm.hpp:824
double lambda
Norm of Lagrange multiplier.
Definition: laddr-yangmills-lm.hpp:48
double computeResidual(const Eigen::VectorXd &x) const
Calculates residual with current matrix and rhs from given x (m_A*x = m_b)
Definition: laddr-yangmills-lm.cpp:1561
static YangMills::TMagneticFieldType trigonometric_B2_linear
Definition: laddr-yangmills-lm.hpp:421
std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ForcingTermType
Base functions.
Definition: laddr-yangmills-lm.hpp:56
std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TForcingTermType
Base functions with time component.
Definition: laddr-yangmills-lm.hpp:60
static YangMills::TMagneticFieldType const_B1_nonlinear
Definition: laddr-yangmills-lm.hpp:774
void addBoundaryConditions(const LAMagneticFieldType &curl_A, double dt)
Adds boundary condition for chosen solution to the system vector.
Definition: laddr-yangmills-lm.cpp:531
static YangMills::TMagneticFieldType trigonometric_B1_linear
Definition: laddr-yangmills-lm.hpp:412
const LieAlgebra & lieAlg() const
Returns the Lie algebra.
Definition: laddr-yangmills-lm.hpp:165
static YangMills::TForcingTermType linear_f1_nonlinear
Definition: laddr-yangmills-lm.hpp:695
std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ElectricFieldType
Definition: laddr-yangmills-lm.hpp:57
static YangMills::TMagneticFieldType trigonometric_B3_linear
Definition: laddr-yangmills-lm.hpp:430
static YangMills::TElectricFieldType trigonometric_E1
Definition: laddr-yangmills-lm.hpp:354
static YangMills::TForcingTermType linear_f3_linear
Definition: laddr-yangmills-lm.hpp:687
static YangMills::TLAElectricFieldType linear_E
Definition: laddr-yangmills-lm.hpp:579
static YangMills::TMagneticFieldType const_B2_linear
Definition: laddr-yangmills-lm.hpp:761
static YangMills::TMagneticFieldType linear_B2_linear
Definition: laddr-yangmills-lm.hpp:609
static YangMills::TLAElectricFieldType trigonometric_A
Definition: laddr-yangmills-lm.hpp:409
size_t dimension() const
Returns the global problem dimension.
Definition: laddr-yangmills-lm.hpp:153
static YangMills::TElectricFieldType const_A1
Definition: laddr-yangmills-lm.hpp:738
static YangMills::TForcingTermType const_f2_nonlinear
Definition: laddr-yangmills-lm.hpp:832
static YangMills::TForcingTermType trigonometric_f2_nonlinear
Definition: laddr-yangmills-lm.hpp:540
double A
Norm of potential.
Definition: laddr-yangmills-lm.hpp:47
static YangMills::TForcingTermType linear_f2_linear
Definition: laddr-yangmills-lm.hpp:682
static YangMills::TElectricFieldType trigonometric_A1
Definition: laddr-yangmills-lm.hpp:383
static YangMills::TForcingTermType trigonometric_f3_linear
Definition: laddr-yangmills-lm.hpp:519
static YangMills::TElectricFieldType trigonometric_A2
Definition: laddr-yangmills-lm.hpp:392
YangMillsNorms(double norm_E, double norm_A, double norm_lambda)
Constructor.
Definition: laddr-yangmills-lm.hpp:38
static YangMills::TForcingTermType linear_f1_linear
Definition: laddr-yangmills-lm.hpp:677
Eigen::MatrixXd L2v_Bkt(size_t iT, boost::multi_array< double, 3 > &intPciPcjPgk, const Eigen::VectorXd &v, const size_t &entry) const
Wrapper to plug vector into L2 integral product: int (Pcurl 1,[Pcurl 2, Pgrad 3])
Definition: laddr-yangmills-lm.cpp:1433
static YangMills::TMagneticFieldType linear_B1_nonlinear
Definition: laddr-yangmills-lm.hpp:630
static YangMills::TElectricFieldType linear_dtE2
Definition: laddr-yangmills-lm.hpp:664
static YangMills::TElectricFieldType linear_E1
Definition: laddr-yangmills-lm.hpp:564
std::vector< TForcingTermType > TLAForcingTermType
Lie algebra valued functions with time component.
Definition: laddr-yangmills-lm.hpp:68
static YangMills::TMagneticFieldType const_B2_nonlinear
Definition: laddr-yangmills-lm.hpp:779
SystemMatrixType & systemMatrix()
Returns the linear system matrix.
Definition: laddr-yangmills-lm.hpp:212
const XGrad & xGrad() const
Returns the space XDiv.
Definition: laddr-yangmills-lm.hpp:189
Eigen::VectorXd computeConstraint(const Eigen::VectorXd &E, const Eigen::VectorXd &A, const double nonlinear_coeff)
Computes the constraint [E, grad P'] + int <E, [A, P']> for the DOFs.
Definition: laddr-yangmills-lm.cpp:1615
std::vector< Eigen::VectorXd > vectors
Definition: laddr-yangmills-lm.hpp:856
static YangMills::TElectricFieldType const_dtE1
Definition: laddr-yangmills-lm.hpp:792
double E
Norm of electric field.
Definition: laddr-yangmills-lm.hpp:44
static YangMills::TElectricFieldType linear_dtE1
Definition: laddr-yangmills-lm.hpp:660
static YangMills::TElectricFieldType trigonometric_dtE1
Definition: laddr-yangmills-lm.hpp:472
AssembledSystems(std::vector< Eigen::SparseMatrix< double >> sys, std::vector< Eigen::VectorXd > vec)
Constructor.
Definition: laddr-yangmills-lm.hpp:862
static YangMills::TMagneticFieldType trigonometric_B3_nonlinear
Definition: laddr-yangmills-lm.hpp:460
static YangMills::TMagneticFieldType trigonometric_B1_nonlinear
Definition: laddr-yangmills-lm.hpp:442
static YangMills::TForcingTermType trigonometric_f3_nonlinear
Definition: laddr-yangmills-lm.hpp:549
static YangMills::TLAElectricFieldType trigonometric_E
Definition: laddr-yangmills-lm.hpp:380
static YangMills::TForcingTermType const_f1_nonlinear
Definition: laddr-yangmills-lm.hpp:827
static YangMills::TElectricFieldType linear_A3
Definition: laddr-yangmills-lm.hpp:592
static YangMills::TLAForcingTermType trigonometric_f_linear
Definition: laddr-yangmills-lm.hpp:528
static YangMills::TForcingTermType const_f3_nonlinear
Definition: laddr-yangmills-lm.hpp:837
static YangMills::TElectricFieldType linear_E2
Definition: laddr-yangmills-lm.hpp:569
size_t sizeSystem() const
Returns the size of the system.
Definition: laddr-yangmills-lm.hpp:159
std::vector< YangMillsNorms > computeYangMillsNorms(const std::vector< Eigen::VectorXd > &list_dofs) const
Compute the discrete L2 norms, for a family of Eigen::VectorXd representing the electric field and po...
Definition: laddr-yangmills-lm.cpp:1506
static YangMills::TMagneticFieldType const_B3_nonlinear
Definition: laddr-yangmills-lm.hpp:784
static YangMills::TLAElectricFieldType const_A
Definition: laddr-yangmills-lm.hpp:753
static YangMills::TElectricFieldType linear_A2
Definition: laddr-yangmills-lm.hpp:587
std::vector< TElectricFieldType > TLAElectricFieldType
Definition: laddr-yangmills-lm.hpp:69
static YangMills::TElectricFieldType const_E1
Definition: laddr-yangmills-lm.hpp:720
static YangMills::TElectricFieldType linear_A1
Definition: laddr-yangmills-lm.hpp:582
Eigen::VectorXd & systemVector()
Returns the linear system right-hand side vector.
Definition: laddr-yangmills-lm.hpp:222
static YangMills::TForcingTermType trigonometric_f1_nonlinear
Definition: laddr-yangmills-lm.hpp:531
std::vector< MagneticFieldType > LAMagneticFieldType
Definition: laddr-yangmills-lm.hpp:66
std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TElectricFieldType
Definition: laddr-yangmills-lm.hpp:61
double stoppingCrit2(const Eigen::VectorXd &Elambda_k, const Eigen::VectorXd &E_i, const Eigen::VectorXd &A_i, const Eigen::VectorXd &sysVec, double dt, double theta, double nonlinear_coeff)
Stops once close enough to system vector for nonlinear problem.
Definition: laddr-yangmills-lm.cpp:609
static YangMills::TForcingTermType trigonometric_f1_linear
Definition: laddr-yangmills-lm.hpp:501
const LAXGrad & laXGrad() const
Returns the space LAXGrad.
Definition: laddr-yangmills-lm.hpp:171
static YangMills::TElectricFieldType trigonometric_dtE2
Definition: laddr-yangmills-lm.hpp:480
std::function< Eigen::Vector3d(const Eigen::Vector3d &)> MagneticFieldType
Definition: laddr-yangmills-lm.hpp:58
static YangMills::TLAMagneticFieldType linear_B_nonlinear
Definition: laddr-yangmills-lm.hpp:657
static YangMills::TMagneticFieldType linear_B1_linear
Definition: laddr-yangmills-lm.hpp:600
static YangMills::TMagneticFieldType linear_B3_linear
Definition: laddr-yangmills-lm.hpp:618
static YangMills::TForcingTermType linear_f2_nonlinear
Definition: laddr-yangmills-lm.hpp:701
static YangMills::TMagneticFieldType const_B1_linear
Definition: laddr-yangmills-lm.hpp:756
std::vector< Eigen::SparseMatrix< double > > systems
Definition: laddr-yangmills-lm.hpp:866
const double & stabilizationParameter() const
Returns the stabilization parameter.
Definition: laddr-yangmills-lm.hpp:227
static YangMills::TLAForcingTermType linear_f_linear
Definition: laddr-yangmills-lm.hpp:692
std::function< outValue(const Eigen::Vector3d &)> contractPara(const TFct &F, double t) const
Takes a two parameter function and a value and returns a function with the first parameter fixed to v...
Definition: laddr-yangmills-lm.hpp:243
static YangMills::TElectricFieldType trigonometric_E2
Definition: laddr-yangmills-lm.hpp:362
std::vector< Eigen::VectorXd > vectors
Definition: laddr-yangmills-lm.hpp:869
static YangMills::TLAMagneticFieldType trigonometric_B_linear
Definition: laddr-yangmills-lm.hpp:439
double computeConstraintNorm(const Eigen::VectorXd &Ch, const size_t itersolver) const
Solves a system to calculate the norm of the constraint (in the dual space of LaXgrad)
Definition: laddr-yangmills-lm.cpp:1578
static YangMills::TLAElectricFieldType trigonometric_dtE
Definition: laddr-yangmills-lm.hpp:498
double & stabilizationParameter()
Returns the stabilization parameter.
Definition: laddr-yangmills-lm.hpp:232
static YangMills::TMagneticFieldType const_B3_linear
Definition: laddr-yangmills-lm.hpp:766
double stoppingCrit(const Eigen::VectorXd &v, const Eigen::VectorXd &u)
Stops once changes become small.
Definition: laddr-yangmills-lm.cpp:597
void assembleLinearSystem(double dt)
Assemble the global system
Definition: laddr-yangmills-lm.cpp:491
const XCurl & xCurl() const
Returns the space XDiv.
Definition: laddr-yangmills-lm.hpp:195
std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TMagneticFieldType
Definition: laddr-yangmills-lm.hpp:62
static YangMills::TElectricFieldType const_dtE2
Definition: laddr-yangmills-lm.hpp:796
static YangMills::TLAMagneticFieldType trigonometric_B_nonlinear
Definition: laddr-yangmills-lm.hpp:469
Eigen::VectorXd computeInitialConditions(const Eigen::MatrixXd &Eh, const Eigen::MatrixXd &Ah, const double nonlinear_coeff, const size_t solver)
Computes the projected initial conditions that satisfy the constraint.
Definition: laddr-yangmills-lm.cpp:1658
static YangMills::TElectricFieldType const_A2
Definition: laddr-yangmills-lm.hpp:743
static YangMills::TElectricFieldType const_E3
Definition: laddr-yangmills-lm.hpp:730
std::vector< ElectricFieldType > LAElectricFieldType
Definition: laddr-yangmills-lm.hpp:65
static YangMills::TLAMagneticFieldType linear_B_linear
Definition: laddr-yangmills-lm.hpp:627
static YangMills::TLAElectricFieldType linear_dtE
Definition: laddr-yangmills-lm.hpp:674
static YangMills::TMagneticFieldType trigonometric_B2_nonlinear
Definition: laddr-yangmills-lm.hpp:451
Eigen::SparseMatrix< double > SystemMatrixType
Definition: laddr-yangmills-lm.hpp:54
std::pair< double, double > computeConditionNum() const
Definition: laddr-yangmills-lm.cpp:572
static YangMills::TLAElectricFieldType const_dtE
Definition: laddr-yangmills-lm.hpp:806
const XDiv & xDiv() const
Returns the space XDiv.
Definition: laddr-yangmills-lm.hpp:201
const SystemMatrixType & systemMatrix() const
Returns the linear system matrix.
Definition: laddr-yangmills-lm.hpp:207
static YangMills::TForcingTermType const_f1_linear
Definition: laddr-yangmills-lm.hpp:809
static YangMills::TLAElectricFieldType linear_A
Definition: laddr-yangmills-lm.hpp:597
static YangMills::TForcingTermType const_f2_linear
Definition: laddr-yangmills-lm.hpp:814
YangMills(const DDRCore &ddrcore, const LieAlgebra &liealgebra, bool use_threads, std::ostream &output=std::cout)
Constructor.
Definition: laddr-yangmills-lm.cpp:443
static YangMills::TElectricFieldType const_dtE3
Definition: laddr-yangmills-lm.hpp:801
static YangMills::TElectricFieldType linear_E3
Definition: laddr-yangmills-lm.hpp:574
static YangMills::TLAElectricFieldType const_E
Definition: laddr-yangmills-lm.hpp:735
static YangMills::TElectricFieldType trigonometric_E3
Definition: laddr-yangmills-lm.hpp:371
Eigen::MatrixXd epsBkt_v(size_t iT, boost::multi_array< double, 3 > &ebkt_T, const Eigen::VectorXd &v) const
Calculates the matrix of *[v,.]^div in element index iT.
Definition: laddr-yangmills-lm.cpp:1323
static YangMills::TLAMagneticFieldType const_B_linear
Definition: laddr-yangmills-lm.hpp:771
const LAXDiv & laXDiv() const
Returns the space LAXCurl.
Definition: laddr-yangmills-lm.hpp:183
static YangMills::TForcingTermType linear_f3_nonlinear
Definition: laddr-yangmills-lm.hpp:707
Eigen::MatrixXd L2v_epsBkt(size_t iT, boost::multi_array< double, 3 > &ebkt_T, const Eigen::VectorXd &v_T, const Eigen::MatrixXd &L2prod) const
Calculates the bracket inside the L2prod with v.
Definition: laddr-yangmills-lm.cpp:1466
const Eigen::VectorXd & systemVector() const
Returns the linear system right-hand side vector.
Definition: laddr-yangmills-lm.hpp:217
static YangMills::TElectricFieldType const_E2
Definition: laddr-yangmills-lm.hpp:725
static YangMills::TForcingTermType const_f3_linear
Definition: laddr-yangmills-lm.hpp:819
static YangMills::TElectricFieldType const_A3
Definition: laddr-yangmills-lm.hpp:748
static YangMills::TForcingTermType trigonometric_f2_linear
Definition: laddr-yangmills-lm.hpp:510
static YangMills::TLAMagneticFieldType const_B_nonlinear
Definition: laddr-yangmills-lm.hpp:789
std::vector< ForcingTermType > LAForcingTermType
Lie algebra valued functions (vector of dim Lie algebra)
Definition: laddr-yangmills-lm.hpp:64
void assembleSystemNewton(const Eigen::VectorXd &E_i, const Eigen::VectorXd &A_i, const Eigen::VectorXd &Elambdac_k, const Eigen::VectorXd &sysVec, double dt, double theta, double nonlinear_coeff)
Assembles the system for Newton iterations.
Definition: laddr-yangmills-lm.cpp:879
void setSystemVector(const Eigen::VectorXd &interp_f, const Eigen::VectorXd &interp_dE, const Eigen::VectorXd &interp_A, const Eigen::VectorXd &E_old, const Eigen::VectorXd &A_old, double dt, double theta, double nonlinear_coeff)
Sets system vector for the nonlinear problem.
Definition: laddr-yangmills-lm.cpp:760
std::vector< TMagneticFieldType > TLAMagneticFieldType
Definition: laddr-yangmills-lm.hpp:70
static YangMills::TMagneticFieldType linear_B3_nonlinear
Definition: laddr-yangmills-lm.hpp:648
std::vector< Fct > contractParaLA(const std::vector< TFct > &TF, double t) const
Takes a vector of two parameter functions and a value and returns a function with the first parameter...
Definition: laddr-yangmills-lm.hpp:250
static YangMills::TLAForcingTermType linear_f_nonlinear
Definition: laddr-yangmills-lm.hpp:713
static YangMills::TLAForcingTermType trigonometric_f_nonlinear
Definition: laddr-yangmills-lm.hpp:557
std::vector< Eigen::MatrixXd > systems
Definition: laddr-yangmills-lm.hpp:853
static YangMills::TLAForcingTermType const_f_nonlinear
Definition: laddr-yangmills-lm.hpp:842
static YangMills::TElectricFieldType trigonometric_A3
Definition: laddr-yangmills-lm.hpp:401
std::vector< Fct > sumLA(const std::vector< Fct > &LAF, const std::vector< Fct > &LAG, double lambda)
Template to evaluate a vector of functions.
Definition: laddr-yangmills-lm.hpp:330
static YangMills::TElectricFieldType linear_dtE3
Definition: laddr-yangmills-lm.hpp:669
bool use_threads
Definition: HHO_DiffAdvecReac.hpp:47
Definition: ddr-magnetostatics.hpp:40
Struct to store the systems that need assembling.
Definition: laddr-yangmills-lm.hpp:847
Struct to store the assembled systems.
Definition: laddr-yangmills-lm.hpp:860
Structure to store norm components.
Definition: laddr-yangmills-lm.hpp:36
Assemble a YangMills problem.
Definition: laddr-yangmills-lm.hpp:53