Skip to content

src/snek5000_cbox/templates/SIZE.j2 with params.oper.L... #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paugier opened this issue Nov 14, 2022 · 3 comments · Fixed by #38
Closed

src/snek5000_cbox/templates/SIZE.j2 with params.oper.L... #35

paugier opened this issue Nov 14, 2022 · 3 comments · Fixed by #38
Assignees
Milestone

Comments

@paugier
Copy link
Collaborator

paugier commented Nov 14, 2022

See #30 (comment) and few comments after.

It would be much better to avoid copy pasting of https://github.com/snek5000/snek5000/blob/main/src/snek5000/resources/SIZE.j2 and to extend this file with jinja2 (See https://jinja.palletsprojects.com/en/3.0.x/templates/#template-inheritance).

Then, the parameters u_oper_lx, u_oper_ly, u_oper_lz can be used in userbc and useric subroutines to avoid glmax.

@paugier paugier added this to the 0.1.0 milestone Nov 14, 2022
@ashwinvis
Copy link
Member

Good idea on template inheritance. If I understood the docs, it needs upstream support with a block defined as.

{% block user_size %} 
{% endblock %}

Other templates can also have such blocks to allow reusability.

@akhoubani
Copy link
Contributor

Good idea on template inheritance. If I understood the docs, it needs upstream support with a block defined as.

{% block user_size %} 
{% endblock %}

Other templates can also have such blocks to allow reusability.

I don't know how I should proceed now. Should I extend and add this block in the snek, as you opened the issue snek5000/snek5000#200?

@paugier
Copy link
Collaborator Author

paugier commented Nov 16, 2022

You can try to modify snek and to produce your own template from the snek template. You will need to learn how to use jinja2.

If it is actually too complicated, you can just for now copy-paste SIZE.j2 and modify it. It would be a good first step and we can use jinja2 inheritance later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants