queens_interfaces.fourc package#
Modules interfacing 4C.
Modules for interfacing the for multiphysics code 4C ( 4C-multiphysics/4C)
Submodules#
queens_interfaces.fourc.driver module#
Driver to run 4C.
- class Fourc[source]#
Bases:
JobscriptDriver to run 4C.
- __init__(parameters, input_templates, executable, files_to_copy=None, data_processor=None, gradient_data_processor=None, post_processor='', post_options='', mpi_cmd='/usr/bin/mpirun --bind-to none')[source]#
Initialize Fourc object.
- Parameters:
parameters (Parameters) – Parameters object
input_templates (str, Path, dict) – path to simulation input template
executable (str, Path) – path to main executable of respective software
files_to_copy (list, opt) – files or directories to copy to experiment_dir
data_processor (Callable, opt) – data processor
gradient_data_processor (Callable, opt) – data processor class for gradient data
post_processor (path, opt) – path to post_processor
post_options (str, opt) – options for post-processing
mpi_cmd (str, opt) – mpi command
queens_interfaces.fourc.random_material_preprocessor module#
4C random material fields preprocessor.
- create_jinja_json_template(parameter_name, element_ids, keys, template_path)[source]#
Create jinja2 template for the material data.
- Parameters:
parameter_name (str) – Name of the parameter
element_ids (list) – List of element ids
keys (list) – List of parameter key
template_path (pathlib.Path) – Path to create the template
- create_random_elemenentwise_material_field(path_to_template, elements_section, extracting_condition, parameter_name, material_template_path)[source]#
Create random elementwise material field.
- Parameters:
path_to_template (str or Pathlib.path) – Path to 4C yaml template
elements_section (str) – Section of where to look for the elments
extracting_condition (callable) – Function to select the desired element
parameter_name (str) – Name of the parameter
material_template_path (str or Pathlib.path) – Path to generate the material template
- Returns:
dict – with parameter names and element locations
- extract_by_material_id(material_id)[source]#
Factory for material id comparison.
- Parameters:
material_id (int) – Desired material id
- Returns:
callable – function to check if an element has the correct id
- extract_elements(fourc_input, elements_section, extracting_condition)[source]#
Extract desired elements.
Currenlty the mean of the element nodes is used as representative location.
- Parameters:
fourc_input (FourCInput) – 4C input data
elements_section (str) – Section of where to look for the elments
extracting_condition (callable) – Function to select the desired element
- Returns:
tuple – element ids and representative element location