DC1DL2 Class Reference
[Heat Transfer]
#include <DC1DL2.h>

Detailed Description
Builds finite element arrays for thermal diffusion and convection in 1-D using 2-Node elements.
Note that members calculating element arrays have as an argument a double coef that will be multiplied by the contribution of the current element. This makes possible testing different algorithms.
Public Member Functions | |
| T_ * | A () |
| Return element matrix as a C-array. | |
| T_ * | b () |
| Return element right-hand side as a C-array. | |
| void | BodyRHS (const Vect< double > &b, int opt=LOCAL_ARRAY) |
| Add body right-hand side term to right hand side. | |
| void | BodyRHS (UserData< double > &ud, double coef=1) |
Add body right-hand side term to right hand side after multiplying it by coefficient coef. | |
| void | BoundaryRHS (const Vect< double > &b, int opt=LOCAL_ARRAY) |
Add boundary right-hand side term to right hand side after multiplying it by coefficient coef. | |
| void | BoundaryRHS (double flux) |
| Add boundary right-hand side flux to right hand side. | |
| void | BoundaryRHS (UserData< double > &ud, double coef=1) |
| Add boundary right-hand side term to right hand side after multiplying it by coefficient coef. | |
| void | build () |
| Build the linear system without solving. | |
| void | Capacity (double coef=1) |
Add Consistent capacity contribution to left and right-hand sides after multiplying it by coefficient coef. | |
| void | CapacityToLHS (double coef=1) |
Add Consistent capacity matrix to left-hand side after multiplying it by coefficient coef. | |
| void | CapacityToRHS (double coef=1) |
Add Consistent capacity contribution to right-hand side after multiplying it by coefficient coef. | |
| void | Convection (double coef=1) |
| Add convection matrix to left-hand side after multiplying it by coefficient coef. | |
| void | Convection (const Vect< double > &v, double coef=1) |
| Add convection matrix to left-hand side after multiplying it by coefficient coef. | |
| void | Convection (const double &v, double coef=1) |
| Add convection matrix to left-hand side after multiplying it by coefficient coef. | |
| void | ConvectionToRHS (double coef=1) |
| Add convection contribution to right-hand side after multiplying it by coefficient coef. | |
| void | ConvectionToRHS (const double &v, double coef=1) |
| Add convection contribution to right-hand side after multiplying it by coefficient coef. | |
| DC1DL2 (const Element *el, const Vect< double > &u, double time, double deltat, int scheme) | |
| Constructor for an element (transient case) with specification of time integration scheme. | |
| DC1DL2 (const Element *el, const Vect< double > &u, double time=0.) | |
| Constructor for an element (transient case). | |
| DC1DL2 (const Element *el) | |
| Constructor for an element. | |
| DC1DL2 () | |
| Default Constructor. | |
| void | DiagBC (int dof_type=NODE_DOF, int dof=0) |
| Update element matrix to impose bc by diagonalization technique. | |
| void | Diffusion (double coef=1) |
Add diffusion matrix to left hand side after multiplying it by coefficient coef. | |
| void | DiffusionToRHS (double coef=1) |
| Add diffusion contribution to right hand side after multiplying it by coefficient coef. | |
| LocalMatrix< T_, NEE_, NEE_ > & | EA () |
| Return element matrix as a LocalMatrix instance. | |
| LocalVect< T_, NEE_ > & | Eb () |
| Return element right-hand side as a LocalVect instance. | |
| void | ElementVector (const Vect< T_ > &b, int dof=0, int dof_type=NODE_DOF) |
| Localize Element Vector. | |
| LocalVect< T_, NEE_ > & | Ep () |
| Return element matrix as a C-array. | |
| double | Flux () const |
| Return (constant) heat flux in element. | |
| LinearSolver< T_ > & | getLinearSolver () |
| Return reference to linear solver instance. | |
| size_t | getNbEq () const |
| Return number of element equations. | |
| size_t | getNbNodes () const |
| Return number of element nodes. | |
| void | LCapacity (double coef) |
Add lumped capacity contribution to left and right-hand sides after multiplying it by coefficient coef. | |
| void | LCapacityToLHS (double coef=1) |
Add lumped capacity matrix to left-hand side after multiplying it by coefficient coef. | |
| void | LCapacityToRHS (double coef=1) |
Add lumped capacity contribution to right-hand side after multiplying it by coefficient coef. | |
| void | LocalNodeVector (AbsVect< T_ > *b) |
| Localize Element Vector from a NodeVect instance. | |
| T_ * | Prev () |
| Return element matrix as a C-array. | |
| int | run () |
| Run one time step. | |
| int | runOneStep () |
| Run one time step. | |
| LocalMatrix< T_, NSE_, NSE_ > & | SA () |
| Return side matrix as a LocalMatrix instance. | |
| void | setCapacity () |
| Add consistent capacity contribution to left and right-hand sides taking into account time integration scheme. | |
| void | setConvection () |
| Add convection contribution to left and/or right-hand side taking into account time integration scheme. | |
| void | setDiffusion () |
| Add diffusion contribution to left and/or right-hand side taking into account time integration scheme. | |
| void | setInitialSolution (const Vect< T_ > &u) |
| Set initial solution (previous time step). | |
| void | setInput (int opt, Vect< double > &u) |
| Set equation input data. | |
| void | setLumpedCapacity () |
| Add lumped capacity contribution to left and right-hand sides taking into account time integration scheme. | |
| double | setMaterialProperty (const string &exp, const string &prop) |
| Define a material property by an algebraic expression. | |
| void | setMesh (class Mesh &m) |
| Define mesh and renumber DOFs after removing imposed ones. | |
| void | setVelocity (NodeVect< double > &v) |
| Set velocity field for convection. | |
| void | SideVector (const Vect< T_ > &b) |
| Localize Side Vector. | |
| void | updateBC (const Vect< T_ > &bc) |
| Update Right-Hand side by taking into account essential boundary conditions. | |
| ~DC1DL2 () | |
| Destructor. | |
Protected Member Functions | |
| void | Conduc (const string &exp) |
| Set thermal conductivity given by an algebraic expression. | |
| void | Conduc (const double &diff) |
| Set (constant) thermal conductivity. | |
| void | Init (const Side *sd) |
| Set side arrays to zero. | |
| void | Init (const Element *el) |
| Set element arrays to zero. | |
| void | RhoCp (const string &exp) |
| Set product of Density by Specific heat given by an algebraic expression. | |
| void | RhoCp (const double &rhocp) |
| Set product of Density by Specific heat (constants). | |
| void | setMaterial () |
| Set material properties. | |
Constructor & Destructor Documentation
| DC1DL2 | ( | ) |
Default Constructor.
Constructs an empty equation.
Constructor for an element (transient case).
- Parameters:
-
el [in] Pointer to element u [in] Vect instance that contains solution at previous time step time [in] Current time value (Default value is 0)
Constructor for an element (transient case) with specification of time integration scheme.
- Parameters:
-
el [in] Pointer to element. u [in] Vect instance that contains solution at previous time step. time [in] Current time value (Default value is 0). deltat [in] Value of time step scheme [in] Time Integration Scheme (): -
FORWARD_EULERfor Forward Euler scheme -
BACKWARD_EULERfor Backward Euler scheme -
CRANK_NICOLSONfor Crank-Nicolson Euler scheme
-
Member Function Documentation
| void BodyRHS | ( | const Vect< double > & | b, | |
| int | opt = LOCAL_ARRAY | |||
| ) |
Add body right-hand side term to right hand side.
- Parameters:
-
b [in] Vector containing source at element nodes. opt [in] Vector is local (LOCAL_ARRAY) with size 3 or global (GLOBAL_ARRAY) with size = Number of nodes.
| void BodyRHS | ( | UserData< double > & | ud, | |
| double | coef = 1 | |||
| ) |
Add body right-hand side term to right hand side after multiplying it by coefficient coef.
- Parameters:
-
ud [in] Instance of UserData or of a derived class. Contains a member function that provides body source. coef [in] Coefficient to multiply by added term [default: 1]
| void BoundaryRHS | ( | const Vect< double > & | b, | |
| int | opt = LOCAL_ARRAY | |||
| ) |
Add boundary right-hand side term to right hand side after multiplying it by coefficient coef.
- Parameters:
-
b [in] Vector containing source at side nodes. opt [in] Vector is local ( LOCAL_ARRAY) with size 3 or global (GLOBAL_ARRAY) with size = Number of nodes.
| void BoundaryRHS | ( | double | flux | ) |
Add boundary right-hand side flux to right hand side.
- Parameters:
-
flux [in] Vector containing source at side nodes.
| void BoundaryRHS | ( | UserData< double > & | ud, | |
| double | coef = 1 | |||
| ) |
Add boundary right-hand side term to right hand side after multiplying it by coefficient coef.
- Parameters:
-
ud [in] Instance of UserData or of an inherited class. Contains a member function that provides body source. coef [in] Coefficient to multiply by added term [default: 1]
| void Capacity | ( | double | coef = 1 |
) |
Add Consistent capacity contribution to left and right-hand sides after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
| void CapacityToLHS | ( | double | coef = 1 |
) | [virtual] |
Add Consistent capacity matrix to left-hand side after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void CapacityToRHS | ( | double | coef = 1 |
) | [virtual] |
Add Consistent capacity contribution to right-hand side after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void Convection | ( | double | coef = 1 |
) | [virtual] |
Add convection matrix to left-hand side after multiplying it by coefficient coef.
Case where velocity field has been previouly defined
- Parameters:
-
coef [in] Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void Convection | ( | const Vect< double > & | v, | |
| double | coef = 1 | |||
| ) |
Add convection matrix to left-hand side after multiplying it by coefficient coef.
Case where velocity field is given by a vector v.
- Parameters:
-
v [in] Velocity vector coef [in] Coefficient to multiply by added term [default: 1]
| void Convection | ( | const double & | v, | |
| double | coef = 1 | |||
| ) |
Add convection matrix to left-hand side after multiplying it by coefficient coef.
- Parameters:
-
v [in] Constant velocity vector coef [in] Coefficient to multiply by added term [default: 1]
| void ConvectionToRHS | ( | double | coef = 1 |
) | [virtual] |
Add convection contribution to right-hand side after multiplying it by coefficient coef.
Case where velocity field has been previouly defined
- Parameters:
-
coef [in] Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void ConvectionToRHS | ( | const double & | v, | |
| double | coef = 1 | |||
| ) |
Add convection contribution to right-hand side after multiplying it by coefficient coef.
To be used for explicit convection term.
- Parameters:
-
v [in] Velocity vector coef [in] Coefficient to multiply by added term [default: 1]
| void DiagBC | ( | int | dof_type = NODE_DOF, |
|
| int | dof = 0 | |||
| ) | [inherited] |
Update element matrix to impose bc by diagonalization technique.
- Parameters:
-
[in] dof_type DOF type option. To choose among the enumerated values: - = NODE_DOF, DOFs are supported by nodes [ default ]
- = ELEMENT_DOF, DOFs are supported by elements
- = SIDE_DOF, DOFs are supported by sides
[in] dof DOF setting: - = 0, All DOFs are taken into account [ default ]
- != 0, Only DOF No. dof is handled in the sustem
References Side::getCode(), Node::getCode(), and Node::getLabel().
| void Diffusion | ( | double | coef = 1 |
) | [virtual] |
Add diffusion matrix to left hand side after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void DiffusionToRHS | ( | double | coef = 1 |
) | [virtual] |
Add diffusion contribution to right hand side after multiplying it by coefficient coef.
To be used for explicit diffusion term
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
| void ElementVector | ( | const Vect< T_ > & | b, | |
| int | dof = 0, |
|||
| int | dof_type = NODE_DOF | |||
| ) | [inherited] |
Localize Element Vector.
- Parameters:
-
[in] b Global vector to be localized [in] dof_type DOF type option. To choose among the enumerated values: - = NODE_DOF, DOFs are supported by nodes [ default ]
- = ELEMENT_DOF, DOFs are supported by elements
- = SIDE_DOF, DOFs are supported by sides
[in] dof DOF setting: - = 0, All DOFs are taken into account [ default ]
- != 0, Only DOF No. dof is handled in the sustem
References Equation::b(), Side::getDOF(), Node::getDOF(), Side::getNbDOF(), and Node::getNbDOF().
| void LCapacity | ( | double | coef | ) |
Add lumped capacity contribution to left and right-hand sides after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term (default value = 1).
References DC1DL2::LCapacityToLHS(), and DC1DL2::LCapacityToRHS().
| void LCapacityToLHS | ( | double | coef = 1 |
) | [virtual] |
Add lumped capacity matrix to left-hand side after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
Referenced by DC1DL2::LCapacity().
| void LCapacityToRHS | ( | double | coef = 1 |
) | [virtual] |
Add lumped capacity contribution to right-hand side after multiplying it by coefficient coef.
- Parameters:
-
[in] coef Coefficient to multiply by added term [default: 1]
Reimplemented from Equa_Therm< double, 2, 2, 1, 1 >.
Referenced by DC1DL2::LCapacity().
| void LocalNodeVector | ( | AbsVect< T_ > * | b | ) | [inherited] |
Localize Element Vector from a NodeVect instance.
- Parameters:
-
[in] b Pointer to global vector to be localized. The resulting local vector can be accessed by attribute ePrev. This member function is to be used if a constructor with Element was invoked.
References Node::getLabel(), and Node::getNbDOF().
| void setInput | ( | int | opt, | |
| Vect< double > & | u | |||
| ) |
Set equation input data.
- Parameters:
-
opt [in] Parameter to select type of input (enumerated values) -
INITIAL_FIELD: Initial temperature -
BOUNDARY_CONDITION_DATA: Boundary condition (Dirichlet) -
SOURCE_DATA: Heat source -
FLUX_DATA: Heat flux (Neumann boundary condition) -
VELOCITY: Velocity vector (for the convection term)
u [in] Vector containing input data -
| double setMaterialProperty | ( | const string & | exp, | |
| const string & | prop | |||
| ) | [inherited] |
Define a material property by an algebraic expression.
- Parameters:
-
[in] exp Algebraic expression [in] prop Property name
- Return values:
-
ret Return value in expression evaluation: - ret=0, Normal evaluation
- ret!=0, An error message is displayed.
Referenced by Equa_Therm< double, 4, 4, 3, 3 >::Conduc(), Equa_Solid< double, 4, 8, 2, 4 >::Density(), Equa_Fluid< double, 4, 8, 2, 4 >::Density(), Equa_Electromagnetics< complex< double >, 3, 3, 2, 2 >::ElectricConductivity(), Equa_Electromagnetics< complex< double >, 3, 3, 2, 2 >::ElectricResistivity(), Equa_Electromagnetics< complex< double >, 3, 3, 2, 2 >::MagneticPermeability(), Equa_Solid< double, 4, 8, 2, 4 >::Poisson(), Equa_Therm< double, 4, 4, 3, 3 >::RhoCp(), Equa_Fluid< double, 4, 8, 2, 4 >::ThermalExpansion(), Equa_Fluid< double, 4, 8, 2, 4 >::Viscosity(), and Equa_Solid< double, 4, 8, 2, 4 >::Young().
| void setVelocity | ( | NodeVect< double > & | v | ) |
| void SideVector | ( | const Vect< T_ > & | b | ) | [inherited] |
Localize Side Vector.
- Parameters:
-
[in] b Global vector to be localized - = NODE_DOF, DOFs are supported by nodes [ default ]
- = ELEMENT_DOF, DOFs are supported by elements
- = SIDE_DOF, DOFs are supported by sides
References Equation::b(), Node::getDOF(), and Node::getNbDOF().
| void updateBC | ( | const Vect< T_ > & | bc | ) | [inherited] |
Update Right-Hand side by taking into account essential boundary conditions.
Init solution.
- Parameters:
-
[in] bc Vector that contains imposed values at all DOFs