This documentation is not for the latest stable Salvus version.
%config Completer.use_jedi = False
# Standard Python packages
import matplotlib.pyplot as plt
import numpy as np
import os
import toml
# Salvus imports
from salvus.mesh import mesh_block
from salvus.mesh.unstructured_mesh import UnstructuredMesh
import salvus.flow.api
import salvus.flow.simple_config as sc
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "token")
sg = mesh_block.generators.cartesian.rectangle_2d(
nelem_x=40, nelem_y=60, max_x=4.0, max_y=6.0
)
mesh = sg.get_unstructured_mesh()
mesh.find_side_sets("cartesian")
input_mesh = mesh.copy()
input_mesh.attach_field("some_field", np.random.randn(mesh.npoint))
input_mesh.map_nodal_fields_to_element_nodal()
input_mesh.write_h5("initial_values.h5")
input_mesh