hp2FEM  0.1
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
Solver Class Reference

Generic solver algorithms that store the instance of the Model class and the common variables for all solver types,. More...

#include <Solver.h>

Inheritance diagram for Solver:
Inheritance graph
[legend]
Collaboration diagram for Solver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Solver ()
 Default constructor (without parameters): the class attributes are initialized with default values.
 ~Solver ()
 Destructor.
 Solver (Solver &Instance)
 Copy-initializer constructor. Copies the contents of Instance to the current object,.
Solveroperator= (Solver &Instance)
 Copies the contents of Instance to the current object,.
void SetSolverAttributes (SolverParam_S &SolverParameters)
 Sets the class attributes to be stored in the SolverParam_S instance.
void SetSolverAttributes (SolverType_E SolvType, MassStiffType_E MassType, StiffnessType_E StiffType, ContactModel_E ContactMod, ContactSolver_E ContactSol, LinearSystemSolutionMethod_E LSMethod, unsigned long LSMaxIt, double LSPrec, SolutionAlgorithm_E SoluAlgorithm, unsigned long SolMaxIt, double SolPrec, unsigned long NumLoadSteps, AnalysisType_E Atype, OperatorType_E OpType, double to, double tf, unsigned long NTS, unsigned long FrictionCoef, double PenaltyParameter, unsigned long ContactInteOrder, TimeIntegrationMeth_E TimeIntMeth, unsigned long OutFreqNR, unsigned long OutFreqTime)
 Sets the class attributes as input parameters to be stored in the SolverParam_S instance.
void SetTheoreticalSolutionParameters (TheoreticalSolution_S &TheoSol)
 Sets the pameters for theoretical solution.
LinearSystemSolutionMethod_E GetLSMethod ()
 Returns the type of algorithm used for linear system solution.
ContactSolver_E GetContactIntegrationMethod ()
 Returns the type of contact integration method.
ContactModel_E GetContactFrictionCondition ()
 Returns the type of tangential contact condition (friction or frictionless)
unsigned long GetFrictionCoef ()
 Returns the type of tangential contact condition (friction or frictionless)
SolverType_E GetSolverType ()
 Returns the solver type.
OperatorType_E GetOperatorType ()
 Returns the operator type.
unsigned long GetIterativeSolutionMaxIterations ()
 Returns the maximum number of iterations for the iterative solution of linear systems.
double GetIterativeSolutionPrecision ()
 Returns the precision required in the solution of linear systems using iterative algorithms.
SolutionAlgorithm_E GetSolutionAlgorithm ()
 Returns the type of algorithm to be used in the solution of the discrete model.
unsigned long GetSolutionMaxIterations ()
 Returns the maximum number of iterations for the solution of a load step in nonlinear problems.
double GetNewtonRaphsonSolutionPrecision ()
 Returns the precision required in the solution of a load step in nonlinear problems.
unsigned long GetNumberLoadSteps ()
 Returns the number of load steps in which a load set is subdivided.
void PostProcessing (PostProcessorProgram_E PostProgram)
 Setls the postprocessing software and runs the specific procedure to print the output file.
void Read (FILE *FEMFile, FILE *DEFFile, FILE *LogFile)
 Reads parameters of the analysis from the .fem and .def ASCII files.
virtual void Run ()=0

Public Attributes

TheoreticalSolution_StheTheoreticalSolution_S
SolverParam_StheSolverParam_S
PartitionDatathePartitionData

Protected Member Functions

void ExportGiDMeshFile (char *FileName, FEGroups &Groups, Nodes &Nds)
 Exports the FE solution to the GID format.
void ExportGiDResFile (char *FileName, FEGroups &Groups, Nodes &Nds)
 Exports the FE solution to the GID format.
void ExportGMSHFile (char *FileName, FEGroups &Groups, Nodes &Nds, double *Solution)
 Exports the FE solution to the GMESH format.
void ExportHyperMeshFile (char *FileName, FEGroups &Groups, Nodes &Nds, double *Solution)
 Exports the FE solution to the HyperMesh format.
void ComputeErrorNorm ()
 Computes the error norms in the approximated solution when a theoretical solution is given.
void ComputeErrorNorm_Parallel (Vector &UPart)
 Computes the error norms in the approximated solution when a theoretical solution is given.
void ComputeErrorNorm1DMatrices ()
 Computes the error norms in the approximated solution when a theoretical solution is given.
void ComputeErrorNorm1DMatrices_Parallel (Vector &UPart)
 Computes the error norms using 1D matrices procedure in the approximated solution when a theoretical solution is given.
void MatrixSchurComplement (SymmetricMatrix &A, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We store the factorized internal part in the same symmetric matrix for later use.
void MatrixSchurComplement (SymmetricMatrix &A, double *Aint, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We store the factorized internal part in auxiliary array Aint for later use. This method is used in dynamic problems.
void MatrixMatrixSchurComplement (SymmetricMatrix &A, double *B, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given matrix using blocks AB and BB from another matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. This method is used in dynamic problems.
void MatrixVectorSchurComplement (SymmetricMatrix &A, double *B, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given matrix and vector. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We later solve the internal part by applying a linear system solver.
void VectorSchurComplement (double *A, double *B, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given vector. The symmetric matrix is complemented in the boundary and the internal part is factorized.
void VectorSchurComplement (double *A, double *Aint, double *B, unsigned long NBD, unsigned long NID)
 Computes the Schur complement for the given vector.
void RecoverInternalSolSchur (double *A, double *B, double *Usol, unsigned long NBD, unsigned long NID, double c=1)
 Computes the Schur complement for the given vector. The symmetric matrix is complementd in the boundary and its internal part is factorized.
void RecoverInternalSolSchur (double *A, double *Aint, double *B, double *Usol, unsigned long NBD, unsigned long NID, double c=1)
 Computes the Schur complement for the given vector.
void LinearSystemSolutionContact (SymmetricMatrix &A, double *F, unsigned long LSNum)
 Solves the linear system according to the chose algorithm.
void LinearSystemSolutionContact (SymmetricMatrix &A, double *F, unsigned long LSNum, Vector &U)
 Solves the linear system according to the chose algorithm.
void SetLoadIncidSchur (unsigned long &NLoadedElem)
 This function sets the load incidence used to index the element load vectors used in the schur complement.

Protected Attributes

TheoreticalSolution_S TheoSolu
 This variable stores a struct with the atributtes related to the theoretical solution.
SolverParam_S SolvParam
 This variable stores a struct with some atributtes of the Solver class which specifies the solution parameters (solvtype, masstype, stiffness, t0, tf, Atype, etc).
Model GlobalModel
 Instance of the Model class that store the attributes of the finite element model.
PartitionData PartitionInformations
 Store the informations for each partition.
OneIndexTable< double > ElemMassMatrices
 Stores the element mass matrices,.
OneIndexTable< double > ElemStiffMatrices
 Stores the element stiffness matrices,.
OneIndexTable< double > ElemEffMatrices
 Stores the element effective matrices.
OneIndexTable< double > ElemInternalMatrices
 Stores the element internal factorized matrix for the schur complement, according to the problem.
OneIndexTable< double > ElemLoadVectors
 Stores the element load vectors,.
Vector PatchMeas
 Store the patch measures for each node of the mesh.
Vector AuxCoords
 Auxiliary coordinates vector.
SymmetricMatrix LocalMassMatrix
 Local mass matrix, stored as a class variable.
SymmetricMatrix LocalStiffMatrix
 Local stiffness matrix, stored as a class variable.
OneIndexTable< double > U
 Stores the solution vectors for each load/time step.
Vector Displacement
OneIndexTable< double > Upt
 Stores the velocity/first derivatives vectors for each load/time step.
OneIndexTable< double > U2pt
 Stores the acceleration/second derivatives vectors for each load/time step.
TwoIndexTable< double > StrainSol
 Stores the solution for the strain and extra strain fields for each load/time step.
TwoIndexTable< double > StressSol
 Stores the solution for the stress and extra stress fields for each load/time step.
SymmetricMatrix ContactStiffMatrix
 Global Symmetric contact stiffness matrix.
SymmetricMatrix Kc
 Global auxiliary Symmetric contact stiffness matrix.
TwoIndexTable< double > ExtraSol
 Stores the solution for the extra fields for each load/time step.
Vector incU
 Vector of primary unknown increments for the NR iterations.
Vector Fint
OneIndexTable< double > F
 Global vector of equivalent nodal forces.
Vector FeAux
 Auxiliary class load vector.
OneIndexTable< double > Fgr
 Global vector of nodal force for each time step.
OneIndexTable< double > Press
 Global vector of equivalent nodal pressure.
Vector Load
 Vector of unbalanced forces.
Vector ContactResidual
 Vector of contact residual.
Vector ContStressIP
 Vector of contact stress on integration points.
Vector ContStressCP
 Vector of contact stress on collocation points.
Vector ContGap
 Vector of contact gap function values on integration points.
Vector ContCondition
 Vector of contact gap condition ContCondition = 0 - integrantion point deactivated ContCondition = 1 - integrantion point activated.
Vector StressPosition
 Vector of contact stress position.
BuiltInArray< long > LoadIncidSchur
 This is an auxiliary index array used to attribute the different types of loads to the variable ElemLoadVectors, and is necessary to perform the Schur complement at the element load vectors.
Vector ElemLoad
 Element load class variable. It is allocated according to the group with the highest number of degrees of freedom.
Vector InternalForce
 Internal force vector stored as a class variable.
Vector Damage
 Damage vector for the integration points.
OneIndexTable< double > React
 Vector of reaction forces.
char * PreFileName
 Prefix of the filename.
Matrix ErrorNorm
 Stores the error norms (L2, Linf) for simulations that have a theorical solution.
long SchurFlag
 Flag that indicates wheter the Schur complement was calculated: 1 for Schur; 0 for non Schur.
SymmetricMatrix Schur_AA
 Auxiliary symmetric matrix used by the schur complement method.
SymmetricMatrix Schur_BB
 Auxiliary symmetric matrix used by the schur complement method.
Matrix Schur_AB
 Auxiliary matrix used by the schur complement method.
Matrix Schur_AB_Aux
 Auxiliary matrix used by the schur complement method.
Matrix Schur_Mat_Aux
 Auxiliary matrix used by the schur complement method.
Vector Schur_Vec_Aux
 Auxiliary vector used by the schur complement.
Vector Schur_Vec_Aux1
 Auxiliary vector used by the schur complement.
Vector Schur_fi
 auxiliary vector used for the Schur complement.
Vector Schur_fb
 auxiliary vector used for the Schur complement.
Vector LoadAux
 Auxiliary vector used for element loads using the Schur complement.
Vector InternalMassME
 Auxiliary vector used to store the internal part of the global mass matrix.

Detailed Description

Generic solver algorithms that store the instance of the Model class and the common variables for all solver types,.

Author:
Marco Lucio Bittencourt/ Fabiano Fernandes Bargos
Date:
April/15/2011

Constructor & Destructor Documentation

Solver::Solver ( Solver Instance)

Copy-initializer constructor. Copies the contents of Instance to the current object,.

Parameters:
[in]Instance- instance of the solver class.
Returns:
Reference to the current object.

Member Function Documentation

void Solver::ComputeErrorNorm1DMatrices_Parallel ( Vector UPart) [protected]

Computes the error norms using 1D matrices procedure in the approximated solution when a theoretical solution is given.

this error norm is computed in parallel

Parameters:
[in]UPart- Array solution for one partition.
void Solver::ComputeErrorNorm_Parallel ( Vector UPart) [protected]

Computes the error norms in the approximated solution when a theoretical solution is given.

this error norm is computed in parallel

Parameters:
[in]UPart- Array solution for one partition.
void Solver::ExportGiDMeshFile ( char *  FileName,
FEGroups Groups,
Nodes Nds 
) [protected]

Exports the FE solution to the GID format.

Parameters:
[in]FileName- name of the result file.
[in]Groups- instance of the FEGroups class which stores information for the finite element groups for the discrete model.
[in]Nds- instance of the Nodes class which store the nodal coordinates of the discrete model.
[in]Solution- pointer to the soluction array.
void Solver::ExportGiDResFile ( char *  FileName,
FEGroups Groups,
Nodes Nds 
) [protected]

Exports the FE solution to the GID format.

Parameters:
[in]FileName- name of the result file.
[in]Groups- instance of the FEGroups class which stores information for the finite element groups for the discrete model.
[in]Nds- instance of the Nodes class which store the nodal coordinates of the discrete model.
[in]Solution- pointer to the soluction array.
void Solver::ExportGMSHFile ( char *  FileName,
FEGroups Groups,
Nodes Nds,
double *  Solution 
) [protected]

Exports the FE solution to the GMESH format.

Parameters:
[in]FileName- name of the result file.
[in]Groups- instance of the FEGroups class which stores information for the finite element groups for the discrete model.
[in]Nds- instance of the Nodes class which store the nodal coordinates of the discrete model.
[in]Solution- pointer to the soluction array.
void Solver::ExportHyperMeshFile ( char *  FileName,
FEGroups Groups,
Nodes Nds,
double *  Solution 
) [protected]

Exports the FE solution to the HyperMesh format.

Parameters:
[in]FileName- name of the result file.
[in]Groups- instance of the FEGroups class whichStores information for the finite element groups for the discrete model.
[in]Nds- instance of the Nodes class which store the nodal coordinates of the discrete model.
[in]Solution- pointer to the soluction array.

Returns the type of tangential contact condition (friction or frictionless)

Returns:
tangential contact condition

Returns the type of contact integration method.

Returns:
contact integration method flag
unsigned long Solver::GetFrictionCoef ( )

Returns the type of tangential contact condition (friction or frictionless)

Returns:
tangential contact condition

Returns the maximum number of iterations for the iterative solution of linear systems.

Returns:
maximum number of iterations as a long.

Returns the precision required in the solution of linear systems using iterative algorithms.

Returns:
precision for linear system solution as a double.
LinearSystemSolutionMethod_E Solver::GetLSMethod ( )

Returns the type of algorithm used for linear system solution.

Returns:
algorithm for linear system solution as a LinearSystemSolutionMethod_E enum value.

Returns the precision required in the solution of a load step in nonlinear problems.

Returns:
precision for nonlinear problems as a double.
unsigned long Solver::GetNumberLoadSteps ( )

Returns the number of load steps in which a load set is subdivided.

Returns:
number of load steps in which a load set is subdivided as a long
OperatorType_E Solver::GetOperatorType ( )

Returns the operator type.

Returns:
Operator type as a OperatorType_E enum value.
SolutionAlgorithm_E Solver::GetSolutionAlgorithm ( )

Returns the type of algorithm to be used in the solution of the discrete model.

Returns:
algorithm for solution as a SolutionAlgorithm_E type.

Returns the maximum number of iterations for the solution of a load step in nonlinear problems.

Returns:
maximum number of iterations as a long
SolverType_E Solver::GetSolverType ( )

Returns the solver type.

Returns:
solver type as a SolverType_E enum value.
void Solver::LinearSystemSolutionContact ( SymmetricMatrix A,
double *  F,
unsigned long  LSNum 
) [protected]

Solves the linear system according to the chose algorithm.

Parameters:
[in]A- matrix.
[in]F- vector.
void Solver::LinearSystemSolutionContact ( SymmetricMatrix A,
double *  F,
unsigned long  LSNum,
Vector U 
) [protected]

Solves the linear system according to the chose algorithm.

Parameters:
[in]A- matrix.
[in]F- vector.
[out]U- Solution vector
void Solver::MatrixMatrixSchurComplement ( SymmetricMatrix A,
double *  B,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given matrix using blocks AB and BB from another matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. This method is used in dynamic problems.

Parameters:
[in]A- Matrix to perform the schur complement.
[in]B- Matrix which we use blocks AB and BB to complement matrix A.
[in]NBD- number of boundary dofs
[in]NID- number of internal dofs
void Solver::MatrixSchurComplement ( SymmetricMatrix A,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We store the factorized internal part in the same symmetric matrix for later use.

Parameters:
[in]A- matrix to perform the schur complement
[in]NBD- number of boundary dofs
[in]NID- number of internal dofs
void Solver::MatrixSchurComplement ( SymmetricMatrix A,
double *  Aint,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given matrix. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We store the factorized internal part in auxiliary array Aint for later use. This method is used in dynamic problems.

Parameters:
[in]A- matrix to perform the schur complement
[in]Aint- Internal part of A, to be stored in factorized form.
[in]NBD- number of boundary dofs
[in]NID- number of internal dofs
void Solver::MatrixVectorSchurComplement ( SymmetricMatrix A,
double *  B,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given matrix and vector. We modify the boundary DOFs but we do not perform the inverse operation on the internal dofs. We later solve the internal part by applying a linear system solver.

Parameters:
[in]A- Symmetric matrix to perform the schur complement
[in]B- Vector to perform the schur complement
[in]NBD- number of boundary dofs
[in]NID- number of internal dofs
Solver & Solver::operator= ( Solver Instance)

Copies the contents of Instance to the current object,.

Parameters:
[in]Instance- instance of the solver class.
Returns:
Reference to the current object.
void Solver::PostProcessing ( PostProcessorProgram_E  PostProgram)

Setls the postprocessing software and runs the specific procedure to print the output file.

Parameters:
[in]PostProgram- post-processing software.
void Solver::Read ( FILE *  FEMFile,
FILE *  DEFFile,
FILE *  LogFile 
)

Reads parameters of the analysis from the .fem and .def ASCII files.

Parameters:
[in]FEMFile- pointer to the .fem mesh file.
[in]DEFFile- pointer to the .def attributes file.
[in]LogFile- pointer to the .log file.
[in]DataBaseName- database name.
void Solver::RecoverInternalSolSchur ( double *  A,
double *  B,
double *  Usol,
unsigned long  NBD,
unsigned long  NID,
double  c = 1 
) [protected]

Computes the Schur complement for the given vector. The symmetric matrix is complementd in the boundary and its internal part is factorized.

Parameters:
[in]A- Symmetric matrix used in the Schur complement
[in]F- Force vector, only the internal dofs
[in]U- Solution vector
[in]NBD- Number of element boundary dofs
[in]NID- Number of element internal dofs
[in]const- Constant to multiply the element mass matrix.
void Solver::RecoverInternalSolSchur ( double *  A,
double *  Aint,
double *  B,
double *  Usol,
unsigned long  NBD,
unsigned long  NID,
double  c = 1 
) [protected]

Computes the Schur complement for the given vector.

Parameters:
[in]A- Symmetric matrix used in the Schur complement
[in]Aint- double pointer containing the internal part of the symmetric matrix
[in]F- Force vector, only the internal dofs
[in]U- Solution vector
[in]NBD- Number of element boundary dofs
[in]NID- Number of element internal dofs
[in]const- Constant to multiply the element mass matrix.
void Solver::SetLoadIncidSchur ( unsigned long &  NLoadedElem) [protected]

This function sets the load incidence used to index the element load vectors used in the schur complement.

Parameters:
[out]NLoadedElem- Number of loaded elements
void Solver::SetSolverAttributes ( SolverParam_S SolverParameters)

Sets the class attributes to be stored in the SolverParam_S instance.

Parameters:
[in]SolverParameters- instance of the SolverParam_S struct.
void Solver::SetSolverAttributes ( SolverType_E  SolvType,
MassStiffType_E  MassType,
StiffnessType_E  StiffType,
ContactModel_E  ContactMod,
ContactSolver_E  ContactSol,
LinearSystemSolutionMethod_E  LSMethod,
unsigned long  LSMaxIt,
double  LSPrec,
SolutionAlgorithm_E  SoluAlgorithm,
unsigned long  SolMaxIt,
double  SolPrec,
unsigned long  NumLoadSteps,
AnalysisType_E  Atype,
OperatorType_E  OpType,
double  to,
double  tf,
unsigned long  NTS,
unsigned long  FrictionCoef,
double  PenaltyParameter,
unsigned long  ContactInteOrder,
TimeIntegrationMeth_E  TimeIntMeth,
unsigned long  OutFreqNR,
unsigned long  OutFreqTime 
)

Sets the class attributes as input parameters to be stored in the SolverParam_S instance.

Parameters:
[in]SolvType(SolverType_E) : Stores the type of solver used, i.e., global or element-element.
[in]MassType(MassType_E) : Stores the type of mass matrix (LUMPED, CONSISTENT, EIGENVALUE).
[in]StiffType(StiffType_E) : Stores the type of the stiffness matrix (TRANSFORMED, CONSISTENT, EIGENVALUE)
[in]LSMethod(LinearSystemSolutionMethod_E) : Linear system solution method.
[in]LSMaxIt(unsigned long) : Maximum number of iterarions for iterative linear solution method.
[in]LSPrec(double): Precision for the iterative solver.
[in]SoluAlgorithm(SolutionAlgorithm_E) : Solution scheme to solve the discrete model (linear, newton_raphson, penalty).
[in]SolMaxIt(unsigned long) Maximum number of iterarions for nonlinear solution algorithms.
[in]SolPrec(double) : Precision for the nonlinear solution algorithms.
[in]NumLoadSteps(unsigned long) : Number of load/time steps.
[in]Atype(AnalysisType_E) : Analysis type (Reynolds, Static, Transient, Modal analysis, Projection).
[in]OpType(OperatorType_E) : Stores the operator type (symmetric or non_symmetric).
[in]to(double): Initial: time.
[in]tf(double): Final: time.
[in]NTS(unsigned long) : Stores the number of time steps (NTS) for transient analysis.
[in]TimeIntMeth(TimeIntegrationMeth_E) : Method for integration in time.
[in]OutFreqNR(unsigned long): Frequency for printing the NR solution to the output file.
[in]OutFreqTime(unsigned long): Frequency for printing the time integration solution to the output file.

Sets the pameters for theoretical solution.

Parameters:
[in]TheoSol- reference to the struct that stores attributes for the Solver class related to the theorical solution.
void Solver::VectorSchurComplement ( double *  A,
double *  B,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given vector. The symmetric matrix is complemented in the boundary and the internal part is factorized.

Parameters:
[in]A- Symmetric matrix used in the Schur complement
[in]B- Vector to be complemented
[in]NBD- Number of element boundary dofs
[in]NID- Number of element internal dofs
void Solver::VectorSchurComplement ( double *  A,
double *  Aint,
double *  B,
unsigned long  NBD,
unsigned long  NID 
) [protected]

Computes the Schur complement for the given vector.

Parameters:
[in]A- Symmetric matrix used in the Schur complement, only boundary and coupled parts are used
[in]Aint- Pointer containing the internal part of the symmetric matrix.
[in]B- Vector to be complemented
[in]NBD- Number of element boundary dofs
[in]NID- Number of element internal dofs

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Friends Defines