Gridap.Helpers
Gridap.Helpers
— ModuleThis module provides a set of helper macros and helper functions
The exported macros are:
Gridap.Helpers.GridapType
— Typeabstract type GridapType end
Gridap.Helpers.first_and_tail
— Methodfirst_and_tail(a::Tuple)
Equivalent to (first(a), Base.tail(a))
.
Gridap.Helpers.get_val_parameter
— Methodget_val_parameter(::Val{T}) where T
get_val_parameter(::Type{Val{T}}) where T
Returns T
.
Gridap.Helpers.set_debug_mode
— Methodset_debug_mode()
Equivalent to set_execution_mode("debug")
.
Gridap.Helpers.set_execution_mode
— Methodset_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 @check macro will be active, which activates consistency checks within the library. This mode is recommended for development and debugging purposes.
Performance mode: The @check macro 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_performance_mode
— Methodset_performance_mode()
Equivalent to set_execution_mode("performance")
.
Gridap.Helpers.tfill
— Methodtfill(v, ::Val{D}) where D
Returns 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@abstractmethod
Macro 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.