![]() |
Block-Structured AMR Software Framework
|
Classes | |
| class | MemoryHelper |
| A SUNDIALS SUNMemoryHelper interface to the amrex::Arena. More... | |
| struct | N_VectorContent_MultiFab_notptr |
Typedefs | |
| using | N_VectorContent_MultiFab = N_VectorContent_MultiFab_notptr * |
Functions | |
| N_Vector | N_VNewEmpty_MultiFab (sunindextype vec_length, ::sundials::Context *sunctx=The_Sundials_Context()) |
Create an empty MultiFab N_Vector shell of length vec_length. | |
| N_Vector | N_VNew_MultiFab (sunindextype vec_length, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm, sunindextype nComp, sunindextype nGhost, ::sundials::Context *sunctx=The_Sundials_Context()) |
Allocate a MultiFab-backed N_Vector of length vec_length. | |
| N_Vector | N_VMake_MultiFab (sunindextype vec_length, amrex::MultiFab *mf, ::sundials::Context *sunctx=The_Sundials_Context()) |
Wrap an existing MultiFab mf as an N_Vector without copying. | |
| sunindextype | N_VGetLength_MultiFab (N_Vector v) |
Return the logical length of N_Vector v. | |
| int | N_VGetOwnMF_MultiFab (N_Vector v) |
Query whether v owns its MultiFab storage. | |
| void | N_VSetOwnMF_MultiFab (N_Vector v, int own_mf) |
Set the ownership flag on v's MultiFab. | |
| N_Vector | N_VCloneEmpty_MultiFab (N_Vector w) |
Create an empty clone of w that owns no data. | |
| N_Vector | N_VClone_MultiFab (N_Vector w) |
Create a deep clone of w including its MultiFab data. | |
| void | N_VDestroy_MultiFab (N_Vector v) |
Destroy v and free its resources (MultiFab if owned). | |
| void | N_VSpace_MultiFab (N_Vector v, sunindextype *lrw, sunindextype *liw) |
Return workspace requirements for v. | |
| N_VectorContent_MultiFab | N_VGetContent_MultiFab (N_Vector v) |
Access the implementation-specific content stored in v. | |
| amrex::MultiFab *& | getMFptr (N_Vector v) |
Access the MultiFab pointer stored inside v (non-const). | |
| amrex::MultiFab * | N_VGetVectorPointer_MultiFab (N_Vector v) |
Return the wrapped MultiFab pointer from v. | |
| amrex::MultiFab | N_VGetVectorAlias_MultiFab (N_Vector v) |
Return a shallow alias of the MultiFab stored in v. | |
| void | N_VLinearSum_MultiFab (amrex::Real a, N_Vector x, amrex::Real b, N_Vector y, N_Vector z) |
Compute z = a x + b y. | |
| void | N_VConst_MultiFab (amrex::Real c, N_Vector z) |
Fill z with the constant c. | |
| void | N_VProd_MultiFab (N_Vector x, N_Vector y, N_Vector z) |
Compute the element-wise product z = x * y. | |
| void | N_VDiv_MultiFab (N_Vector x, N_Vector y, N_Vector z) |
Compute the element-wise quotient z = x / y. | |
| void | N_VScale_MultiFab (amrex::Real c, N_Vector x, N_Vector z) |
Compute the scalar product z = c * x. | |
| void | N_VAbs_MultiFab (N_Vector x, N_Vector z) |
Compute the element-wise absolute value z = |x|. | |
| void | N_VInv_MultiFab (N_Vector x, N_Vector z) |
Compute the element-wise inverse z = 1 / x. | |
| void | N_VAddConst_MultiFab (N_Vector x, amrex::Real b, N_Vector z) |
Compute z = x + b. | |
| amrex::Real | N_VDotProd_MultiFab (N_Vector x, N_Vector y) |
Return the dot product x · y. | |
| amrex::Real | N_VMaxNorm_MultiFab (N_Vector x) |
Return the infinity norm of x. | |
| amrex::Real | N_VWrmsNorm_MultiFab (N_Vector x, N_Vector w) |
Return the weighted RMS norm of x using weights w. | |
| amrex::Real | N_VWrmsNormMask_MultiFab (N_Vector x, N_Vector w, N_Vector id) |
Return the weighted RMS norm restricted by mask id. | |
| amrex::Real | N_VMin_MultiFab (N_Vector x) |
Return the minimum entry of x. | |
| amrex::Real | NormHelper_NVector_MultiFab (N_Vector x, N_Vector w, N_Vector id, int use_id, bool rms) |
| Helper that computes weighted norms or RMS values. | |
| amrex::Real | N_VWL2Norm_MultiFab (N_Vector x, N_Vector w) |
Return the weighted L2 norm of x using weights w. | |
| amrex::Real | N_VL1Norm_MultiFab (N_Vector x) |
Return the L1 norm (sum of absolute values) of x. | |
| void | N_VCompare_MultiFab (amrex::Real a, N_Vector x, N_Vector z) |
Build a mask z where entries of x exceed a. | |
| int | N_VInvTest_MultiFab (N_Vector x, N_Vector z) |
Compute the element-wise inverse test z = 1 / x, returning failure if zero encountered. | |
| int | N_VConstrMask_MultiFab (N_Vector a_a, N_Vector x, N_Vector m) |
Apply constraint masking from a_a to produce mask m. | |
| amrex::Real | N_VMinQuotient_MultiFab (N_Vector num, N_Vector denom) |
Return the minimum element-wise quotient num / denom. | |
| void | Initialize (int nthreads) |
| Initialize the AMReX-SUNDIALS interface. | |
| void | Finalize () |
| Cleanup everything allocated for the AMReX-SUNDIALS interface. | |
| ::sundials::Context * | The_Sundials_Context (int i=amrex::OpenMP::get_thread_num()) |
| Get the i-th SUNDIALS context instance. | |
| MemoryHelper * | The_SUNMemory_Helper (int i=amrex::OpenMP::get_thread_num()) |
| Get the OpenMP-thread-local SUNMemoryHelper instance. | |
| amrex::Arena * | getArena (SUNMemoryType type) |
Return the AMReX arena used to satisfy allocations of type. | |
| using amrex::sundials::N_VectorContent_MultiFab = typedef N_VectorContent_MultiFab_notptr* |
| void amrex::sundials::Finalize | ( | ) |
Cleanup everything allocated for the AMReX-SUNDIALS interface.
Called by amrex::Finalize.
| amrex::Arena * amrex::sundials::getArena | ( | SUNMemoryType | type | ) |
Return the AMReX arena used to satisfy allocations of type.
| [in] | type | SUNDIALS memory type requested (host, pinned, device, etc.). |
| MultiFab *& amrex::sundials::getMFptr | ( | N_Vector | v | ) |
| void amrex::sundials::Initialize | ( | int | nthreads | ) |
Initialize the AMReX-SUNDIALS interface.
| [in] | nthreads | The number of threads that will be used with SUNDIALS. |
This will create the nthreads SUNDIALS context objects that are needed by the SUNDIALS solver and vector objects. Called by amrex::Initialize.
| void amrex::sundials::N_VAbs_MultiFab | ( | N_Vector | x, |
| N_Vector | z | ||
| ) |
Compute the element-wise absolute value z = |x|.
| x | Input vector. |
| z | Output vector receiving the magnitudes. |
| void amrex::sundials::N_VAddConst_MultiFab | ( | N_Vector | x, |
| amrex::Real | b, | ||
| N_Vector | z | ||
| ) |
Compute z = x + b.
| x | Input vector. |
| b | Scalar shift applied to every entry. |
| z | Output vector. |
| N_Vector amrex::sundials::N_VClone_MultiFab | ( | N_Vector | w | ) |
Create a deep clone of w including its MultiFab data.
| w | Template vector to clone. |
| N_Vector amrex::sundials::N_VCloneEmpty_MultiFab | ( | N_Vector | w | ) |
Create an empty clone of w that owns no data.
| w | Template vector describing the layout. |
w. | void amrex::sundials::N_VCompare_MultiFab | ( | amrex::Real | a, |
| N_Vector | x, | ||
| N_Vector | z | ||
| ) |
Build a mask z where entries of x exceed a.
| a | Threshold value. |
| x | Input vector. |
| z | Output mask (1 where |x| >= a, 0 otherwise). |
| void amrex::sundials::N_VConst_MultiFab | ( | amrex::Real | c, |
| N_Vector | z | ||
| ) |
Fill z with the constant c.
| c | Value assigned to every entry. |
| z | Destination vector. |
| int amrex::sundials::N_VConstrMask_MultiFab | ( | N_Vector | a_a, |
| N_Vector | x, | ||
| N_Vector | m | ||
| ) |
Apply constraint masking from a_a to produce mask m.
| a_a | Constraint vector (per SUNDIALS conventions). |
| x | Solution vector tested against constraints. |
| m | Output mask updated in place. |
| void amrex::sundials::N_VDestroy_MultiFab | ( | N_Vector | v | ) |
| void amrex::sundials::N_VDiv_MultiFab | ( | N_Vector | x, |
| N_Vector | y, | ||
| N_Vector | z | ||
| ) |
Compute the element-wise quotient z = x / y.
| x | Numerator vector. |
| y | Denominator vector. |
| z | Output vector receiving the quotient. |
| amrex::Real amrex::sundials::N_VDotProd_MultiFab | ( | N_Vector | x, |
| N_Vector | y | ||
| ) |
Return the dot product x · y.
| x | First operand. |
| y | Second operand. |
| N_VectorContent_MultiFab amrex::sundials::N_VGetContent_MultiFab | ( | N_Vector | v | ) |
| sunindextype amrex::sundials::N_VGetLength_MultiFab | ( | N_Vector | v | ) |
Return the logical length of N_Vector v.
| v | Vector to inspect. |
v. | int amrex::sundials::N_VGetOwnMF_MultiFab | ( | N_Vector | v | ) |
| MultiFab amrex::sundials::N_VGetVectorAlias_MultiFab | ( | N_Vector | v | ) |
| MultiFab * amrex::sundials::N_VGetVectorPointer_MultiFab | ( | N_Vector | v | ) |
| void amrex::sundials::N_VInv_MultiFab | ( | N_Vector | x, |
| N_Vector | z | ||
| ) |
Compute the element-wise inverse z = 1 / x.
| x | Input vector. |
| z | Output vector receiving the reciprocals. |
| int amrex::sundials::N_VInvTest_MultiFab | ( | N_Vector | x, |
| N_Vector | z | ||
| ) |
Compute the element-wise inverse test z = 1 / x, returning failure if zero encountered.
| x | Input vector. |
| z | Output vector receiving reciprocals. |
| amrex::Real amrex::sundials::N_VL1Norm_MultiFab | ( | N_Vector | x | ) |
Return the L1 norm (sum of absolute values) of x.
| x | Vector whose norm is computed. |
| void amrex::sundials::N_VLinearSum_MultiFab | ( | amrex::Real | a, |
| N_Vector | x, | ||
| amrex::Real | b, | ||
| N_Vector | y, | ||
| N_Vector | z | ||
| ) |
Compute z = a x + b y.
| a | Scalar multiplier for x. |
| x | First operand. |
| b | Scalar multiplier for y. |
| y | Second operand. |
| z | Output vector receiving the sum. |
| N_Vector amrex::sundials::N_VMake_MultiFab | ( | sunindextype | vec_length, |
| amrex::MultiFab * | mf, | ||
| ::sundials::Context * | sunctx = The_Sundials_Context() |
||
| ) |
Wrap an existing MultiFab mf as an N_Vector without copying.
| vec_length | Number of scalar entries represented. |
| mf | MultiFab that supplies the storage. |
| sunctx | Optional SUNDIALS context; defaults to The_Sundials_Context(). |
mf. | amrex::Real amrex::sundials::N_VMaxNorm_MultiFab | ( | N_Vector | x | ) |
| amrex::Real amrex::sundials::N_VMin_MultiFab | ( | N_Vector | x | ) |
| amrex::Real amrex::sundials::N_VMinQuotient_MultiFab | ( | N_Vector | num, |
| N_Vector | denom | ||
| ) |
Return the minimum element-wise quotient num / denom.
| num | Numerator vector. |
| denom | Denominator vector. |
| N_Vector amrex::sundials::N_VNew_MultiFab | ( | sunindextype | vec_length, |
| const amrex::BoxArray & | ba, | ||
| const amrex::DistributionMapping & | dm, | ||
| sunindextype | nComp, | ||
| sunindextype | nGhost, | ||
| ::sundials::Context * | sunctx = The_Sundials_Context() |
||
| ) |
Allocate a MultiFab-backed N_Vector of length vec_length.
| vec_length | Number of scalar entries represented. |
| ba | Grid layout. |
| dm | Distribution map for ba. |
| nComp | Number of state components per cell. |
| nGhost | Number of grow cells. |
| sunctx | Optional SUNDIALS context used for bookkeeping. |
| N_Vector amrex::sundials::N_VNewEmpty_MultiFab | ( | sunindextype | vec_length, |
| ::sundials::Context * | sunctx = The_Sundials_Context() |
||
| ) |
Create an empty MultiFab N_Vector shell of length vec_length.
The returned vector owns no data until a MultiFab is attached.
| vec_length | Number of scalar entries represented. |
| sunctx | Optional SUNDIALS context; defaults to amrex::sundials::The_Sundials_Context(). |
| void amrex::sundials::N_VProd_MultiFab | ( | N_Vector | x, |
| N_Vector | y, | ||
| N_Vector | z | ||
| ) |
Compute the element-wise product z = x * y.
| x | First operand. |
| y | Second operand. |
| z | Output vector receiving the product. |
| void amrex::sundials::N_VScale_MultiFab | ( | amrex::Real | c, |
| N_Vector | x, | ||
| N_Vector | z | ||
| ) |
Compute the scalar product z = c * x.
| c | Scalar multiplier. |
| x | Input vector. |
| z | Output vector receiving the scaled values. |
| void amrex::sundials::N_VSetOwnMF_MultiFab | ( | N_Vector | v, |
| int | own_mf | ||
| ) |
| void amrex::sundials::N_VSpace_MultiFab | ( | N_Vector | v, |
| sunindextype * | lrw, | ||
| sunindextype * | liw | ||
| ) |
Return workspace requirements for v.
| v | Vector to inspect. |
| lrw | Set to the number of real workspace entries. |
| liw | Set to the number of integer workspace entries. |
| amrex::Real amrex::sundials::N_VWL2Norm_MultiFab | ( | N_Vector | x, |
| N_Vector | w | ||
| ) |
Return the weighted L2 norm of x using weights w.
| x | Vector whose norm is computed. |
| w | Weight vector. |
| amrex::Real amrex::sundials::N_VWrmsNorm_MultiFab | ( | N_Vector | x, |
| N_Vector | w | ||
| ) |
Return the weighted RMS norm of x using weights w.
| x | Vector whose norm is computed. |
| w | Weight vector. |
| amrex::Real amrex::sundials::N_VWrmsNormMask_MultiFab | ( | N_Vector | x, |
| N_Vector | w, | ||
| N_Vector | id | ||
| ) |
| amrex::Real amrex::sundials::NormHelper_NVector_MultiFab | ( | N_Vector | x, |
| N_Vector | w, | ||
| N_Vector | id, | ||
| int | use_id, | ||
| bool | rms | ||
| ) |
Helper that computes weighted norms or RMS values.
| x | Input vector. |
| w | Weight vector (optional). |
| id | Mask vector (optional). |
| use_id | Non-zero to restrict to entries where id is non-zero. |
| rms | True for RMS norm, false for weighted L2. |
| sundials::Context * amrex::sundials::The_Sundials_Context | ( | int | i = amrex::OpenMP::get_thread_num() | ) |
Get the i-th SUNDIALS context instance.
| [in] | i | The index of the SUNDIALS context to return. |
A SUNDIALS context should not be used concurrently from different threads.
| MemoryHelper * amrex::sundials::The_SUNMemory_Helper | ( | int | i = amrex::OpenMP::get_thread_num() | ) |
Get the OpenMP-thread-local SUNMemoryHelper instance.
| [in] | i | Thread index (defaults to current thread). |