5.4. Utilities¶
5.4.1. Functions¶
5.4.1.1. boundarymesh_to_mesh_dofmap¶
Find the mapping from dofs on boundary FS to dofs on full mesh FS
5.4.1.2. cbc_log¶
Log on master process.
5.4.1.3. cbc_print¶
Print on master process.
5.4.1.4. cbc_warning¶
Raise warning on master process.
5.4.1.5. compute_connectivity¶
Compute connected regions of mesh. Regions are considered connected if they share a vertex through an edge.
5.4.1.6. create_function_from_metadata¶
Create a function from metadata
5.4.1.7. create_slice¶
Create a slicemesh from a basemesh.
Arguments:
basemesh: | Mesh to slice |
---|---|
point: | Point in slicing plane |
normal: | Normal to slicing plane |
closest_region: | Set to True to extract disjoint region closest to specified point |
crinkle_clip: | Set to True to return mesh of same topological dimension as basemesh |
Only 3D-meshes currently supported for slicing.
Slice-instances are intended for visualization only, and may produce erronous results if used for computations.
5.4.1.8. create_submesh¶
This function allows for a SubMesh-equivalent to be created in parallel
5.4.1.9. get_memory_usage¶
Return memory usage in MB
5.4.1.10. get_set_vector¶
Equivalent of setvector[set_indices] = getvector[get_indices] for global indices (MPI-blocking). Pass temp_array to avoid initiation of array on call.
5.4.1.11. import_fenicstools¶
Import fenicstools helper function.
5.4.1.12. in_serial¶
Return True if running in serial.
5.4.1.13. mesh_to_boundarymesh_dofmap¶
Find the mapping from dofs on full mesh FS to dofs on boundarymesh FS
5.4.1.14. on_master_process¶
Return True if on process number 0.
5.4.1.15. restriction_map¶
Return a map between dofs in Vb to dofs in V. Vb’s mesh should be a submesh of V’s Mesh.
5.4.1.16. safe_mkdir¶
Create directory without exceptions in parallel.
5.4.1.17. strip_code¶
Strips code of unnecessary spaces, comments etc.
5.4.1.18. time_to_string¶
Format time in seconds as a human readable string.
5.4.1.19. timeit¶
Simple timer
5.4.2. Classes¶
5.4.2.1. Loadable¶
Create an instance that reads a Field from file as specified by the parameters. Requires that the file is written in cbcpost (or in the same format).
Arguments:
filename: | Filename where function is stored |
---|---|
fieldname: | Name of Field |
timestep: | Timestep to load |
time: | Time |
saveformat: | Saveformat of field |
s function: | Function to load Field into |
This class is used internally from :class:’.Replay’ and :class:’Restart’, and made to be passed to PostProcessor.update_all.
5.4.2.2. Slice¶
Deprecated Slice-class