12#ifndef BELFEM_CL_FEM_DOFMGR_SOLVERDATA_HPP
13#define BELFEM_CL_FEM_DOFMGR_SOLVERDATA_HPP
85 const index_t & mNumberOfFreeDofs ;
86 const index_t & mNumberOfFixedDofs ;
89 const index_t & mMyNumberOfFreeDofs ;
90 const index_t & mMyNumberOfFixedDofs ;
91 const index_t & mMyNumberOfHangingDofs ;
102 SpMatrix * mSystemMatrix = nullptr ;
103 SpMatrix * mEnforcementMatrix = nullptr ;
104 SpMatrix * mDirichletMatrix = nullptr ;
105 SpMatrix * mImpositionMatrix = nullptr ;
107 SpMatrix * mFullMassMatrix = nullptr ;
108 SpMatrix * mFullStiffnessMatrix = nullptr ;
109 SpMatrix * mJacobianMatrix = nullptr ;
156 bool mResidualReady = false ;
194 Solver * mSolver = nullptr ;
197 bool mUseResetValues = false ;
207 bool mUseJediForce = false ;
208 bool mUseFullForce = false ;
214 uint mAndersonDepth = 0 ;
226 bool mAndersonStaged = false ;
265 Graph & aFixedDofs );
431 mResidualReady = false ;
451 return mAbsoluteResidual ;
465 return mPreUpdateResidual ;
477 return mFixedPointResidual ;
625 bool aLinkToSelf =
true );
642 compute_dof_dof_connectivity(
680 return mSystemMatrix ;
688 return mEnforcementMatrix ;
696 return mDirichletMatrix ;
704 return mImpositionMatrix ;
728 return mVolumeLoads ;
744 return mNumberOfFreeDofs ;
752 return mNumberOfFixedDofs ;
760 return mMyNumberOfFreeDofs ;
768 return mMyNumberOfFixedDofs ;
776 mUseResetValues = aFlag ;
786 case System:
return mSystemMatrix ;
787 case Jacobian:
return mJacobianMatrix ;
789 case Dirichlet:
return mDirichletMatrix ;
791 case FullMass:
return mFullMassMatrix ;
793 default:
return nullptr ;
804 case System:
return mSystemTable ;
805 case Jacobian:
return mJacobianTable ;
809 case FullMass:
return mFullMatrixTable ;
814 return mSystemTable ;
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Hierarchical data format I/O.
Definition cl_HDF5.hpp:39
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
Fixed-capacity FIFO with history, for time-stepping.
Definition cl_ShiftRegister.hpp:74
Unified interface to the sparse direct solvers.
Definition cl_Solver.hpp:34
Configuration for a Solver.
Definition cl_SolverParameters.hpp:27
Sparse matrix in CSR or CSC format.
Definition cl_SpMatrix.hpp:52
this class creates the DOFs based on the passed equation object.
Definition cl_FEM_DofManager.hpp:55
Definition cl_FEM_Element.hpp:41
Prototype for Integrator of Weak Form Governing Equation.
Definition cl_IWG.hpp:81
Top-level orchestrator; owns the mesh, materials, boundary conditions and DOF managers.
Definition cl_FEM_Kernel.hpp:50
Definition cl_FEM_DofMgr_BlockData.hpp:32
Definition cl_FEM_DofMgr_DofData.hpp:36
Definition cl_FEM_DofMgr_SideSetData.hpp:39
void solve_from_residual()
Phase 2: consume the residual left by compute_residual(), run the linear solve and the algorithm's up...
Definition cl_FEM_DofMgr_SolverData.cpp:2403
void save_system(const string &aPath)
Definition cl_FEM_DofMgr_SolverData.cpp:2665
index_t my_number_of_free_dofs() const
Definition cl_FEM_DofMgr_SolverData.hpp:758
void use_reset_values(const bool aFlag)
Definition cl_FEM_DofMgr_SolverData.hpp:774
void load_system(const string &aPath)
Definition cl_FEM_DofMgr_SolverData.cpp:2684
SpMatrix * system_matrix()
Definition cl_FEM_DofMgr_SolverData.hpp:678
void use_full_force(const bool aFlag)
Definition cl_FEM_DofMgr_SolverData.cpp:212
SpMatrix * matrix(const MatrixType aType)
Definition cl_FEM_DofMgr_SolverData.hpp:782
Solver * solver()
expose the solver
Definition cl_FEM_DofMgr_SolverData.hpp:670
void assemble_volume_loads(Element *aElement, const Vector< real > &aRHS)
Definition cl_FEM_DofMgr_SolverData.cpp:1780
void reset_convection()
Definition cl_FEM_DofMgr_SolverData.cpp:153
void solve()
solve the system.
Definition cl_FEM_DofMgr_SolverData.cpp:2066
index_t number_of_fixed_dofs() const
Definition cl_FEM_DofMgr_SolverData.hpp:750
SpMatrix * enforcement()
Definition cl_FEM_DofMgr_SolverData.hpp:686
void allocate_matrices(const Vector< id_t > &aGraphData, Graph &aFreeDofs, Graph &aFixedDofs)
Allocates sparse matrices for the finite element system.
Definition cl_FEM_DofMgr_SolverData.cpp:271
void reset_rhs_vector()
Definition cl_FEM_DofMgr_SolverData.cpp:1553
void collect_matrices(const bool aFullForce=false)
Definition cl_FEM_DofMgr_SolverData.cpp:1847
void update_field_values()
Definition cl_FEM_DofMgr_SolverData.cpp:2023
void set_anderson_depth(const uint aDepth)
activate ( depth > 0 ) or deactivate ( depth = 0 ) Anderson mixing of the Picard branch; allocates th...
Definition cl_FEM_DofMgr_SolverData.cpp:2799
Vector< real > & rhs_vector()
Definition cl_FEM_DofMgr_SolverData.hpp:710
real fixed_point_residual() const
fixed-point residual ||G(x)-x|| / ||x|| of the last Anderson update ( rank-uniform after residual() )
Definition cl_FEM_DofMgr_SolverData.hpp:475
void use_jedi_force(const bool aFlag)
Definition cl_FEM_DofMgr_SolverData.cpp:204
void invalidate_residual()
invalidate the two-phase handshake; called by a fresh assembly
Definition cl_FEM_DofMgr_SolverData.hpp:429
void assemble_rhs(Element *aElement, const Vector< real > &aRHS)
Definition cl_FEM_DofMgr_SolverData.cpp:1760
void anderson_discard()
drop the staged pair ( trial was rejected )
Definition cl_FEM_DofMgr_SolverData.cpp:2843
real pre_update_residual() const
pre-update residual of the entry state under the current assembly ( Newton iterates only,...
Definition cl_FEM_DofMgr_SolverData.hpp:463
void compute_memory()
Definition cl_FEM_DofMgr_SolverData.cpp:431
Vector< real > & surface_loads()
Definition cl_FEM_DofMgr_SolverData.hpp:734
void collect_rhs_matrix()
Definition cl_FEM_DofMgr_SolverData.cpp:1975
real residual(const uint aIteration)
return the residual
Definition cl_FEM_DofMgr_SolverData.cpp:2562
real absolute_residual() const
absolute residual norm of the last residual() call ( rank-uniform, broadcast alongside the relative v...
Definition cl_FEM_DofMgr_SolverData.hpp:449
void create_assembly_tables()
Definition cl_FEM_DofMgr_SolverData.cpp:602
void reset_rhs_matrix()
Definition cl_FEM_DofMgr_SolverData.cpp:1569
void reset_matrices(const bool aFullForce=false)
Definition cl_FEM_DofMgr_SolverData.cpp:1482
void anderson_clear()
invalidate the history ( new attempt, algorithm switch, restore, ... ); also drops any staged pair
Definition cl_FEM_DofMgr_SolverData.cpp:2851
void compute_residual()
Phase 1 of the two-phase iterative solve: prepare the load-adjusted RHS b, capture ||b||,...
Definition cl_FEM_DofMgr_SolverData.cpp:2289
void remember_initialization_values(const bool aSaveRHS)
Definition cl_FEM_DofMgr_SolverData.cpp:2613
void populate_graph(const Vector< id_t > &aData, const MatrixType aMatrixType, Graph &aFreeDofs, Graph &aFixedDofs, bool aLinkToSelf=true)
Builds vertex connectivity for sparse matrix sparsity patterns.
Definition cl_FEM_DofMgr_SolverData.cpp:786
void assemble_jacobian(Element *aElement, const Matrix< real > &aJacobian)
Definition cl_FEM_DofMgr_SolverData.cpp:1585
index_t number_of_free_dofs() const
Definition cl_FEM_DofMgr_SolverData.hpp:742
void reset()
Definition cl_FEM_DofMgr_SolverData.cpp:100
void assemble_full_matrices(Element *aElement, const Matrix< real > &aMass, const Matrix< real > &aStiffness)
Definition cl_FEM_DofMgr_SolverData.cpp:1718
index_t my_number_of_fixed_dofs() const
Definition cl_FEM_DofMgr_SolverData.hpp:766
void collect_rhs_vector()
Definition cl_FEM_DofMgr_SolverData.cpp:1917
Vector< real > & volume_loads()
Definition cl_FEM_DofMgr_SolverData.hpp:726
SpMatrix * imposition()
Definition cl_FEM_DofMgr_SolverData.hpp:702
void extract_graph_from_mesh(Vector< id_t > &aGraphData)
Definition cl_FEM_DofMgr_SolverData.cpp:161
SolverData(DofManager *aParent, DofData *aDofData, BlockData *aBlockData, SideSetData *aSideSetData)
Definition cl_FEM_DofMgr_SolverData.cpp:57
void anderson_commit()
move the staged ( x, r ) pair into the history; called by the controller once the trial iterate is ac...
Definition cl_FEM_DofMgr_SolverData.cpp:2823
real rhs_norm()
Definition cl_FEM_DofMgr_SolverData.hpp:718
Cell< Vector< index_t > > & tables(const MatrixType aType)
Definition cl_FEM_DofMgr_SolverData.hpp:800
SpMatrix * dirichlet()
Definition cl_FEM_DofMgr_SolverData.hpp:694
void collect_vector(Vector< real > &aVector)
Definition cl_FEM_DofMgr_SolverData.cpp:1925
void asseble_surface_loads(Element *aElement, const Vector< real > &aRHS)
Definition cl_FEM_DofMgr_SolverData.cpp:1801
void assemble_newton(Element *aElement, const Matrix< real > &adJdx)
Definition cl_FEM_DofMgr_SolverData.cpp:1674
void set_solver(const SolverParameters &aParams)
set the solver type for this field
Definition cl_FEM_DofMgr_SolverData.cpp:2047
Definition cl_FEM_DofMgr_BearingData.cpp:23
MatrixType
Matrix type enumeration in JEDI order.
Definition cl_FEM_DofMgr_SolverData.hpp:49
@ FullMass
Definition cl_FEM_DofMgr_SolverData.hpp:56
@ Dirichlet
Definition cl_FEM_DofMgr_SolverData.hpp:54
@ FullStiffness
Definition cl_FEM_DofMgr_SolverData.hpp:57
@ System
Definition cl_FEM_DofMgr_SolverData.hpp:50
@ Jacobian
Definition cl_FEM_DofMgr_SolverData.hpp:51
@ Enforcement
Definition cl_FEM_DofMgr_SolverData.hpp:53
@ Imposition
Definition cl_FEM_DofMgr_SolverData.hpp:55
Definition cl_IFB_LINE3.hpp:21
string to_string(const BoundaryConditionType aBoundaryConditiontype)
Definition en_FEM_BoundaryConditionType.cpp:23
USER GUIDES:
Definition cl_Capacitor.cpp:16
Cell< graph::Vertex * > Graph
Definition cl_Graph_Vertex.hpp:329
unsigned int uint
Definition typedefs.hpp:30
int proc_t
Definition commtypes.hpp:29
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_REAL_MAX
Definition typedefs.hpp:81
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87