Skip to content
Snippets Groups Projects
Commit f5a0dda3 authored by Pierre Augier's avatar Pierre Augier
Browse files

New organisation of templates in subdirectories

parent 3bfeab9c
No related branches found
No related tags found
1 merge request!89fluidsimfoam-multi-region-snappy
Showing
with 9 additions and 8 deletions
......@@ -159,8 +159,9 @@
def new_file_generator_class(file_name, dir_name="0"):
cls_name = f"FileGenerator{camelize(file_name)}"
relative_path = f"{dir_name}/{file_name}"
return type(
cls_name,
(FileGenerator,),
{
"dir_name": dir_name,
......@@ -162,10 +163,10 @@
return type(
cls_name,
(FileGenerator,),
{
"dir_name": dir_name,
"rel_path": f"{dir_name}/{file_name}",
"template_name": f"{file_name}.jinja",
"_name": underscore(file_name.replace(".", "_")),
"rel_path": relative_path,
"template_name": f"{relative_path}.jinja",
"_name": underscore(file_name.replace(".", "_").replace("/", "_")),
},
)
......@@ -28,8 +28,8 @@
params.resources = [
templates_dir,
templates_dir / "epsilon.jinja",
str(templates_dir / "k.jinja") + " -> 0",
templates_dir / "0/epsilon.jinja",
str(templates_dir / "0/k.jinja") + " -> 0",
f"{templates_dir} -> system",
"package-data(fluidsimfoam_cbox.templates) -> constant",
]
......@@ -43,6 +43,6 @@
if index_sim == 0:
# testing params.output.resources
assert (sim.path_run / "templates/p_rgh.jinja").exists()
assert (sim.path_run / "templates/0/p_rgh.jinja").exists()
assert (sim.path_run / "epsilon.jinja").exists()
assert (sim.path_run / "0/k.jinja").exists()
......@@ -47,7 +47,7 @@
assert (sim.path_run / "epsilon.jinja").exists()
assert (sim.path_run / "0/k.jinja").exists()
assert (sim.path_run / "system/templates/epsilon.jinja").exists()
assert (sim.path_run / "constant/templates/epsilon.jinja").exists()
assert (sim.path_run / "system/templates/0/epsilon.jinja").exists()
assert (sim.path_run / "constant/templates/0/epsilon.jinja").exists()
@skipif_executable_not_available("buoyantBoussinesqPimpleFoam")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment