cbcflow.utils.common module

Utility functions common across cbcflow.

Classes

class cbcflow.utils.common.Timer(enabled)
completed(msg)

Functions

cbcflow.utils.common.time_to_string(t)
cbcflow.utils.common.timeit(t0=None, msg=None)
cbcflow.utils.common.cbcflow_print(msg)
cbcflow.utils.common.has_converged(r, iter, method, maxiter=200, tolerance=0.0001)

Check if solution has converged.

cbcflow.utils.common.on_master_process()
cbcflow.utils.common.epsilon(u)

Return symmetric gradient.

cbcflow.utils.common.as_scalar_spaces(V)

Return a list of scalar (sub-)spaces consistent with V that can be used to apply DirichletBCs to components.

cbcflow.utils.common.get_memory_usage()

Create internal link in hdf5 file

cbcflow.utils.common.as_object(u)

Return a single object if possible, else a list.

cbcflow.utils.common.cbcflow_warning(msg)
cbcflow.utils.common.in_serial()
cbcflow.utils.common.cbcflow_log(level, msg)
cbcflow.utils.common.as_scalar_space(V)

Return a scalar (sub-)space consistent with V that can be used to construct a new Function.

cbcflow.utils.common.as_list(u)

Return a list of objects.

cbcflow.utils.common.parallel_eval(func, point, gather=True)

Parallel-safe function evaluation

cbcflow.utils.common.sigma(u, p, mu)

Return stress tensor.

cbcflow.utils.common.safe_mkdir(dir)

Create directory without exceptions in parallel.

cbcflow.utils.common.is_periodic(bcs)

Check if boundary conditions are periodic.