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(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]#

Bases: Jobscript

Driver to run 4C.

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

get_node_coordinates(fourc_input, node_ids)[source]#

Get node coordinates by id.

Parameters:
  • fourc_input (FourCInput) – 4C input data

  • node_ids (list) – List of node ids

Returns:

np.ndarray – Nodes coordintes