CoupledVarThresholdElementSubdomainModifier: x, y, z dependence #20064
-
Hi, I have been trying to define a variable to be used with CoupledVarThresholdElementSubdomainModifier so that certain points on the mesh are modified while others are not. I encoded a spatial dependence on x, y, z points and made a class that inherits from Function.h. It returns a 0 or 1 to an AuxVariable if conditions are met. If the result is 1, then CoupledVarThresholdElementSubdomainModifier modifies the subdomain. However when testing this function, the spatial dependence was nonexistent and it seemed that only the last value of the function was used for the entire mesh. I decided to try adapting the code to a new class that inherits from ADMaterial.h. This way each qp can be modified depending on the spatial conditions. However, when using the virtual function computeQpProperties(), I cannot easily use the x, y, z points like I could when using the virtual function value() in a class that inherits from Function.h. I cannot use I am not sure how to deal with this issue or whether I am taking the right approach. How can I use spatial data within computeQpProperties? Is a material property output even compatible with CoupledVarThresholdElementSubdomainModifier? Is there a better way to structure the output of a function so it has spatial dependence? Thank you, Cameron |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello From a material computeQpProperties routine, you can access spatial properties using: See this code for example: Guillaume |
Beta Was this translation helpful? Give feedback.
Hello
From a material computeQpProperties routine, you can access spatial properties using:
_q_point[_qp]
See this code for example:
https://github.com/idaholab/moose/blob/next/framework/src/materials/GenericFunctionMaterial.C
Guillaume