HArD::Core3D
Hybrid Arbitrary Degree::Core 3D - Library to implement 3D schemes with vertex, edge, face and cell polynomials as unknowns
Public Types | Public Member Functions | List of all members
HArDCore3D::YangMills Struct Reference

Assemble a YangMills problem. More...

#include <laddr-yangmills-lm.hpp>

Public Types

typedef Eigen::SparseMatrix< double > SystemMatrixType
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ForcingTermType
 Base functions. More...
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ElectricFieldType
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> MagneticFieldType
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TForcingTermType
 Base functions with time component. More...
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TElectricFieldType
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TMagneticFieldType
 
typedef std::vector< ForcingTermType > LAForcingTermType
 Lie algebra valued functions (vector of dim Lie algebra) More...
 
typedef std::vector< ElectricFieldType > LAElectricFieldType
 
typedef std::vector< MagneticFieldType > LAMagneticFieldType
 
typedef std::vector< TForcingTermType > TLAForcingTermType
 Lie algebra valued functions with time component. More...
 
typedef std::vector< TElectricFieldType > TLAElectricFieldType
 
typedef std::vector< TMagneticFieldType > TLAMagneticFieldType
 
typedef Eigen::SparseMatrix< double > SystemMatrixType
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ForcingTermType
 Base functions. More...
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> ElectricFieldType
 
typedef std::function< Eigen::Vector3d(const Eigen::Vector3d &)> MagneticFieldType
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TForcingTermType
 Base functions with time component. More...
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TElectricFieldType
 
typedef std::function< Eigen::Vector3d(const double &, const Eigen::Vector3d &)> TMagneticFieldType
 
typedef std::vector< ForcingTermType > LAForcingTermType
 Lie algebra valued functions (vector of dim Lie algebra) More...
 
typedef std::vector< ElectricFieldType > LAElectricFieldType
 
typedef std::vector< MagneticFieldType > LAMagneticFieldType
 
typedef std::vector< TForcingTermType > TLAForcingTermType
 Lie algebra valued functions with time component. More...
 
typedef std::vector< TElectricFieldType > TLAElectricFieldType
 
typedef std::vector< TMagneticFieldType > TLAMagneticFieldType
 

Public Member Functions

 YangMills (const DDRCore &ddrcore, const LieAlgebra &liealgebra, bool use_threads, std::ostream &output=std::cout)
 Constructor. More...
 
void assembleLinearSystem (double dt)
 Assemble the global system
More...
 
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. More...
 
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. More...
 
double stoppingCrit (const Eigen::VectorXd &v, const Eigen::VectorXd &u)
 Stops once changes become small. More...
 
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. More...
 
void addBoundaryConditions (const LAMagneticFieldType &curl_A, double dt)
 Adds boundary condition for chosen solution to the system vector. More...
 
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. More...
 
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. More...
 
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]) More...
 
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. More...
 
size_t dimension () const
 Returns the global problem dimension. More...
 
size_t sizeSystem () const
 Returns the size of the system. More...
 
const LieAlgebra & lieAlg () const
 Returns the Lie algebra. More...
 
const LAXGrad & laXGrad () const
 Returns the space LAXGrad. More...
 
const LAXCurl & laXCurl () const
 Returns the space LAXCurl. More...
 
const LAXDiv & laXDiv () const
 Returns the space LAXCurl. More...
 
const XGrad & xGrad () const
 Returns the space XDiv. More...
 
const XCurl & xCurl () const
 Returns the space XDiv. More...
 
const XDiv & xDiv () const
 Returns the space XDiv. More...
 
const SystemMatrixType & systemMatrix () const
 Returns the linear system matrix. More...
 
SystemMatrixType & systemMatrix ()
 Returns the linear system matrix. More...
 
const Eigen::VectorXd & systemVector () const
 Returns the linear system right-hand side vector. More...
 
Eigen::VectorXd & systemVector ()
 Returns the linear system right-hand side vector. More...
 
const double & stabilizationParameter () const
 Returns the stabilization parameter. More...
 
double & stabilizationParameter ()
 Returns the stabilization parameter. More...
 
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 potential. More...
 
template<typename outValue , typename TFct >
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 value. More...
 
template<typename outValue , typename Fct , typename TFct >
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 fixed to value. More...
 
double computeResidual (const Eigen::VectorXd &x) const
 Calculates residual with current matrix and rhs from given x (m_A*x = m_b) More...
 
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. More...
 
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) More...
 
std::pair< double, double > computeConditionNum () const
 
 YangMills (const DDRCore &ddrcore, const LADDRCore &laddrcore, const LieAlgebra &liealgebra, size_t nonlinear_discretisation, bool use_threads, std::ostream &output=std::cout)
 Constructor. More...
 
void assembleLinearSystem (double dt)
 Assemble the global system
More...
 
void setSystemVector (const Eigen::VectorXd &interp_f, const Eigen::VectorXd &interp_dE, const Eigen::VectorXd &interp_A, const Eigen::VectorXd &E_i, const Eigen::VectorXd &A_i, double dt, double theta, double nonlinear_coeff)
 Sets system vector for the nonlinear problem. More...
 
void assembleSystemNewton (const Eigen::VectorXd &E_i, const Eigen::VectorXd &A_i, const Eigen::VectorXd &Elambda_k, double dt, double theta, double nonlinear_coeff)
 Assembles the system for Newton iterations. More...
 
double stoppingCrit (const Eigen::VectorXd &v, const Eigen::VectorXd &u)
 Stops once changes become small. More...
 
void setNonlinearRes (const Eigen::VectorXd &Elambda_k, const Eigen::VectorXd &E_i, const Eigen::VectorXd &A_i, double dt, double theta, double nonlinear_coeff)
 Sets the nonlinear residual vector b-F(x_k) in m_b_k. More...
 
void addBoundaryConditions (const LAMagneticFieldType &curl_A, double dt)
 Adds boundary condition for chosen solution to the system vector. More...
 
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. More...
 
std::vector< Eigen::MatrixXd > epsBkt_v (size_t iT, boost::multi_array< double, 3 > &crossij_Pot_T, const std::vector< Eigen::VectorXd > &vec_list) const
 
std::vector< Eigen::MatrixXd > L2v_Bkt (size_t iT, boost::multi_array< double, 3 > &intPciPcjPgk, const std::vector< Eigen::VectorXd > &vec_list, const size_t &entry) const
 Wrapper to plug vector into L2 integral product: int (Pcurl 1,[Pcurl 2, Pgrad 3]) More...
 
std::vector< Eigen::MatrixXd > L2v_epsBkt (size_t iT, boost::multi_array< double, 3 > &crossij_Pot_T, const std::vector< Eigen::VectorXd > &v_L2prod) const
 
size_t dimensionSpace () const
 Returns the global problem dimension. More...
 
size_t nbSCDOFs_E () const
 Returns the number of statically condensed DOFs (Electric field) More...
 
size_t nbSCDOFs_lambda () const
 Returns the number of statically condensed DOFs (lambda) More...
 
size_t nbSCDOFs () const
 Returns the number of statically condensed DOFs (both velocity and pressure) More...
 
size_t sizeSystem () const
 Returns the size of the system. More...
 
const LieAlgebra & lieAlg () const
 Returns the Lie algebra. More...
 
const LASXGrad & laSXGrad () const
 Returns the space LAXGrad. More...
 
const LASXCurl & laSXCurl () const
 Returns the space LAXCurl. More...
 
const LASXDiv & laSXDiv () const
 Returns the space LAXCurl. More...
 
const SXGrad & xSGrad () const
 Returns the space XDiv. More...
 
const SXCurl & xSCurl () const
 Returns the space XDiv. More...
 
const SXDiv & xSDiv () const
 Returns the space XDiv. More...
 
const SystemMatrixType & systemMatrix () const
 Returns the linear system matrix. More...
 
SystemMatrixType & systemMatrix ()
 Returns the linear system matrix. More...
 
const Eigen::VectorXd & systemVectorNewton () const
 Returns the linear system right-hand side vector. More...
 
Eigen::VectorXd & systemVectorNewton ()
 Returns the linear system right-hand side vector. More...
 
const Eigen::VectorXd & systemVector () const
 Returns the right-hand side to the nonlinear problem. More...
 
Eigen::VectorXd & systemVector ()
 Returns the right-hand side to the nonlinear problem. More...
 
const Eigen::VectorXd & nonlinearRes () const
 Returns the right-hand side to the nonlinear problem. More...
 
Eigen::VectorXd & nonlinearRes ()
 Returns the right-hand side to the nonlinear problem. More...
 
const SystemMatrixType & scMatrix () const
 Returns the static condensation recovery operator. More...
 
Eigen::VectorXd & scVector ()
 Returns the static condensation rhs. More...
 
const double & stabilizationParameter () const
 Returns the stabilization parameter. More...
 
double & stabilizationParameter ()
 Returns the stabilization parameter. More...
 
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 potential. More...
 
template<typename outValue , typename TFct >
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 value. More...
 
template<typename outValue , typename Fct , typename TFct >
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 fixed to value. More...
 
double computeResidual (const Eigen::VectorXd &x) const
 Calculates residual with current matrix and rhs from given x (m_A*x = m_b) More...
 
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. More...
 
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) More...
 
std::pair< double, double > computeConditionNum () const
 

Detailed Description

Assemble a YangMills problem.


The documentation for this struct was generated from the following files: