morphogen.pipeline¶
Execution of configurations: batches of realizations and RVE studies.
Outputs of a run (in outputs.directory):
<name>_<index>.<ext>files of each realization (geometry, images, voxel meshes…; conforming tetrahedral meshes are<name>_<index>_tet.<ext>, and local fields<name>_<index>_<property>_<bc>.vtuor.vti);results.csv(results_task<i>of<n>.csvfor split runs): one row per realization with its seed, measurements and apparent properties (columns<property>.<bc>; of a stiffness, the upper triangles of the stiffnessstiffness.<bc>.C11…C66and of its compliancestiffness.<bc>.S11…S66, in the notation thatrun.jsonstates, beside its engineering constants), the solid fraction, and the relative, normalized (per unit of solid fraction) and specific values of the moduli and conductivities (morphogen.homogenization.postprocess);homogenization.csv(homogenization_task<i>of<n>.csv): one row per realization, apparent property (or named loading or path) and boundary condition, with the macroscopic response, the energy estimate, the isotropy criterion and the solver data;<name>_<index>_<path>_<bc>.csv: the macroscopic curves of each loading path (time, strain, stress, temperature, mean cumulated plastic strain, and the mean stress and plastic strain of each phase), and withfieldsthe element fields at the end of each of its segments (..._<k>.vtu);with
outputs.tables, these tables also as.txt(tab-separated) or.xlsx;with a
visualizationsection, the figures and videos of the first realizations (<name>_<index>_<view>.<format>, seemorphogen.viz.workflow): sections and orthoslices of the image, views of the mesh, fields on the deformed mesh, curves;run.json: configuration, theoretical values, versions and timing (and the notation of the stiffness and compliance,stiffness_notation, when they are computed);with
outputs.database, the run is added to that database of the configurations tested (morphogen.results);for RVE studies,
rve_report.json/.md/.texand figures (when matplotlib is installed): statistics, scaling-law fits and RVE sizes (seemorphogen.rve); with the stiffness, per boundary condition and size the mean stiffnessCbar, its complianceS = Cbar^-1and the standard deviation of each component, with the RVE size of each component (rve_stiffness.csv,rve_stiffness_<bc>.png; the conductivity tensor likewise,rve_conductivity_tensor.csv);for window studies,
results.csvhas one row per window size (window_edge,volume, the numbernof windows): the statistics of the volume fraction (mean,variance,relative_error) and, of each tensor of the windows (morphogen.rve.windows: the homogenization computingstiffnessorconductivity_tensorby FFT), the components of their mean<tensor>.periodic.C11…, of its inverseS11… and their standard deviationsC11_std…;run.jsonholds the apparent tensors of the whole realization (apparent). Withrve.shifts(> 1), the tilings shifted around the periodic realization (morphogen.rve.scaling) add the columntilingsaftern, then the windows of one tiling: the means over all the windows, the variances pooled within the tilings, from the same solutions.
- morphogen.pipeline.versions() dict[source]¶
The versions of morphoGen, Python, NumPy, SciPy, Numba (and pymmg) and the platform, recorded with the results.
- morphogen.pipeline.write_rows(path: Path, rows: list[dict]) Path[source]¶
Rows (mappings) written as a CSV file, the union of their keys as columns in their order of appearance.
- morphogen.pipeline.read_rows(path) list[dict][source]¶
The rows of a CSV file as mappings, its numbers as floats.
- morphogen.pipeline.write_path_fields(target: Path, support, arrays: dict) Path[source]¶
Fields of a loading path at one time (
PathResult.fields) on their support:.vtuof a mesh, the displacement of the nodes as point data, the other fields as cell data;.vtiof an image, one array per component (stress_11…,displacement_1…, the displacement at the centres of the voxels). The suffix oftargetis replaced by that of the format; returns the path of the file written.
- morphogen.pipeline.read_path_texture(path) tuple[ndarray, ndarray][source]¶
The lattices of the crystals in a file of the fields of a loading path (
write_path_fields(): a.vtiof the voxels of an image, a.vtuof the elements of a mesh): their orientations (Bunge angles in degrees, m x 3) and their volumes (m; those of the elements, or one per voxel). The fields have these orientations for crystals in finite strains, or whose twins turn their lattices.
- morphogen.pipeline.run(cfg: RunConfig, *, task_id: int = 0, n_tasks: int = 1, jobs: int = 1, resume: bool = False) Path[source]¶
Execute a configuration; returns the output directory.
n_tasks> 1 runs the sharetask_idof the realizations (a task of a job array;morphogen.parallel.merge()gathers the tasks);jobsprocesses run them on this machine;resumeskips the realizations already done (seemorphogen.parallel). Scripts calling it withjobs> 1 must guard their main code withif __name__ == "__main__":(processes are started withspawn).
- morphogen.pipeline.run_items(cfg: RunConfig, outdir: Path, task_id: int, n_tasks: int, *, jobs: int = 1, resume=False) None[source]¶
Realizations of a batch or of an ensemble RVE study (the share of one task).
- morphogen.pipeline.run_batch(cfg: RunConfig, outdir: Path, task_id: int, n_tasks: int) None[source]¶
The items of a batch configuration that fall to a task (
task_idamongn_tasks) generated and processed, their outputs and records inoutdir.
- morphogen.pipeline.run_ensemble(cfg: RunConfig, outdir: Path, task_id: int, n_tasks: int) None[source]¶
The realizations of an RVE study by the ensemble method that fall to a task (
task_idamongn_tasks) generated and processed, their outputs and records inoutdir.
- morphogen.pipeline.run_windows(cfg: RunConfig, outdir: Path) None[source]¶
An RVE study by the window method: one realization of the size of the study, measured in windows of the sizes given, its statistics, results and report in
outdir: of the volume fraction, and of the tensors of the windows when the homogenization computes them (morphogen.rve.window_tensors(): the realization solved once per unit load by the FFT solver, each window its mean mutual energies); withrve.shifts, over the tilings shifted around the periodic realization, from the same solutions.
- morphogen.pipeline.study_options(spec: RVESpec) StudyOptions[source]¶
The options of an RVE study (
morphogen.rve.StudyOptions) from the sectionrveof a configuration.
- morphogen.pipeline.build_report(rows: list[dict], spec: RVESpec, properties=None, theory=None, *, fe_rows: list[dict] | None = None, count=None, bound_values: dict | None = None, group_by: str | None = None) StudyReport[source]¶
RVE report of results tables (wide
rows; longfe_rowsfrom homogenization), with the mean stiffness and compliance per volume of each boundary condition whose stiffness the rows hold (morphogen.rve.tensors_from_rows(); the conductivity tensor likewise): all of them whenpropertiesis None, else those it names (stiffness,stiffness.<bc>,conductivity_tensor…).
- morphogen.pipeline.write_report(rows, outdir: Path, spec, cfg: RunConfig | None = None, properties=None, *, fe_rows=None) StudyReport[source]¶
Write rve_report.json/.md/.tex (and plots) of a study.
- morphogen.pipeline.report_markdown(report: StudyReport) str[source]¶
The Markdown report of an RVE study (
morphogen.rve.report.markdown()).