Robert Koslover
Certified Consultant
Please login with a confirmed email address before reporting spam
Posted:
7 months ago
2024年4月16日 GMT-4 13:37
Updated:
7 months ago
2024年4月16日 GMT-4 13:36
I'm guessing that you may find Comsol's "spatial at" operator to be helpful. The explanation in the Help system may seem a bit overwhelming at first, but be patient. As an example in 3D space, to evaluate your expression expr, at an example (x,y,z) location = (1,0,-1), this would become: comp1.at3(1,0,-1,expr) .
Anyway, here's the details, in all their glory, from the Help system:
.....
SPATIAL AT
The operator evaluates an expression expr in a specific point in space. Typically, use ati without extra arguments when evaluating inside a mesh and add extra arguments when evaluating outside the mesh or even outside the geometry.
•
The scope.ati(<coordinate expressions>, expr) operator evaluates the expression expr in the geometry with the given scope (typically comp1 for Component 1 or a similar scope for another Component branch) on an i-dimensional entity in the point given by the coordinate expressions (at0 for a 0-dimensional entity, at1 for a 1-dimensional entity, at2 for a 2-dimensional entity, and at3 for a 3-dimensional entity). For example, comp1.at1(0,y,dom) evaluates dom in the two-dimensional geometry on an edge in the point (0, y). To use a certain ati operator variant, there must be a meshed geometric entity of the right dimension at the coordinates where it is evaluated; for example, at0 only works if the source geometry has a vertex in the point where you want to evaluate the expression. The number of arguments for the scope.ati operator is equal to the space dimension in the source component (the coordinate expressions) plus one (the expression to evaluate).
•
For two- and three-dimensional models, the evaluation on the domain level (that is, at2 for two-dimensional models and at3 for three-dimensional models) can take an extra argument 'evaltype'. The supported 'evaltype' values are 'mi' and 'minc'. Contrary to regular ati evaluations, these evaluation types do not require any domain meshes and can be evaluated in any given point. However, if there are two adjacent domains for which something is defined differently, the operator requires that the boundary between the domains is meshed. The 'mi' (mesh-independent evaluation) value checks that you have meshed all such required boundaries (even for variables that have nothing to do with the actual argument of the operator), whereas the 'minc' (mesh-independent no-check evaluation) value do not, and it might therefore give inaccurate results if not used correctly.
•
To all operators you can add a suffix (“_frameId”) that specifies the frame in which the coordinate expressions are used — for example, at1_spatial(x,y, expr). Without a suffix, the evaluation is performed in the material frame.
-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I'm guessing that you may find Comsol's "spatial at" operator to be helpful. The explanation in the Help system may seem a bit overwhelming at first, but be patient. As an example in 3D space, to evaluate your expression expr, at an example (x,y,z) location = (1,0,-1), this would become: comp1.at3(1,0,-1,expr) .
Anyway, here's the details, in all their glory, from the Help system:
.....
SPATIAL AT
The operator evaluates an expression expr in a specific point in space. Typically, use ati without extra arguments when evaluating inside a mesh and add extra arguments when evaluating outside the mesh or even outside the geometry.
•
The scope.ati(, expr) operator evaluates the expression expr in the geometry with the given scope (typically comp1 for Component 1 or a similar scope for another Component branch) on an i-dimensional entity in the point given by the coordinate expressions (at0 for a 0-dimensional entity, at1 for a 1-dimensional entity, at2 for a 2-dimensional entity, and at3 for a 3-dimensional entity). For example, comp1.at1(0,y,dom) evaluates dom in the two-dimensional geometry on an edge in the point (0, y). To use a certain ati operator variant, there must be a meshed geometric entity of the right dimension at the coordinates where it is evaluated; for example, at0 only works if the source geometry has a vertex in the point where you want to evaluate the expression. The number of arguments for the scope.ati operator is equal to the space dimension in the source component (the coordinate expressions) plus one (the expression to evaluate).
•
For two- and three-dimensional models, the evaluation on the domain level (that is, at2 for two-dimensional models and at3 for three-dimensional models) can take an extra argument 'evaltype'. The supported 'evaltype' values are 'mi' and 'minc'. Contrary to regular ati evaluations, these evaluation types do not require any domain meshes and can be evaluated in any given point. However, if there are two adjacent domains for which something is defined differently, the operator requires that the boundary between the domains is meshed. The 'mi' (mesh-independent evaluation) value checks that you have meshed all such required boundaries (even for variables that have nothing to do with the actual argument of the operator), whereas the 'minc' (mesh-independent no-check evaluation) value do not, and it might therefore give inaccurate results if not used correctly.
•
To all operators you can add a suffix (“_frameId”) that specifies the frame in which the coordinate expressions are used — for example, at1_spatial(x,y, expr). Without a suffix, the evaluation is performed in the material frame.
Please login with a confirmed email address before reporting spam
Posted:
7 months ago
2024年4月27日 GMT-4 04:35
Dr Koslover thank you very much
Dr Koslover thank you very much
Please login with a confirmed email address before reporting spam
Posted:
7 months ago
2024年5月4日 GMT-4 07:24
However, how to capture an expression in the spatial frame on a moving boundary? e.g. to capture the speed (or another quantity) of the (spatially) right most point on a rolling circle rolling to the right.
However, how to capture an expression in the spatial frame on a moving boundary? e.g. to capture the speed (or another quantity) of the (spatially) right most point on a rolling circle rolling to the right.