Gridap.Helpers
Gridap.Helpers — Module
This module provides a set of helper macros and helper functions
Exported names
@abstractmethod, @check, @notimplemented, @notimplementedif, @unreachable, GridapLocalInt, GridapType, first_and_tail, get_val_parameter, public_names_in_md, set_debug_mode, set_local_integer_type, set_performance_mode, tfill,
Gridap.Helpers.GridapLocalInt — Type
const GridapLocalInt <: IntegerInteger type used for local indexing in Gridap. It will be used, for instance, for the local numbering of faces and degrees of freedom within a cell.
Defaults to Int8, which is enough for most applications (up to 127 vertices/faces/dofs per cell). Its value can be changed at compile time using set_local_integer_type.
Gridap.Helpers.GridapType — Type
abstract type GridapType endGridap.Helpers.first_and_tail — Method
first_and_tail(a::Tuple)Equivalent to (first(a), Base.tail(a)).
Gridap.Helpers.get_val_parameter — Method
get_val_parameter(::Val{T}) where T
get_val_parameter(::Type{Val{T}}) where TReturns T.
Gridap.Helpers.public_names_in_md — Method
public_names_in_md(m::Module[; change_link=Dict())Return a string displaying exported and other public names of the module for printing in markdown, as a reference "[`name`](@ref)". If the dictionary change_link has a key for name, then it is used as a link instead of name itself: "[`name`](@ref $(change_link[name]) )"
Gridap.Helpers.set_debug_mode — Method
set_debug_mode()Equivalent to set_execution_mode("debug").
Gridap.Helpers.set_execution_mode — Method
set_execution_mode(new_mode::String)Sets the execution mode to either "debug" or "performance", which controls the behavior of the @check macro within the Gridap package.
Debug mode (default): The
@checkmacro will be active, which activates consistency checks within the library. This mode is recommended for development and debugging purposes.Performance mode: The
@checkmacro will be deactivated. This mode is recommended for production runs, where no errors are expected.
Pre-defined functions set_debug_mode and set_performance_mode are also available. Feature only available in Julia 1.6 and later due to restrictions from Preferences.jl.
Gridap.Helpers.set_local_integer_type — Method
set_local_integer_type(T::Type{<:Integer})Sets the integer type used for local indexing in Gridap. See GridapLocalInt for more details.
Gridap.Helpers.set_performance_mode — Method
set_performance_mode()Equivalent to set_execution_mode("performance").
Gridap.Helpers.tfill — Method
tfill(v, ::Val{D}) where DReturns a tuple of length D that contains D times the object v. In contrast to tuple(fill(v,D)...) which returns the same result, this function is type-stable.
Gridap.Helpers.@abstractmethod — Macro
@abstractmethodMacro used in generic functions that must be overloaded by derived types.
Gridap.Helpers.@check — Macro
@check condition
@check condition "Error message"Macro used to make sure that condition is fulfilled, like @assert but the check gets deactivated when running Gridap in performance mode.
Gridap.Helpers.@notimplemented — Macro
@notimplemented
@notimplemented "Error message"Macro used to raise an error, when something is not implemented.
Gridap.Helpers.@notimplementedif — Macro
@notimplementedif condition
@notimplementedif condition "Error message"Macro used to raise an error if the condition is true
Gridap.Helpers.@unreachable — Macro
@unreachable
@unreachable "Error message"Macro used to make sure that a line of code is never reached.