Gplates
gplates
GplatesVelocityFunction(function_space, *args, gplates_connector=None, top_boundary_marker='top', **kwargs)
Bases: GPlatesFunctionalityMixin
, Function
Extends firedrake.Function
to incorporate velocities calculated by
Gplates, coming from plate tectonics reconstion.
GplatesVelocityFunction
is designed to associate a Firedrake function with a GPlates
connector, allowing the integration of plate tectonics reconstructions. This is particularly
useful when setting "top" boundary condition for the Stokes systems when performing
data assimilation (sequential or adjoint).
Attributes:
Name | Type | Description |
---|---|---|
dbc |
DirichletBC
|
A Dirichlet boundary condition that applies the function only to the top boundary. |
boundary_coords |
ndarray
|
The coordinates of the function located at the "top" boundary, normalised, so that it is meaningful for pygplates. |
gplates_connector |
The GPlates connector instance used for fetching plate tectonics data. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
function_space |
The function space on which the GplatesVelocityFunction is defined. |
required | |
gplates_connector |
An instance of a pyGplatesConnector, used to integrate GPlates functionality or data. See Documentation for pyGplatesConnector. |
None
|
|
top_boundary_marker |
defaults to "top"
|
marker for the top boundary. |
'top'
|
val |
optional
|
Initial values for the function. Defaults to None. |
required |
name |
str
|
Name for the function. Defaults to None. |
required |
dtype |
data type
|
Data type for the function. Defaults to ScalarType. |
required |
Methods:
Name | Description |
---|---|
update_plate_reconstruction |
Updates the function values based on plate velocities from GPlates for a given model time. Note model time is non-dimensionalised |
Examples:
>>> gplates_function = GplatesVelocityFunction(V,
... gplates_connector=pl_rec_model,
... name="GplateVelocity")
>>> gplates_function.update_plate_reconstruction(ndtime=0.0)
Source code in g-adopt/gadopt/gplates/gplates.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
pyGplatesConnector(rotation_filenames, topology_filenames, oldest_age, delta_t=1.0, scaling_factor=1.0, nseeds=100000.0, nneighbours=4)
Bases: object
An interface to pygplates, used for updating top Dirichlet boundary conditions using plate tectonic reconstructions.
This class provides functionality to assign plate velocities at different geological ages to the boundary conditions specified with dbc. Due to potential challenges in identifying the plate id for a given point with pygplates, especially in high-resolution simulations, this interface employs a method of calculating velocities at a number of equidistant points on a sphere. It then interpolates these velocities for points assigned a plate id. A warning is raised for any point not assigned a plate id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rotation_filenames |
Union[str, List[str]]
|
Collection of rotation file names for pygplates. |
required |
topology_filenames |
Union[str, List[str]]
|
Collection of topology file names for pygplates. |
required |
oldest_age |
float
|
The oldest age present in the plate reconstruction model. |
required |
delta_t |
Optional[float]
|
The t window range outside which plate velocities are updated. |
1.0
|
scaling_factor |
Optional[float]
|
Scaling factor for surface velocities. |
1.0
|
nseeds |
Optional[int]
|
Number of seed points used in the Fibonacci sphere generation. Higher seed point numbers result in finer representation of boundaries in pygpaltes. Notice that the finer velocity variations will then result in more challenging Stokes solves. |
100000.0
|
nneighbours |
Optional[int]
|
Number of neighboring points when interpolating velocity for each grid point. Default is 4. |
4
|
Examples:
>>> connector = pyGplatesConnector(rotation_filenames, topology_filenames, oldest_age)
>>> connector.get_plate_velocities(ndtime=100)
Source code in g-adopt/gadopt/gplates/gplates.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
get_plate_velocities(target_coords, ndtime)
Returns plate velocities for the specified target coordinates at the top boundary of a sphere, for a given non-dimensional time, by integrating plate tectonic reconstructions from pyGplates.
This method calculates new plate velocities. It utilizes the cKDTree data structure for efficient nearest neighbor searches to interpolate velocities onto the mesh nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_coords |
array - like
|
Coordinates of the points at the top of the sphere. |
required |
ndtime |
float
|
The non-dimensional time for which plate velocities are to be calculated and assigned. This time is converted to geological age and used to extract relevant plate motions from the pyGplates model. |
required |
Raises:
Type | Description |
---|---|
Exception
|
If the requested ndt ime is a negative age (in the future), indicating an issue with the time conversion. |
Notes
- The method uses conversions between non-dimensionalised time and geologic age.
- Velocities are non-dimensionalised and scaled for the simulation before being applied.
Source code in g-adopt/gadopt/gplates/gplates.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|
ndtime2age(ndtime)
Converts non-dimensionalised time to age (Myrs before present day).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ndtime |
float
|
The non-dimensionalised time to be converted. |
required |
Returns:
Name | Type | Description |
---|---|---|
float |
The converted geologic age in millions of years before present day(Ma). |
Source code in g-adopt/gadopt/gplates/gplates.py
241 242 243 244 245 246 247 248 249 250 251 |
|
age2ndtime(age)
Converts geologic age (years before present day in Myrs (Ma) to non-dimensionalised time.
Args:
age (float): geologic age (before present day in Myrs)
Returns:
- float: non-dimensionalised time
Source code in g-adopt/gadopt/gplates/gplates.py
253 254 255 256 257 258 259 260 261 262 |
|