diff --git a/previews/PR1734/Basis.html b/previews/PR1734/Basis.html index 21a78fad4..67d85d577 100644 --- a/previews/PR1734/Basis.html +++ b/previews/PR1734/Basis.html @@ -1,4 +1,4 @@ -Basis · LibCEED.jl Docs

Basis

Column-major vs. row-major storage

libCEED internally uses row-major (C convention) storage of matrices, while Julia uses column-major (Fortran convention) storage.

LibCEED.jl will typically handle the conversion between these formats by transposing or permuting the dimensions of the input and output matrices and tensors.

Missing docstring.

Missing docstring for BasisCollocated. Check Documenter's build log for details.

LibCEED.create_tensor_h1_lagrange_basisFunction
create_tensor_h1_lagrange_basis(ceed, dim, ncomp, p, q, qmode)

Create a tensor-product Lagrange basis.

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • dim: Topological dimension of element.
  • ncomp: Number of field components (1 for scalar fields).
  • p: Number of Gauss-Lobatto nodes in one dimension. The polynomial degree of the resulting $Q_k$ element is $k=p-1$.
  • q: Number of quadrature points in one dimension.
  • qmode: Distribution of the $q$ quadrature points (affects order of accuracy for the quadrature).
source
LibCEED.create_tensor_h1_basisFunction
create_tensor_h1_basis(c::Ceed, dim, ncomp, p, q, interp1d, grad1d, qref1d, qweight1d)

Create a tensor-product basis for $H^1$ discretizations.

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • dim: Topological dimension.
  • ncomp: Number of field components (1 for scalar fields).
  • p: Number of nodes in one dimension.
  • q: Number of quadrature points in one dimension
  • interp1d: Matrix of size (q, p) expressing the values of nodal basis functions at quadrature points.
  • grad1d: Matrix of size (p, q) expressing derivatives of nodal basis functions at quadrature points.
  • qref1d: Array of length q holding the locations of quadrature points on the 1D reference element $[-1, 1]$.
  • qweight1d: Array of length q holding the quadrature weights on the reference element.
source
LibCEED.create_h1_basisFunction
create_h1_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, grad, qref, qweight)

Create a non tensor-product basis for $H^1$ discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (nqpts, nnodes) expressing the values of nodal basis functions at quadrature points.
  • grad: Array of size (dim, nqpts, nnodes) expressing derivatives of nodal basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.create_hdiv_basisFunction
create_hdiv_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, div, qref, qweight)

Create a non tensor-product basis for H(div) discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (dim, nqpts, nnodes) expressing the values of basis functions at quadrature points.
  • div: Array of size (nqpts, nnodes) expressing divergence of basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.create_hcurl_basisFunction
create_hcurl_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, curl, qref, qweight)

Create a non tensor-product basis for H(curl) discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (dim, nqpts, nnodes) expressing the values of basis functions at quadrature points.
  • curl: Matrix of size (curlcomp, nqpts, nnodes), curlcomp = 1 if dim < 3 else dim) matrix expressing curl of basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.apply!Method
apply!(b::Basis, nelem, tmode::TransposeMode, emode::EvalMode, u::AbstractCeedVector, v::AbstractCeedVector)

Apply basis evaluation from nodes to quadrature points or vice versa, storing the result in the CeedVector v.

nelem specifies the number of elements to apply the basis evaluation to; the backend will specify the ordering in CeedElemRestrictionCreateBlocked()

Set tmode to CEED_NOTRANSPOSE to evaluate from nodes to quadrature or to CEED_TRANSPOSE to apply the transpose, mapping from quadrature points to nodes.

Set the EvalMode emode to:

  • CEED_EVAL_NONE to use values directly,
  • CEED_EVAL_INTERP to use interpolated values,
  • CEED_EVAL_GRAD to use gradients,
  • CEED_EVAL_WEIGHT to use quadrature weights.
source
LibCEED.applyMethod
apply(b::Basis, u::AbstractVector; nelem=1, tmode=NOTRANSPOSE, emode=EVAL_INTERP)

Performs the same function as the above-defined apply!, but automatically convert from Julia arrays to CeedVector for convenience.

The result will be returned in a newly allocated array of the correct size.

source
LibCEED.getnumnodes1dFunction
getnumnodes1d(b::Basis)
+Basis · LibCEED.jl Docs

Basis

Column-major vs. row-major storage

libCEED internally uses row-major (C convention) storage of matrices, while Julia uses column-major (Fortran convention) storage.

LibCEED.jl will typically handle the conversion between these formats by transposing or permuting the dimensions of the input and output matrices and tensors.

Missing docstring.

Missing docstring for BasisCollocated. Check Documenter's build log for details.

LibCEED.create_tensor_h1_lagrange_basisFunction
create_tensor_h1_lagrange_basis(ceed, dim, ncomp, p, q, qmode)

Create a tensor-product Lagrange basis.

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • dim: Topological dimension of element.
  • ncomp: Number of field components (1 for scalar fields).
  • p: Number of Gauss-Lobatto nodes in one dimension. The polynomial degree of the resulting $Q_k$ element is $k=p-1$.
  • q: Number of quadrature points in one dimension.
  • qmode: Distribution of the $q$ quadrature points (affects order of accuracy for the quadrature).
source
LibCEED.create_tensor_h1_basisFunction
create_tensor_h1_basis(c::Ceed, dim, ncomp, p, q, interp1d, grad1d, qref1d, qweight1d)

Create a tensor-product basis for $H^1$ discretizations.

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • dim: Topological dimension.
  • ncomp: Number of field components (1 for scalar fields).
  • p: Number of nodes in one dimension.
  • q: Number of quadrature points in one dimension
  • interp1d: Matrix of size (q, p) expressing the values of nodal basis functions at quadrature points.
  • grad1d: Matrix of size (p, q) expressing derivatives of nodal basis functions at quadrature points.
  • qref1d: Array of length q holding the locations of quadrature points on the 1D reference element $[-1, 1]$.
  • qweight1d: Array of length q holding the quadrature weights on the reference element.
source
LibCEED.create_h1_basisFunction
create_h1_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, grad, qref, qweight)

Create a non tensor-product basis for $H^1$ discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (nqpts, nnodes) expressing the values of nodal basis functions at quadrature points.
  • grad: Array of size (dim, nqpts, nnodes) expressing derivatives of nodal basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.create_hdiv_basisFunction
create_hdiv_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, div, qref, qweight)

Create a non tensor-product basis for H(div) discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (dim, nqpts, nnodes) expressing the values of basis functions at quadrature points.
  • div: Array of size (nqpts, nnodes) expressing divergence of basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.create_hcurl_basisFunction
create_hcurl_basis(c::Ceed, topo::Topology, ncomp, nnodes, nqpts, interp, curl, qref, qweight)

Create a non tensor-product basis for H(curl) discretizations

Arguments:

  • ceed: A Ceed object where the Basis will be created.
  • topo: Topology of element, e.g. hypercube, simplex, etc.
  • ncomp: Number of field components (1 for scalar fields).
  • nnodes: Total number of nodes.
  • nqpts: Total number of quadrature points.
  • interp: Matrix of size (dim, nqpts, nnodes) expressing the values of basis functions at quadrature points.
  • curl: Matrix of size (curlcomp, nqpts, nnodes), curlcomp = 1 if dim < 3 else dim) matrix expressing curl of basis functions at quadrature points.
  • qref: Matrix of size (dim, nqpts) holding the locations of quadrature points on the reference element $[-1, 1]$.
  • qweight: Array of length nqpts holding the quadrature weights on the reference element.
source
LibCEED.apply!Method
apply!(b::Basis, nelem, tmode::TransposeMode, emode::EvalMode, u::AbstractCeedVector, v::AbstractCeedVector)

Apply basis evaluation from nodes to quadrature points or vice versa, storing the result in the CeedVector v.

nelem specifies the number of elements to apply the basis evaluation to; the backend will specify the ordering in CeedElemRestrictionCreateBlocked()

Set tmode to CEED_NOTRANSPOSE to evaluate from nodes to quadrature or to CEED_TRANSPOSE to apply the transpose, mapping from quadrature points to nodes.

Set the EvalMode emode to:

  • CEED_EVAL_NONE to use values directly,
  • CEED_EVAL_INTERP to use interpolated values,
  • CEED_EVAL_GRAD to use gradients,
  • CEED_EVAL_WEIGHT to use quadrature weights.
source
LibCEED.applyMethod
apply(b::Basis, u::AbstractVector; nelem=1, tmode=NOTRANSPOSE, emode=EVAL_INTERP)

Performs the same function as the above-defined apply!, but automatically convert from Julia arrays to CeedVector for convenience.

The result will be returned in a newly allocated array of the correct size.

source
LibCEED.getnumnodes1dFunction
getnumnodes1d(b::Basis)
 
-Return the number of 1D nodes of the given (tensor-product) [`Basis`](@ref).
source
LibCEED.getqrefFunction
getqref(b::Basis)

Get the reference coordinates of quadrature points (in dim dimensions) of the given Basis.

source
LibCEED.getinterpFunction
getinterp(b::Basis)

Get the interpolation matrix of the given Basis. Returns a matrix of size (getnumqpts(b), getnumnodes(b)) for a given $H^1$ basis or (getdimension(b), getnumqpts(b), getnumnodes(b)) for a given vector $H(div)$ or $H(curl)$ basis.

source
LibCEED.getinterp1dFunction
getinterp1d(b::Basis)

Get the 1D interpolation matrix of the given Basis. b must be a tensor-product basis, otherwise this function will fail. Returns a matrix of size (getnumqpts1d(b), getnumnodes1d(b)).

source
LibCEED.getgradFunction
getgrad(b::Basis)

Get the gradient matrix of the given Basis. Returns a tensor of size (getdimension(b), getnumqpts(b), getnumnodes(b)).

source
LibCEED.getgrad1dFunction
getgrad1d(b::Basis)

Get the 1D derivative matrix of the given Basis. Returns a matrix of size (getnumqpts(b), getnumnodes(b)).

source
Missing docstring.

Missing docstring for getdiv. Check Documenter's build log for details.

Missing docstring.

Missing docstring for getcurl. Check Documenter's build log for details.

+Return the number of 1D nodes of the given (tensor-product) [`Basis`](@ref).
source
LibCEED.getqrefFunction
getqref(b::Basis)

Get the reference coordinates of quadrature points (in dim dimensions) of the given Basis.

source
LibCEED.getinterpFunction
getinterp(b::Basis)

Get the interpolation matrix of the given Basis. Returns a matrix of size (getnumqpts(b), getnumnodes(b)) for a given $H^1$ basis or (getdimension(b), getnumqpts(b), getnumnodes(b)) for a given vector $H(div)$ or $H(curl)$ basis.

source
LibCEED.getinterp1dFunction
getinterp1d(b::Basis)

Get the 1D interpolation matrix of the given Basis. b must be a tensor-product basis, otherwise this function will fail. Returns a matrix of size (getnumqpts1d(b), getnumnodes1d(b)).

source
LibCEED.getgradFunction
getgrad(b::Basis)

Get the gradient matrix of the given Basis. Returns a tensor of size (getdimension(b), getnumqpts(b), getnumnodes(b)).

source
LibCEED.getgrad1dFunction
getgrad1d(b::Basis)

Get the 1D derivative matrix of the given Basis. Returns a matrix of size (getnumqpts(b), getnumnodes(b)).

source
Missing docstring.

Missing docstring for getdiv. Check Documenter's build log for details.

Missing docstring.

Missing docstring for getcurl. Check Documenter's build log for details.

diff --git a/previews/PR1734/C.html b/previews/PR1734/C.html index b24617a45..c6a9ac89e 100644 --- a/previews/PR1734/C.html +++ b/previews/PR1734/C.html @@ -1,2 +1,2 @@ -Low-level C interface · LibCEED.jl Docs

Low-level C interface

The low-level interface (provided in the LibCEED.C module) is in one-to-one correspondence with the C libCEED iterface, and is automatically generated (with some minor manual modifications) using the Julia package Clang.jl. The code used to generate bindings is available in generate_bindings.jl.

With the low-level interface, the user is responsible for freeing all allocated memory (calling the appropriate Ceed*Destroy functions). This interface is not type-safe, and calling functions with the wrong arguments can cause libCEED to crash.

It is generally recommended for users to use the Julia interface exported from the LibCEED module, unless other specific low-level functionality is required.

+Low-level C interface · LibCEED.jl Docs

Low-level C interface

The low-level interface (provided in the LibCEED.C module) is in one-to-one correspondence with the C libCEED iterface, and is automatically generated (with some minor manual modifications) using the Julia package Clang.jl. The code used to generate bindings is available in generate_bindings.jl.

With the low-level interface, the user is responsible for freeing all allocated memory (calling the appropriate Ceed*Destroy functions). This interface is not type-safe, and calling functions with the wrong arguments can cause libCEED to crash.

It is generally recommended for users to use the Julia interface exported from the LibCEED module, unless other specific low-level functionality is required.

diff --git a/previews/PR1734/Ceed.html b/previews/PR1734/Ceed.html index b45f8874a..66a756a91 100644 --- a/previews/PR1734/Ceed.html +++ b/previews/PR1734/Ceed.html @@ -1,2 +1,2 @@ -Ceed · LibCEED.jl Docs

Ceed

LibCEED.CeedType
Ceed(spec="/cpu/self")

Wraps a libCEED Ceed object, created with the given resource specification string.

source
LibCEED.iscudaFunction
iscuda(c::Ceed)

Returns true if the given Ceed object has resource "/gpu/cuda/*" and false otherwise.

source
+Ceed · LibCEED.jl Docs

Ceed

LibCEED.CeedType
Ceed(spec="/cpu/self")

Wraps a libCEED Ceed object, created with the given resource specification string.

source
LibCEED.iscudaFunction
iscuda(c::Ceed)

Returns true if the given Ceed object has resource "/gpu/cuda/*" and false otherwise.

source
diff --git a/previews/PR1734/CeedVector.html b/previews/PR1734/CeedVector.html index f4ef67643..9db97062b 100644 --- a/previews/PR1734/CeedVector.html +++ b/previews/PR1734/CeedVector.html @@ -1,4 +1,4 @@ -CeedVector · LibCEED.jl Docs

CeedVector

LibCEED.CeedVectorType
CeedVector(c::Ceed, len::Integer; allocate::Bool=true)

Creates a CeedVector of given length. If allocate is false, then no memory is allocated. Attemping to access the vector before calling setarray! will fail. By default, allocate is true, and libCEED will allocate (host) memory for the vector.

source
CeedVector(c::Ceed, v2::AbstractVector; mtype=MEM_HOST, cmode=COPY_VALUES)

Creates a new CeedVector using the contents of the given vector v2. By default, the contents of v2 will be copied to the new CeedVector, but this behavior can be changed by specifying a different cmode.

source
Base.setindex!Method
setindex!(v::CeedVector, v2::AbstractArray)
-v[] = v2

Sets the values of CeedVector v equal to those of v2 using broadcasting.

source
Base.VectorMethod
Vector(v::CeedVector)

Create a new Vector by copying the contents of v.

source
LinearAlgebra.normMethod
norm(v::CeedVector, ntype::NormType)

Return the norm of the given CeedVector.

The norm type can either be specified as one of NORM_1, NORM_2, NORM_MAX.

source
LibCEED.@witharrayMacro
@witharray(v_arr=v, [size=(dims...)], [mtype=MEM_HOST], body)

Executes body, having extracted the contents of the CeedVector v as an array with name v_arr. If the memory type mtype is not provided, MEM_HOST will be used. If the size is not specified, a flat vector will be assumed.

Examples

Negate the contents of CeedVector v:

@witharray v_arr=v v_arr .*= -1.0
source
LibCEED.witharrayFunction
witharray(f, v::CeedVector, mtype=MEM_HOST)

Calls f with an array containing the data of the CeedVector v, using memory type mtype.

Because of performance issues involving closures, if f is a complex operation, it may be more efficient to use the macro version @witharray (cf. the section on "Performance of captured variable" in the Julia documentation and related GitHub issue.

Examples

Return the sum of a vector:

witharray(sum, v)
source
LibCEED.witharray_readFunction
witharray_read(f, v::CeedVector, mtype::MemType=MEM_HOST)

Same as witharray, but with read-only access to the data.

Examples

Display the contents of a vector:

witharray_read(display, v)
source
LibCEED.setarray!Function
setarray!(v::CeedVector, mtype::MemType, cmode::CopyMode, arr)

Set the array used by a CeedVector, freeing any previously allocated array if applicable. The backend may copy values to a different MemType. See also syncarray! and takearray!.

Avoid OWN_POINTER CopyMode

The CopyMode OWN_POINTER is not suitable for use with arrays that are allocated by Julia, since those cannot be properly freed from libCEED.

source
LibCEED.syncarray!Function
syncarray!(v::CeedVector, mtype::MemType)

Sync the CeedVector to a specified MemType. This function is used to force synchronization of arrays set with setarray!. If the requested memtype is already synchronized, this function results in a no-op.

source
LibCEED.takearray!Function
takearray!(v::CeedVector, mtype::MemType)

Take ownership of the CeedVector array and remove the array from the CeedVector. The caller is responsible for managing and freeing the array. The array is returns as a Ptr{CeedScalar}.

source
LibCEED.scale!Function
scale!(v::CeedVector, a::Real)

Overwrite v with a*v for scalar a. Returns v.

source
LinearAlgebra.axpy!Method
axpy!(a::Real, x::CeedVector, y::CeedVector)

Overwrite y with x*a + y, where a is a scalar. Returns y.

Different argument order

In order to be consistent with LinearAlgebra.axpy!, the arguments are passed in order: a, x, y. This is different than the order of arguments of the C function CeedVectorAXPY.

source
LibCEED.pointwisemult!Function
pointwisemult!(w::CeedVector, x::CeedVector, y::CeedVector)

Overwrite w with x .* y. Any subset of x, y, and w may be the same vector. Returns w.

source
+CeedVector · LibCEED.jl Docs

CeedVector

LibCEED.CeedVectorType
CeedVector(c::Ceed, len::Integer; allocate::Bool=true)

Creates a CeedVector of given length. If allocate is false, then no memory is allocated. Attemping to access the vector before calling setarray! will fail. By default, allocate is true, and libCEED will allocate (host) memory for the vector.

source
CeedVector(c::Ceed, v2::AbstractVector; mtype=MEM_HOST, cmode=COPY_VALUES)

Creates a new CeedVector using the contents of the given vector v2. By default, the contents of v2 will be copied to the new CeedVector, but this behavior can be changed by specifying a different cmode.

source
Base.setindex!Method
setindex!(v::CeedVector, v2::AbstractArray)
+v[] = v2

Sets the values of CeedVector v equal to those of v2 using broadcasting.

source
Base.VectorMethod
Vector(v::CeedVector)

Create a new Vector by copying the contents of v.

source
LinearAlgebra.normMethod
norm(v::CeedVector, ntype::NormType)

Return the norm of the given CeedVector.

The norm type can either be specified as one of NORM_1, NORM_2, NORM_MAX.

source
LibCEED.@witharrayMacro
@witharray(v_arr=v, [size=(dims...)], [mtype=MEM_HOST], body)

Executes body, having extracted the contents of the CeedVector v as an array with name v_arr. If the memory type mtype is not provided, MEM_HOST will be used. If the size is not specified, a flat vector will be assumed.

Examples

Negate the contents of CeedVector v:

@witharray v_arr=v v_arr .*= -1.0
source
LibCEED.witharrayFunction
witharray(f, v::CeedVector, mtype=MEM_HOST)

Calls f with an array containing the data of the CeedVector v, using memory type mtype.

Because of performance issues involving closures, if f is a complex operation, it may be more efficient to use the macro version @witharray (cf. the section on "Performance of captured variable" in the Julia documentation and related GitHub issue.

Examples

Return the sum of a vector:

witharray(sum, v)
source
LibCEED.witharray_readFunction
witharray_read(f, v::CeedVector, mtype::MemType=MEM_HOST)

Same as witharray, but with read-only access to the data.

Examples

Display the contents of a vector:

witharray_read(display, v)
source
LibCEED.setarray!Function
setarray!(v::CeedVector, mtype::MemType, cmode::CopyMode, arr)

Set the array used by a CeedVector, freeing any previously allocated array if applicable. The backend may copy values to a different MemType. See also syncarray! and takearray!.

Avoid OWN_POINTER CopyMode

The CopyMode OWN_POINTER is not suitable for use with arrays that are allocated by Julia, since those cannot be properly freed from libCEED.

source
LibCEED.syncarray!Function
syncarray!(v::CeedVector, mtype::MemType)

Sync the CeedVector to a specified MemType. This function is used to force synchronization of arrays set with setarray!. If the requested memtype is already synchronized, this function results in a no-op.

source
LibCEED.takearray!Function
takearray!(v::CeedVector, mtype::MemType)

Take ownership of the CeedVector array and remove the array from the CeedVector. The caller is responsible for managing and freeing the array. The array is returns as a Ptr{CeedScalar}.

source
LibCEED.scale!Function
scale!(v::CeedVector, a::Real)

Overwrite v with a*v for scalar a. Returns v.

source
LinearAlgebra.axpy!Method
axpy!(a::Real, x::CeedVector, y::CeedVector)

Overwrite y with x*a + y, where a is a scalar. Returns y.

Different argument order

In order to be consistent with LinearAlgebra.axpy!, the arguments are passed in order: a, x, y. This is different than the order of arguments of the C function CeedVectorAXPY.

source
LibCEED.pointwisemult!Function
pointwisemult!(w::CeedVector, x::CeedVector, y::CeedVector)

Overwrite w with x .* y. Any subset of x, y, and w may be the same vector. Returns w.

source
diff --git a/previews/PR1734/Context.html b/previews/PR1734/Context.html index 37f68e712..8706605d1 100644 --- a/previews/PR1734/Context.html +++ b/previews/PR1734/Context.html @@ -1,2 +1,2 @@ -Context · LibCEED.jl Docs

Context

LibCEED.ContextType
Context(ceed::Ceed, data; mtype=MEM_HOST, cmode=USE_POINTER)

Create a CeedQFunctionContext object that allows user Q-functions to access an arbitrary data object. data should be an instance of a mutable struct. If the copy mode cmode is USE_POINTER, then the data will be preserved from the GC when assigned to a QFunction object using set_context!.

Copy mode OWN_POINTER is not supported by this interface because Julia-allocated objects cannot be freed from C.

source
+Context · LibCEED.jl Docs

Context

LibCEED.ContextType
Context(ceed::Ceed, data; mtype=MEM_HOST, cmode=USE_POINTER)

Create a CeedQFunctionContext object that allows user Q-functions to access an arbitrary data object. data should be an instance of a mutable struct. If the copy mode cmode is USE_POINTER, then the data will be preserved from the GC when assigned to a QFunction object using set_context!.

Copy mode OWN_POINTER is not supported by this interface because Julia-allocated objects cannot be freed from C.

source
diff --git a/previews/PR1734/ElemRestriction.html b/previews/PR1734/ElemRestriction.html index 5dcf75378..780b98882 100644 --- a/previews/PR1734/ElemRestriction.html +++ b/previews/PR1734/ElemRestriction.html @@ -1,5 +1,5 @@ -ElemRestriction · LibCEED.jl Docs

ElemRestriction

LibCEED.create_elem_restrictionFunction
create_elem_restriction(
+ElemRestriction · LibCEED.jl Docs

ElemRestriction

LibCEED.create_elem_restrictionFunction
create_elem_restriction(
     ceed::Ceed,
     nelem,
     elemsize,
@@ -9,7 +9,7 @@
     offsets::AbstractArray{CeedInt},
     mtype::MemType=MEM_HOST,
     cmode::CopyMode=COPY_VALUES,
-)

Create a CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
Missing docstring.

Missing docstring for create_elem_restriction. Check Documenter's build log for details.

LibCEED.create_elem_restriction_orientedFunction
create_elem_restriction_oriented(
+)

Create a CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
Missing docstring.

Missing docstring for create_elem_restriction. Check Documenter's build log for details.

LibCEED.create_elem_restriction_orientedFunction
create_elem_restriction_oriented(
     ceed::Ceed,
     nelem,
     elemsize,
@@ -20,7 +20,7 @@
     orients::AbstractArray{Bool},
     mtype::MemType=MEM_HOST,
     cmode::CopyMode=COPY_VALUES,
-)

Create an oriented CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • orients: Array of shape (elemsize, nelem) with bool false for positively oriented and true to flip the orientation.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
LibCEED.create_elem_restriction_curl_orientedFunction
create_elem_restriction_curl_oriented(
+)

Create an oriented CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • orients: Array of shape (elemsize, nelem) with bool false for positively oriented and true to flip the orientation.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
LibCEED.create_elem_restriction_curl_orientedFunction
create_elem_restriction_curl_oriented(
     ceed::Ceed,
     nelem,
     elemsize,
@@ -31,10 +31,10 @@
     curlorients::AbstractArray{CeedInt},
     mtype::MemType=MEM_HOST,
     cmode::CopyMode=COPY_VALUES,
-)

Create an curl-oriented CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • curlorients: Array of shape (3 * elemsize, nelem) representing a row-major tridiagonal matrix (curlorients[0, i] = curlorients[3 * elemsize - 1, i] = 0, where $0 \leq i < \textit{nelem}$) which is applied to the element unknowns upon restriction.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
LibCEED.create_elem_restriction_stridedFunction
create_elem_restriction_strided(ceed::Ceed, nelem, elemsize, ncomp, lsize, strides)

Create a strided CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described by the restriction
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • strides: Array for strides between [nodes, components, elements]. Data for node $i$, component $j$, element $k$ can be found in the L-vector at index i*strides[0] + j*strides[1] + k*strides[2]. STRIDES_BACKEND may be used with vectors created by a Ceed backend.
source
LibCEED.apply!Method
apply!(
+)

Create an curl-oriented CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described in the offsets array
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • compstride: Stride between components for the same L-vector "node". Data for node $i$, component $j$, element $k$ can be found in the L-vector at index offsets[i + k*elemsize] + j*compstride.
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • offsets: Array of shape (elemsize, nelem). Column $i$ holds the ordered list of the offsets (into the input CeedVector) for the unknowns corresponding to element $i$, where $0 \leq i < \textit{nelem}$. All offsets must be in the range $[0, \textit{lsize} - 1]$.
  • curlorients: Array of shape (3 * elemsize, nelem) representing a row-major tridiagonal matrix (curlorients[0, i] = curlorients[3 * elemsize - 1, i] = 0, where $0 \leq i < \textit{nelem}$) which is applied to the element unknowns upon restriction.
  • mtype: Memory type of the offsets array, see MemType
  • cmode: Copy mode for the offsets array, see CopyMode
source
LibCEED.create_elem_restriction_stridedFunction
create_elem_restriction_strided(ceed::Ceed, nelem, elemsize, ncomp, lsize, strides)

Create a strided CeedElemRestriction.

Zero-based indexing

In the below notation, we are using 0-based indexing. libCEED expects the offset indices to be 0-based.

Arguments:

  • ceed: The Ceed object
  • nelem: Number of elements described by the restriction
  • elemsize: Size (number of "nodes") per element
  • ncomp: Number of field components per interpolation node (1 for scalar fields)
  • lsize: The size of the L-vector. This vector may be larger than the elements and fields given by this restriction.
  • strides: Array for strides between [nodes, components, elements]. Data for node $i$, component $j$, element $k$ can be found in the L-vector at index i*strides[0] + j*strides[1] + k*strides[2]. STRIDES_BACKEND may be used with vectors created by a Ceed backend.
source
LibCEED.apply!Method
apply!(
     r::ElemRestriction,
     u::CeedVector,
     ru::CeedVector;
     tmode=NOTRANSPOSE,
     request=RequestImmediate(),
-)

Use the ElemRestriction to convert from L-vector to an E-vector (or apply the tranpose operation). The input CeedVector is u and the result stored in ru.

If tmode is TRANSPOSE, then the result is added to ru. If tmode is NOTRANSPOSE, then ru is overwritten with the result.

source
LibCEED.applyMethod
apply(r::ElemRestriction, u::AbstractVector; tmode=NOTRANSPOSE)

Use the ElemRestriction to convert from L-vector to an E-vector (or apply the tranpose operation). The input is given by u, and the result is returned as an array of type Vector{CeedScalar}.

source
+)

Use the ElemRestriction to convert from L-vector to an E-vector (or apply the tranpose operation). The input CeedVector is u and the result stored in ru.

If tmode is TRANSPOSE, then the result is added to ru. If tmode is NOTRANSPOSE, then ru is overwritten with the result.

source
LibCEED.applyMethod
apply(r::ElemRestriction, u::AbstractVector; tmode=NOTRANSPOSE)

Use the ElemRestriction to convert from L-vector to an E-vector (or apply the tranpose operation). The input is given by u, and the result is returned as an array of type Vector{CeedScalar}.

source
diff --git a/previews/PR1734/Examples.html b/previews/PR1734/Examples.html index 6918a1c38..3e5e64e48 100644 --- a/previews/PR1734/Examples.html +++ b/previews/PR1734/Examples.html @@ -1,2 +1,2 @@ -Examples · LibCEED.jl Docs

Examples

LibCEED.jl includes three short examples, which are analogues of the two examples in libCEED/examples/ceed.

These examples are:

  • ex1-volume-c.jl, an almost one-to-one translation of ex1-volume.c, using the low-level C interface. This example uses low-level user Q-functions defined in ex1-function-c.jl.
  • ex1-volume.jl, a higher-level more idiomatic version of ex1-volume.c, using user Q-functions defined using @interior_qf.
  • ex2-surface.jl, a higher-level, idiomatic version of ex2-surface.c.
+Examples · LibCEED.jl Docs

Examples

LibCEED.jl includes three short examples, which are analogues of the two examples in libCEED/examples/ceed.

These examples are:

  • ex1-volume-c.jl, an almost one-to-one translation of ex1-volume.c, using the low-level C interface. This example uses low-level user Q-functions defined in ex1-function-c.jl.
  • ex1-volume.jl, a higher-level more idiomatic version of ex1-volume.c, using user Q-functions defined using @interior_qf.
  • ex2-surface.jl, a higher-level, idiomatic version of ex2-surface.c.
diff --git a/previews/PR1734/Globals.html b/previews/PR1734/Globals.html index 0cb85e53b..705ee719f 100644 --- a/previews/PR1734/Globals.html +++ b/previews/PR1734/Globals.html @@ -1,2 +1,2 @@ -Constants and Enumerations · LibCEED.jl Docs

Constants and Enumerations

LibCEED.CeedScalarType
CeedScalar

Scalar (floating point) type. Typically equivalent to Float64, but libCEED can be configured at compile-time to use Float32. See also get_scalar_type.

source
LibCEED.CopyModeType
CopyMode

One of COPY_VALUES, USE_POINTER or OWN_POINTER.

OWN_POINTER is not typically supported for objects created in Julia, because those must be destroyed by the garbage collector, and cannot be freed from C.

source
LibCEED.TransposeModeType
TransposeMose

Denotes whether a linear transformation or its transpose should be applied. Either NOTRANSPOSE or TRANSPOSE.

source
LibCEED.TopologyType
Topology

Type of basis shape to create non-tensor H1 element basis. One of LINE, TRIANGLE, QUAD, TET, PYRAMID, PRISM, or HEX.

The dimension can be extracted with bitshift:

dim = Int(topology) >> 16
source
+Constants and Enumerations · LibCEED.jl Docs

Constants and Enumerations

LibCEED.CeedScalarType
CeedScalar

Scalar (floating point) type. Typically equivalent to Float64, but libCEED can be configured at compile-time to use Float32. See also get_scalar_type.

source
LibCEED.CopyModeType
CopyMode

One of COPY_VALUES, USE_POINTER or OWN_POINTER.

OWN_POINTER is not typically supported for objects created in Julia, because those must be destroyed by the garbage collector, and cannot be freed from C.

source
LibCEED.TransposeModeType
TransposeMose

Denotes whether a linear transformation or its transpose should be applied. Either NOTRANSPOSE or TRANSPOSE.

source
LibCEED.TopologyType
Topology

Type of basis shape to create non-tensor H1 element basis. One of LINE, TRIANGLE, QUAD, TET, PYRAMID, PRISM, or HEX.

The dimension can be extracted with bitshift:

dim = Int(topology) >> 16
source
diff --git a/previews/PR1734/LibCEED.html b/previews/PR1734/LibCEED.html index e993a1f65..4857f6040 100644 --- a/previews/PR1734/LibCEED.html +++ b/previews/PR1734/LibCEED.html @@ -1,4 +1,4 @@ -Library configuration · LibCEED.jl Docs

Library configuration

By default, LibCEED.jl uses a "basic version" of the libCEED library that is bundled as a pre-built binary. In order to access more advanced features (CUDA support, architecture-specific compiler flags, etc.), users can use LibCEED.jl with a other versions of the libCEED library (e.g. compiled from source).

This is achieved by by calling set_libceed_path! with the path to the library file. The choice of library file is stored as a per-environment preference. For changes to take effect, the Julia session must be restarted. The library currently being used by LibCEED.jl can be queried using get_libceed_path.

The version number of the currently loaded libCEED library can also be queried using ceedversion.

LibCEED.ceedversionFunction
ceedversion()

Returns a VersionNumber corresponding to the version of the libCEED library currently used.

source
LibCEED.isreleaseFunction
isrelease()

Returns true if the libCEED library is a release build, false otherwise.

source
LibCEED.set_libceed_path!Function
set_libceed_path!(path::AbstractString)
+Library configuration · LibCEED.jl Docs

Library configuration

By default, LibCEED.jl uses a "basic version" of the libCEED library that is bundled as a pre-built binary. In order to access more advanced features (CUDA support, architecture-specific compiler flags, etc.), users can use LibCEED.jl with a other versions of the libCEED library (e.g. compiled from source).

This is achieved by by calling set_libceed_path! with the path to the library file. The choice of library file is stored as a per-environment preference. For changes to take effect, the Julia session must be restarted. The library currently being used by LibCEED.jl can be queried using get_libceed_path.

The version number of the currently loaded libCEED library can also be queried using ceedversion.

LibCEED.ceedversionFunction
ceedversion()

Returns a VersionNumber corresponding to the version of the libCEED library currently used.

source
LibCEED.isreleaseFunction
isrelease()

Returns true if the libCEED library is a release build, false otherwise.

source
LibCEED.set_libceed_path!Function
set_libceed_path!(path::AbstractString)
 set_libceed_path!(:prebuilt)
-set_libceed_path!(:default)

Sets the path of the libCEED dynamic library. path should be the absolute path to the library file.

set_libceed_path!(:prebuilt) indicates to LibCEED.jl to use the prebuilt version of the libCEED library (bundled with libCEED_jll).

set_libceed_path!(:default) indicates to LibCEED.jl to use the default library. This usually has the same effect as set_libceed_path!(:prebuilt), unless a different path has been specified in the depot-wide preferences or using Overrides.toml.

This function sets the library path as a preference associated with the currently active environment. Changes will take effect after restarting the Julia session. See the Preferences.jl documentation for more information.

source
LibCEED.use_prebuilt_libceed!Function
use_prebuilt_libceed!()

Indicates that the prebuilt version of the libCEED library (bundled with libCEED_jll) should be used.

Equivalent to set_libceed_path!(:prebuilt).

source
+set_libceed_path!(:default)

Sets the path of the libCEED dynamic library. path should be the absolute path to the library file.

set_libceed_path!(:prebuilt) indicates to LibCEED.jl to use the prebuilt version of the libCEED library (bundled with libCEED_jll).

set_libceed_path!(:default) indicates to LibCEED.jl to use the default library. This usually has the same effect as set_libceed_path!(:prebuilt), unless a different path has been specified in the depot-wide preferences or using Overrides.toml.

This function sets the library path as a preference associated with the currently active environment. Changes will take effect after restarting the Julia session. See the Preferences.jl documentation for more information.

source
LibCEED.use_prebuilt_libceed!Function
use_prebuilt_libceed!()

Indicates that the prebuilt version of the libCEED library (bundled with libCEED_jll) should be used.

Equivalent to set_libceed_path!(:prebuilt).

source
diff --git a/previews/PR1734/Misc.html b/previews/PR1734/Misc.html index 193db1645..35a2badc4 100644 --- a/previews/PR1734/Misc.html +++ b/previews/PR1734/Misc.html @@ -6,8 +6,8 @@ julia> J = rand(dim, dim); julia> det(J) # Slow! -0.13749386803188066 +-0.0462366188390681 julia> det(J, CeedDim(dim)) # Fast! -0.13749386803188068
LibCEED.CeedDimType
CeedDim(dim)

The singleton object of type CeedDim{dim}, used for dispatch to linear algebra operations specialized for small matrices (1, 2, or 3 dimensions).

source
LinearAlgebra.detMethod
det(J, ::CeedDim{dim})

Specialized determinant calculations for matrices of size 1, 2, or 3.

source
LibCEED.setvoigtFunction
setvoigt(J::StaticArray{Tuple{D,D},T,2})
-setvoigt(J, ::CeedDim{dim})

Given a symmetric matrix J, return a SVector that encodes J using the Voigt convention.

The size of the symmetric matrix J must be known statically, either specified using CeedDim or StaticArray.

source
LibCEED.getvoigtFunction
getvoigt(V, ::CeedDim{dim})

Given a vector V that encodes a symmetric matrix using the Voigt convention, return the corresponding SMatrix.

source
+-0.0462366188390681
LibCEED.CeedDimType
CeedDim(dim)

The singleton object of type CeedDim{dim}, used for dispatch to linear algebra operations specialized for small matrices (1, 2, or 3 dimensions).

source
LinearAlgebra.detMethod
det(J, ::CeedDim{dim})

Specialized determinant calculations for matrices of size 1, 2, or 3.

source
LibCEED.setvoigtFunction
setvoigt(J::StaticArray{Tuple{D,D},T,2})
+setvoigt(J, ::CeedDim{dim})

Given a symmetric matrix J, return a SVector that encodes J using the Voigt convention.

The size of the symmetric matrix J must be known statically, either specified using CeedDim or StaticArray.

source
LibCEED.getvoigtFunction
getvoigt(V, ::CeedDim{dim})

Given a vector V that encodes a symmetric matrix using the Voigt convention, return the corresponding SMatrix.

source
diff --git a/previews/PR1734/Operator.html b/previews/PR1734/Operator.html index 9b23642cc..dc06f0f65 100644 --- a/previews/PR1734/Operator.html +++ b/previews/PR1734/Operator.html @@ -7,4 +7,4 @@ (:w, ElemRestrictionNone(), mesh_basis, CeedVectorNone()), (:qdata, sol_rstr_i, BasisNone(), CeedVectorActive()) ] -)source
LibCEED.create_composite_operatorFunction
create_composite_operator(c::Ceed, ops)

Create an Operator whose action represents the sum of the operators in the collection ops.

source
LibCEED.apply!Method
apply!(op::Operator, vin, vout; request=RequestImmediate())

Apply the action of the operator op to the input vector vin, and store the result in the output vector vout.

For non-blocking application, the user can specify a request object. By default, immediate (synchronous) completion is requested.

source
LibCEED.apply_add!Function
apply_add!(op::Operator, vin, vout; request=RequestImmediate())

Apply the action of the operator op to the input vector vin, and add the result to the output vector vout.

For non-blocking application, the user can specify a request object. By default, immediate (synchronous) completion is requested.

source
LibCEED.assemble_diagonal!Function
assemble_diagonal!(op::Operator, diag::CeedVector; request=RequestImmediate())

Overwrites a CeedVector with the diagonal of a linear Operator.

Note:

Currently only Operators with a single field are supported.

source
LibCEED.assemble_add_diagonal!Function
assemble_diagonal!(op::Operator, diag::CeedVector; request=RequestImmediate())

Adds the diagonal of a linear Operator to the given CeedVector.

Note:

Currently only Operators with a single field are supported.

source
+)source
LibCEED.create_composite_operatorFunction
create_composite_operator(c::Ceed, ops)

Create an Operator whose action represents the sum of the operators in the collection ops.

source
LibCEED.apply!Method
apply!(op::Operator, vin, vout; request=RequestImmediate())

Apply the action of the operator op to the input vector vin, and store the result in the output vector vout.

For non-blocking application, the user can specify a request object. By default, immediate (synchronous) completion is requested.

source
LibCEED.apply_add!Function
apply_add!(op::Operator, vin, vout; request=RequestImmediate())

Apply the action of the operator op to the input vector vin, and add the result to the output vector vout.

For non-blocking application, the user can specify a request object. By default, immediate (synchronous) completion is requested.

source
LibCEED.assemble_diagonal!Function
assemble_diagonal!(op::Operator, diag::CeedVector; request=RequestImmediate())

Overwrites a CeedVector with the diagonal of a linear Operator.

Note:

Currently only Operators with a single field are supported.

source
LibCEED.assemble_add_diagonal!Function
assemble_diagonal!(op::Operator, diag::CeedVector; request=RequestImmediate())

Adds the diagonal of a linear Operator to the given CeedVector.

Note:

Currently only Operators with a single field are supported.

source
diff --git a/previews/PR1734/QFunction.html b/previews/PR1734/QFunction.html index 7adeede09..9a7a92d59 100644 --- a/previews/PR1734/QFunction.html +++ b/previews/PR1734/QFunction.html @@ -1,5 +1,5 @@ -QFunction · LibCEED.jl Docs

QFunction

LibCEED.@interior_qfMacro
@interior_qf name=def

Creates a user-defined interior (volumetric) Q-function, and assigns it to a variable named name. The definition of the Q-function is given as:

@interior_qf user_qf=(
+QFunction · LibCEED.jl Docs

QFunction

LibCEED.@interior_qfMacro
@interior_qf name=def

Creates a user-defined interior (volumetric) Q-function, and assigns it to a variable named name. The definition of the Q-function is given as:

@interior_qf user_qf=(
     ceed::CEED,
     [const1=val1, const2=val2, ...],
     [ctx::ContextType],
@@ -13,6 +13,6 @@
     (w, :in, EVAL_WEIGHT),
     (qdata, :out, EVAL_NONE),
     qdata[] = w*det(J)
-)
source
LibCEED.create_interior_qfunctionMethod
create_interior_qfunction(ceed::Ceed, name::AbstractString)

Create a QFunction from the Q-function gallery, using the provided name.

Examples

  • Build and apply the 3D mass operator
build_mass_qf = create_interior_qfunction(c, "Mass3DBuild")
+)
source
LibCEED.create_interior_qfunctionMethod
create_interior_qfunction(ceed::Ceed, name::AbstractString)

Create a QFunction from the Q-function gallery, using the provided name.

Examples

  • Build and apply the 3D mass operator
build_mass_qf = create_interior_qfunction(c, "Mass3DBuild")
 apply_mass_qf = create_interior_qfunction(c, "MassApply")
  • Build and apply the 3D Poisson operator
build_poi_qf = create_interior_qfunction(c, "Poisson3DBuild")
-apply_poi_qf = create_interior_qfunction(c, "Poisson3DApply")
source
LibCEED.create_identity_qfunctionFunction
create_identity_qfunction(c::Ceed, size, inmode::EvalMode, outmode::EvalMode)

Create an identity QFunction. Inputs are written into outputs in the order given. This is useful for Operators that can be represented with only the action of a ElemRestriction and Basis, such as restriction and prolongation operators for p-multigrid. Backends may optimize CeedOperators with this Q-function to avoid the copy of input data to output fields by using the same memory location for both.

source
LibCEED.apply!Method
apply!(qf::QFunction, Q, vin, vout)

Apply the action of a QFunction to an array of input vectors, and store the result in an array of output vectors.

source
+apply_poi_qf = create_interior_qfunction(c, "Poisson3DApply")
source
LibCEED.create_identity_qfunctionFunction
create_identity_qfunction(c::Ceed, size, inmode::EvalMode, outmode::EvalMode)

Create an identity QFunction. Inputs are written into outputs in the order given. This is useful for Operators that can be represented with only the action of a ElemRestriction and Basis, such as restriction and prolongation operators for p-multigrid. Backends may optimize CeedOperators with this Q-function to avoid the copy of input data to output fields by using the same memory location for both.

source
LibCEED.apply!Method
apply!(qf::QFunction, Q, vin, vout)

Apply the action of a QFunction to an array of input vectors, and store the result in an array of output vectors.

source
diff --git a/previews/PR1734/Quadrature.html b/previews/PR1734/Quadrature.html index a4dd3ad1d..9fb8ebe6a 100644 --- a/previews/PR1734/Quadrature.html +++ b/previews/PR1734/Quadrature.html @@ -1,2 +1,2 @@ -Quadrature · LibCEED.jl Docs

Quadrature

LibCEED.gauss_quadratureFunction
gauss_quadrature(q)

Return the Gauss-Legendre quadrature rule with q points (integrates polynomials of degree $2q-1$ exactly).

A tuple (x,w) is returned.

source
LibCEED.lobatto_quadratureFunction
lobatto_quadrature(q, mode::Mode=Abscissa)

Return the Gauss-Lobatto quadrature rule with q points (integrates polynomials of degree $2q-3$ exactly).

If mode is AbscissaAndWeights, then both the weights and abscissa are returned as a tuple (x,w).

Otherwise, (if mode is Abscissa), then only the abscissa x are returned.

source
+Quadrature · LibCEED.jl Docs

Quadrature

LibCEED.gauss_quadratureFunction
gauss_quadrature(q)

Return the Gauss-Legendre quadrature rule with q points (integrates polynomials of degree $2q-1$ exactly).

A tuple (x,w) is returned.

source
LibCEED.lobatto_quadratureFunction
lobatto_quadrature(q, mode::Mode=Abscissa)

Return the Gauss-Lobatto quadrature rule with q points (integrates polynomials of degree $2q-3$ exactly).

If mode is AbscissaAndWeights, then both the weights and abscissa are returned as a tuple (x,w).

Otherwise, (if mode is Abscissa), then only the abscissa x are returned.

source
diff --git a/previews/PR1734/UserQFunctions.html b/previews/PR1734/UserQFunctions.html index afc11bf28..35f964c53 100644 --- a/previews/PR1734/UserQFunctions.html +++ b/previews/PR1734/UserQFunctions.html @@ -39,4 +39,4 @@ dXdxdXdxT = getvoigt(@view(qdata[i,:]), CeedDim(dim)) dui = SVector{dim}(@view(du[i,:])) dv[i,:] .= dXdxdXdxT*dui -end

First, the matrix $w \det(J) J^{-\intercal} J^{-1}$ is stored in the variable dXdxdXdxT. The symmetric entries of this matrix are accesed using @view(qdata[i,:]), which avoids allocations. getvoigt is used to convert from Voigt notation to a symmetric matrix, which returns a statically sized SMatrix. The version for the correct spatial dimension is selected using CeedDim(dim), which allows for compile-time dispatch, since dim is a constant whose value is known as a constant when the Q-function is JIT compiled.

Then, the gradient of $u$ at the given quadrature point is loaded as a fixed-size SVector. The result is placed into the output array, where the StaticArrays.jl package evaluates dXdxdXdxT*dui using an optimized matrix-vector product for small matrices (since their sizes are known statically).

GPU Kernels

If the Ceed resource uses a CUDA backend, then the user Q-functions defined using @interior_qf are automatically compiled as CUDA kernels using CUDA.jl. Some Julia features are not available in GPU code (for example, dynamic dispatch), so if the Q-function is intended to be run on the GPU, the user should take care when defining the body of the user Q-function.

+end

First, the matrix $w \det(J) J^{-\intercal} J^{-1}$ is stored in the variable dXdxdXdxT. The symmetric entries of this matrix are accesed using @view(qdata[i,:]), which avoids allocations. getvoigt is used to convert from Voigt notation to a symmetric matrix, which returns a statically sized SMatrix. The version for the correct spatial dimension is selected using CeedDim(dim), which allows for compile-time dispatch, since dim is a constant whose value is known as a constant when the Q-function is JIT compiled.

Then, the gradient of $u$ at the given quadrature point is loaded as a fixed-size SVector. The result is placed into the output array, where the StaticArrays.jl package evaluates dXdxdXdxT*dui using an optimized matrix-vector product for small matrices (since their sizes are known statically).

GPU Kernels

If the Ceed resource uses a CUDA backend, then the user Q-functions defined using @interior_qf are automatically compiled as CUDA kernels using CUDA.jl. Some Julia features are not available in GPU code (for example, dynamic dispatch), so if the Q-function is intended to be run on the GPU, the user should take care when defining the body of the user Q-function.

diff --git a/previews/PR1734/index.html b/previews/PR1734/index.html index 61e4365b3..9aba86535 100644 --- a/previews/PR1734/index.html +++ b/previews/PR1734/index.html @@ -23,4 +23,4 @@ CeedVectorRestoreArray(u, &u_host); CeedVectorRestoreArrayRead(mesh_coords, &x_host);

is replaced with the following equivalent Julia code

@witharray_read(x_host=mesh_coords, size=(mesh_size÷dim, dim),
     @witharray(u_host=u, size=(sol_size,1),
-        sum!(u_host, x_host)))

The macro version can provide better performance if a closure is required, and allow for convenient reshaping of the vector into equivalently sized matrices or tensors.

Library configuration

Ceed objects

Utilities

C interface

+ sum!(u_host, x_host)))

The macro version can provide better performance if a closure is required, and allow for convenient reshaping of the vector into equivalently sized matrices or tensors.

Library configuration

Ceed objects

Utilities

C interface

diff --git a/previews/PR1734/search.html b/previews/PR1734/search.html index 8df301d07..ad4296ab3 100644 --- a/previews/PR1734/search.html +++ b/previews/PR1734/search.html @@ -1,2 +1,2 @@ -Search · LibCEED.jl Docs

Loading search...

    +Search · LibCEED.jl Docs

    Loading search...