Module with subroutines and functions for solution norm calculation.
More...
|
subroutine | calctolerance (item, sam, u, w) |
| Defines the convergence tolerance to use for a given test item. More...
|
|
real(dp) function | scalednorm (sam, vec, wFac, iPow, doExpand, ierr) |
| Calculates the scaled norm of the given vector. More...
|
|
subroutine | infinitenorms (sam, vec, findWorst, infTra, infRot, infGen, worstDOFs, doExpand, ierr) |
| Calculates infinity norms of the given vector. More...
|
|
subroutine | energynorms (sam, disp, force, findWorst, E_absSum, E_absMax, worstDOFs, worstVals, ierr) |
| Calculates energy norms for given force and displacement vectors. More...
|
|
real(dp) function, dimension(:), pointer, private | expandvector (sam, vec, doExpand, forceCopy, ierr) |
| Returns a pointer to the expanded solution vector. More...
|
|
Module with subroutines and functions for solution norm calculation.
◆ calctolerance()
subroutine normroutinesmodule::calctolerance |
( |
type(testitemtype), intent(inout) |
item, |
|
|
type(samtype), intent(in), optional |
sam, |
|
|
real(dp), dimension(:), intent(in), optional |
u, |
|
|
real(dp), dimension(:), intent(in), optional |
w |
|
) |
| |
Defines the convergence tolerance to use for a given test item.
- Parameters
-
| item | The test item to define convergence tolerance for |
[in] | sam | Data for managing system matrix assembly |
[in] | u | System vector to use with the relative tolerance relTol |
[in] | w | Weighting factors for the DOFs of different kind |
If a relative tolerance is specified (relTol > 0.0), the actual tolerance is taken as the scaled norm of the given vector u times this value, plus the absolute tolerance absTol. The vector u is typically the current velocity state.
- Author
- Bjorn Haugen
- Date
- 28 Mar 2003
- Author
- Knut Morten Okstad
- Date
- 28 Jan 2004
◆ energynorms()
subroutine normroutinesmodule::energynorms |
( |
type(samtype), intent(in) |
sam, |
|
|
real(dp), dimension(:), intent(in) |
disp, |
|
|
real(dp), dimension(:), intent(in) |
force, |
|
|
logical, intent(in) |
findWorst, |
|
|
real(dp), intent(out) |
E_absSum, |
|
|
real(dp), intent(out) |
E_absMax, |
|
|
integer, dimension(:), intent(out) |
worstDOFs, |
|
|
real(dp), dimension(:), intent(out) |
worstVals, |
|
|
integer, intent(out) |
ierr |
|
) |
| |
Calculates energy norms for given force and displacement vectors.
- Parameters
-
[in] | sam | Data for managing system matrix assembly |
[in] | disp | System displacement vector to calculate energy norms for |
[in] | force | System force vector to calculate energy norms for |
[in] | findWorst | If .true., record the worst DOFs in array worsDOFs |
[out] | E_absSum | The mean energy density among all DOFs |
[out] | E_absMax | The maximum energy density among all DOFs |
[out] | worstDOFs | Array to record the worst DOFs (highest values) in |
[out] | worstVals | Array to record the worst DOF values in |
[out] | ierr | Error flag |
- Author
- Bjorn Haugen
- Date
- 28 Mar 2003
- Author
- Knut Morten Okstad
- Date
- 28 Jan 2004
◆ expandvector()
real(dp) function, dimension(:), pointer, private normroutinesmodule::expandvector |
( |
type(samtype), intent(in) |
sam, |
|
|
real(dp), dimension(:), intent(in), target |
vec, |
|
|
logical, intent(in), optional |
doExpand, |
|
|
logical, intent(in), optional |
forceCopy, |
|
|
integer, intent(out), optional |
ierr |
|
) |
| |
|
private |
Returns a pointer to the expanded solution vector.
- Parameters
-
[in] | sam | Data for managing system matrix assembly |
[in] | vec | System vector to expand from equation-order to DOF-order |
[in] | doExpand | If not present or .false., don't do any expansion |
[in] | forceCopy | If .true., copy the vector if it is not expanded |
[out] | ierr | Error flag |
- Returns
- Pointer to expanded or copied vector
The expanded/copied vector is actually stored in the internal scratch array managed by the scratcharraymodule, so use with utmost care.
- See also
- solextensionmodule::csexpand
- Author
- Bjorn Haugen
- Date
- 13 Mar 2003
- Author
- Knut Morten Okstad
- Date
- 28 Jan 2004
◆ infinitenorms()
subroutine normroutinesmodule::infinitenorms |
( |
type(samtype), intent(in) |
sam, |
|
|
real(dp), dimension(:), intent(in) |
vec, |
|
|
logical, intent(in) |
findWorst, |
|
|
real(dp), intent(out) |
infTra, |
|
|
real(dp), intent(out) |
infRot, |
|
|
real(dp), intent(out) |
infGen, |
|
|
integer, dimension(:), intent(out), optional |
worstDOFs, |
|
|
logical, intent(in), optional |
doExpand, |
|
|
integer, intent(out) |
ierr |
|
) |
| |
Calculates infinity norms of the given vector.
- Parameters
-
[in] | sam | Data for managing system matrix assembly |
[in] | vec | System vector to calculate infinity norms for |
[in] | findWorst | If .true., record the worst DOFs in array worsDOFs |
[out] | infTra | The maximum translation DOF value |
[out] | infRot | The maximum rotation DOF value |
[out] | infGen | The maximum generalized DOF value |
[out] | worstDOFs | Array to record the worst DOFs (highest values) in |
[in] | doExpand | If .true., vec is assumed to be equation-oriented |
[out] | ierr | Error flag |
- Author
- Bjorn Haugen
- Date
- 28 Mar 2003
- Author
- Knut Morten Okstad
- Date
- 28 Jan 2004
◆ scalednorm()
real(dp) function normroutinesmodule::scalednorm |
( |
type(samtype), intent(in) |
sam, |
|
|
real(dp), dimension(:), intent(in) |
vec, |
|
|
real(dp), dimension(:), intent(in) |
wFac, |
|
|
integer, intent(in), optional |
iPow, |
|
|
logical, intent(in), optional |
doExpand, |
|
|
integer, intent(out), optional |
ierr |
|
) |
| |
Calculates the scaled norm of the given vector.
- Parameters
-
[in] | sam | Data for managing system matrix assembly |
[in] | vec | System vector to calculate the scaled norm for |
[in] | wFac | Weighting factors for the DOFs of different kind |
[in] | iPow | The power of the L-norm (iPow = 2 implies L2-norm) |
[in] | doExpand | If .true., vec is assumed to be equation-oriented |
[out] | ierr | Error flag |
- Returns
- The norm value
- Author
- Knut Morten Okstad
- Date
- 27 Jun 2000
- Author
- Bjorn Haugen
- Date
- 28 Mar 2003
- Author
- Knut Morten Okstad
- Date
- 28 Jan 2004