CliMA / CliMA/ClimaCore.jl

There are differences between `*` and `⋅` in MatrixFields

Open
#2,293 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Julia
Stars
117
Forks
19
Avg merge
3d 4h
Merged PRs (30d)
41

Description

Here is a reproducer:

```julia
using ClimaComms
using LinearAlgebra
ClimaComms.@import_required_backends
using ClimaCore.CommonSpaces
using ClimaCore: Operators, Fields, MatrixFields, Geometry, Spaces
FT = Float64;
space = ExtrudedCubedSphereSpace(FT;
z_elem = 10,
z_min = 0,
z_max = 1,
radius = 10,
h_elem = 10,
n_quad_points = 4,
staggering = CellCenter()
);
interpc2f_op = Operators.InterpolateC2F(
bottom = Operators.Extrapolate(),
top = Operators.Extrapolate(),
);
divf2c_op = Operators.DivergenceF2C();
divf2c_matrix = MatrixFields.operator_matrix(divf2c_op);
gradc2f_op = Operators.GradientC2F(
top = Operators.SetGradient(Geometry.WVector(FT(0))),
bottom = Operators.SetGradient(Geometry.WVector(FT(0))),
);
gradc2f_matrix = MatrixFields.operator_matrix(gradc2f_op);

K = Fields.Field(FT, space);
ϑ = Fields.Field(FT, space);
F = Fields.Field(FT, Spaces.face_space(space));
L = Fields.Field(FT, Spaces.face_space(space));

topBC_op = Operators.SetBoundaryOperator(
top = Operators.SetValue(F),
bottom = Operators.SetValue(
Geometry.Covariant3Vector(zero(FT)),
),
);
# works
@. (divf2c_matrix() * (
MatrixFields.DiagonalMatrixRow(
interpc2f_op(K),
) * gradc2f_matrix())) - (I,)

# breaks
@. (divf2c_matrix() ⋅ (
MatrixFields.DiagonalMatrixRow(
interpc2f_op(K),
) ⋅ gradc2f_matrix())) - (I,)
```

The error is `ERROR: Broacasted spaces are not the same.`. cc @dennisYatunin

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.