Skip to content
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

added: allow for defining a function for textureproperties #520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akva2
Copy link
Member

@akva2 akva2 commented Nov 12, 2021

this allows for a generic f(texture(X)) where f can be scalar or vector
valued.

ideally f would be a function of property name but
as we do not have a base class for f: R -> R^3 we have to use the
f: R^3 -> R^3 type for vector functions. for this reason, both
scalar and vectorial functions have to refer to the texture value as 'x'.

@akva2
Copy link
Member Author

akva2 commented Nov 12, 2021

jenkins build this with downstreams please

this allows for a generic f(texture(X)) where f can be scalar or vector
valued.

ideally f would be a function of property name but
as we do not have a base class for f: R -> R^3 we have to use the
f: R^3 -> R^3 type for vector functions. for this reason, both
scalar and vectorial functions have to refer to the texture value as 'x'.
@akva2
Copy link
Member Author

akva2 commented Nov 12, 2021

jenkins build this with downstreams please

@kmokstad
Copy link
Contributor

Regarding "as we do not have a base class for f: R -> R^3", you can do, e.g., typedef utl::Function<Real,Vec3> Vec3Func; to get Vec3Func a base class for such functions. See for instance TractionField.h where I use that to represent a time-dependent vector field.

@akva2
Copy link
Member Author

akva2 commented Nov 17, 2021

yeah, i realize that it's doable but i'd have to implement a ExprFunc version of it.

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 this pull request may close these issues.

None yet

2 participants