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

use cross from LinearAlgebra instead of Trixi.cross #63

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TrixiAtmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using Printf: @sprintf
using Static: True, False
using StrideArrays: PtrArray
using StaticArrayInterface: static_size
using LinearAlgebra: norm, dot, det
using LinearAlgebra: cross, norm, dot, det
using Reexport: @reexport
using LoopVectorization: @turbo
using HDF5: HDF5, h5open, attributes, create_dataset, datatype, dataspace
Expand Down
10 changes: 5 additions & 5 deletions src/equations/reference_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ This problem is adapted from Case 1 of the test suite described in the following
a * sin(lat_0))

# apply rotation using Rodrigues' formula
axis_cross_x_0 = Trixi.cross(axis, x_0)
axis_cross_x_0 = cross(axis, x_0)
x_0 = x_0 + sin(omega * t) * axis_cross_x_0 +
(1 - cos(omega * t)) * Trixi.cross(axis, axis_cross_x_0)
(1 - cos(omega * t)) * cross(axis, axis_cross_x_0)

# compute Gaussian bump profile
h = h_0 *
exp(-b_0 * ((x[1] - x_0[1])^2 + (x[2] - x_0[2])^2 + (x[3] - x_0[3])^2) / (a^2))

# get Cartesian velocity components
vx, vy, vz = omega * Trixi.cross(axis, x)
vx, vy, vz = omega * cross(axis, x)

# Prescribe the rotated bell shape and Cartesian velocity components.
# The last variable is the bottom topography, which we set to zero
Expand Down Expand Up @@ -90,9 +90,9 @@ end
a * sin(lat_0))

# apply rotation using Rodrigues' formula
axis_cross_x_0 = Trixi.cross(axis, x_0)
axis_cross_x_0 = cross(axis, x_0)
x_0 = x_0 + sin(omega * t) * axis_cross_x_0 +
(1 - cos(omega * t)) * Trixi.cross(axis, axis_cross_x_0)
(1 - cos(omega * t)) * cross(axis, axis_cross_x_0)

# compute Gaussian bump profile
h = h_0 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@ function init_elements_2d_manifold_in_3d!(elements,
# Compute the inverse Jacobian as the norm of the cross product of the covariant vectors
for j in eachnode(basis), i in eachnode(basis)
inverse_jacobian[i, j, element] = 1 /
norm(Trixi.cross(jacobian_matrix[:, 1, i,
j,
element],
jacobian_matrix[:, 2, i,
j,
element]))
norm(cross(jacobian_matrix[:, 1, i, j,
element],
jacobian_matrix[:, 2, i, j,
element]))
end
end

Expand Down
Loading