-
Notifications
You must be signed in to change notification settings - Fork 28
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
The Spatio-Temporal Path system #117
base: devel
Are you sure you want to change the base?
Conversation
close idaholab#116 This PR adds a new system associated with the syntax block `[SpatioTemporalPaths]`. Multiple SpatioTemporalPath-derived objects can be added under that syntax block. I have implemented 3 objects so far: - `PiecewiseLinearSpatioTemporalPath`: This one accepts input file vectors `t`, `x`, `y`, `z` and constructs a spatio-temporal path object. - `CSVPiecewiseLinearSpatioTemporalPath`: This one is similar to the previous one but instead reads from a csv file. - `FunctionSpatioTemporalPath`: This one accepts moose functions for `x`, `y` and `z`. Once a `SpatioTemporalPath` object is constructed, other `MooseObject`s can retrieve path given its name from the warehouse, through the `SpatioTemporalPathInterface` interface. See e.g. `ADMovingHeatSource` for how that coupling works. Each spatio-temporal path objects recomputes several path-related information at every time step: - `SpatioTemporalPath::position()` returns the current path front. - `SpatioTemporalPath::velocity()` returns the current path moving velocity. - `SpatioTemporalPath::direction()` returns the current path direction. Variants of the above methods exist which accepts a time and computes the corresponding path information at the specified time. By default the path-related information is recomputed at every time step, i.e. the path information is "live". The users have control over how often the path-related information is updated by the parameter `update_interval`. There are also methods that retrieve the path-related information from the previous update: - `SpatioTemporalPath::previousPosition()` - `SpatioTemporalPath::previousVelocity()` - `SpatioTemporalPath::previousDirection()` An object deriving from `SpatioTemporalPath` only need to override one single method `Point position(Real t) const`. Default implementations are provided for `RealVectorValue velocity(Real t)` and `RealVectorValue direction(Real t)` which use finite-differencing to compute the derivatives. The developer can optionally override these methods to provide more efficient/accurate implementations. Utility methods are provided to compute the tangential and normal components of the distance between a given point and the path's current position. - `SpatioTemporalPath::tangentialDistance(const Point & p)` - `SpatioTemporalPath::normalDistance(const Point & p)` Similarly, variants of the above methods exist which additionally accepts a specified time. Spatio-temporal paths are useful in many scenarios. I have added two concrete examples for demonstration purposes: - `ADMovingHeatSource` and `ADMovingEllipsoidalHeatSource` - `SpatioTemporalPathElementSubdomainModifier` Their names are self-explanatory. Note that `ADMovingEllipsoidalHeatSource` makes use of the tangential and normal distance to effectively "rotate" the ellipsoidal heat source.
Job Documentation on 554b071 wanted to post the following: View the site here This comment will be updated on new commits. |
Job Coverage on 554b071 wanted to post the following: Coverage
Warnings
This comment will be updated on new commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution @hugary1995! I can see this being incredibly useful.
Not done here quite yet, but I wanted to note my current progress since there is some low-hanging fruit to address. Will dive in more tomorrow!
|
||
!syntax description /Materials/ADMovingEllipsoidalHeatSource | ||
|
||
## Example Input File Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add example input file syntax for each of these documentation files, for those objects present in the added tests. This applies to all the new documentation files except for the action and system pages.
const ADMaterialProperty<Real> & _a; | ||
/// Length of the ellipsoid semi-axis perpendicular to the path direction | ||
const ADMaterialProperty<Real> & _b; | ||
/// Process efficienty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Process efficienty | |
/// Process efficiency |
design = 'ADMovingEllipsoidalHeatSource.md FunctionSpatioTemporalPath.md' | ||
requirement = 'The system shall be able to use a function-defined path to evolve the heat source.' | ||
[] | ||
[esm] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[esm] | |
[element_subdomain_modifier] |
I am OK with the acronym being used in the input file naming, but would like this to be written out for the TestHarness output, since its an unfamiliar acronym to some.
@@ -0,0 +1,32 @@ | |||
# SpatioTemporalPath System |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a general comment/question - have you thought about (or do you see) this system being applied to some of our current laser melting and laser welding examples? I wonder if there's some quality of life updates to be made in some of these older examples after this goes in....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fix the current documentation failures.
@@ -0,0 +1,3 @@ | |||
# AddSpatioTemporalPathAction | |||
|
|||
This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPath/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPath/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system. | |
This action registers objects derived from [`SpatioTemporalPath`](SpatioTemporalPaths/index.md) into the current problem. See the linked page for more details on the usage of the `SpatioTemporalPath` system. |
!syntax list /SpatioTemporalPath objects=True actions=False subsystems=False | ||
|
||
!syntax list /SpatioTemporalPath objects=False actions=False subsystems=True | ||
|
||
!syntax list /SpatioTemporalPath objects=False actions=True subsystems=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!syntax list /SpatioTemporalPath objects=True actions=False subsystems=False | |
!syntax list /SpatioTemporalPath objects=False actions=False subsystems=True | |
!syntax list /SpatioTemporalPath objects=False actions=True subsystems=False | |
!syntax list /SpatioTemporalPaths objects=True actions=False subsystems=False | |
!syntax list /SpatioTemporalPaths objects=False actions=False subsystems=True | |
!syntax list /SpatioTemporalPaths objects=False actions=True subsystems=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, finally had time to finish this review. Thanks for this new feature! A couple more comments about parameter defaults and user documentation, but I think we'll be ready to go soon.
MooseEnum header_flag("OFF ON AUTO", "AUTO"); | ||
params.addParam<MooseEnum>("file_header", | ||
header_flag, | ||
"Set the header flag. ON: use the first row has header, OFF: assumes " | ||
"no header, AUTO: attempt to determine if a header exists."); | ||
MooseEnum format_flag("COLUMNS ROWS", "COLUMNS"); | ||
params.addParam<MooseEnum>("file_format", format_flag, "Set the file format (rows vs. columns)."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should let the user know the default enum case for both of these params. I don't remember seeing such a mention in the documentation, so it should be done either here in the param description or in the markdown.
MooseEnum outside_behavior("CONSTANT EXTRAPOLATION EXCEPTION", "CONSTANT"); | ||
params.addParam<MooseEnum>( | ||
"outside", | ||
outside_behavior, | ||
"The method to use when extrapolating the path position outside its temporal support. " | ||
"CONSTANT: Return the closest path point; EXTRAPOLATION: Linear extrapolation; EXCEPTION: " | ||
"Raise an exception when trying to extrapolate."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, should mention the default either here or in the documentation discussion.
Just took a look at the coverage diff - could you also add some error checking tests? The majority of the diff is missing coverage on |
close #116
This PR adds a new system associated with the syntax block
[SpatioTemporalPaths]
. Multiple SpatioTemporalPath-derived objects can be added under that syntax block. I have implemented 3 objects so far:PiecewiseLinearSpatioTemporalPath
: This one accepts input file vectorst
,x
,y
,z
and constructs a spatio-temporal path object.CSVPiecewiseLinearSpatioTemporalPath
: This one is similar to the previous one but instead reads from a csv file.FunctionSpatioTemporalPath
: This one accepts moose functions forx
,y
andz
.Once a
SpatioTemporalPath
object is constructed, otherMooseObject
s can retrieve path given its name from the warehouse, through theSpatioTemporalPathInterface
interface. See e.g.ADMovingHeatSource
for how that coupling works.Each spatio-temporal path objects recomputes several path-related information at every time step:
SpatioTemporalPath::position()
returns the current path front.SpatioTemporalPath::velocity()
returns the current path moving velocity.SpatioTemporalPath::direction()
returns the current path direction.Variants of the above methods exist which accepts a time and computes the corresponding path information at the specified time.
By default the path-related information is recomputed at every time step, i.e. the path information is "live". The users have control over how often the path-related information is updated by the parameter
update_interval
. There are also methods that retrieve the path-related information from the previous update:SpatioTemporalPath::previousPosition()
SpatioTemporalPath::previousVelocity()
SpatioTemporalPath::previousDirection()
An object deriving from
SpatioTemporalPath
only need to override one single methodPoint position(Real t) const
. Default implementations are provided forRealVectorValue velocity(Real t)
andRealVectorValue direction(Real t)
which use finite-differencing to compute the derivatives. The developer can optionally override these methods to provide more efficient/accurate implementations.Utility methods are provided to compute the tangential and normal components of the distance between a given point and the path's current position.
SpatioTemporalPath::tangentialDistance(const Point & p)
SpatioTemporalPath::normalDistance(const Point & p)
Similarly, variants of the above methods exist which additionally accepts a specified time.
Spatio-temporal paths are useful in many scenarios. I have added two concrete examples for demonstration purposes:
ADMovingHeatSource
andADMovingEllipsoidalHeatSource
SpatioTemporalPathElementSubdomainModifier
Their names are self-explanatory. Note that
ADMovingEllipsoidalHeatSource
makes use of the tangential and normal distance to effectively "rotate" the ellipsoidal heat source.