Skip to content

Commit

Permalink
Updated for new RLST
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Dec 16, 2024
1 parent 0aba1da commit ebfd460
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bempp-quadrature = { version = "0.1.0" }
itertools = "0.13.*"
mpi = { version = "0.8.*", optional = true }
num = "0.4"
rlst = { version = "0.2.0", default-features = false }
rlst = { git = "https://github.com/linalg-rs/rlst.git", default-features = false }
serde = { version = "1", features = ["derive"], optional = true }
strum = "0.26"
strum_macros = "0.26"
Expand Down
22 changes: 11 additions & 11 deletions src/ciarlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ impl<T: RlstScalar + MatrixInverse> CiarletElement<T> {
for pts in pts_i {
let ncols = pts.shape()[1];
all_pts
.view_mut()
.r_mut()
.into_subview([0, col], [tdim, ncols])
.fill_from(pts.view());
.fill_from(pts.r());
col += ncols;
}
}
Expand All @@ -141,9 +141,9 @@ impl<T: RlstScalar + MatrixInverse> CiarletElement<T> {
let dim0 = mat.shape()[0];
let dim2 = mat.shape()[2];
all_mat
.view_mut()
.r_mut()
.into_subview([dn, 0, pn], [dim0, value_size, dim2])
.fill_from(mat.view());
.fill_from(mat.r());
dn += dim0;
pn += dim2;
}
Expand Down Expand Up @@ -176,10 +176,10 @@ impl<T: RlstScalar + MatrixInverse> CiarletElement<T> {
for j in 0..value_size {
// d_matrix[j, l, dof + i] = inner(mat[i, j, :], table[0, l, :])
*d_matrix.get_mut([j, l, dof + i]).unwrap() = mat
.view()
.r()
.slice(0, i)
.slice(0, j)
.inner(table.view().slice(0, 0).slice(0, l));
.inner(table.r().slice(0, 0).slice(0, l));
}
}
}
Expand All @@ -203,17 +203,17 @@ impl<T: RlstScalar + MatrixInverse> CiarletElement<T> {
}
}

inverse.view_mut().into_inverse_alloc().unwrap();
inverse.r_mut().into_inverse_alloc().unwrap();

let mut coefficients = rlst_dynamic_array3!(T, [dim, value_size, pdim]);
for i in 0..dim {
for j in 0..value_size {
for k in 0..pdim {
// coefficients[i, j, k] = inner(inverse[i, :], polynomial_coeffs[:, j, k])
*coefficients.get_mut([i, j, k]).unwrap() = inverse
.view()
.r()
.slice(0, i)
.inner(polynomial_coeffs.view().slice(1, j).slice(1, k));
.inner(polynomial_coeffs.r().slice(1, j).slice(1, k));
}
}
}
Expand Down Expand Up @@ -329,10 +329,10 @@ impl<T: RlstScalar + MatrixInverse> FiniteElement for CiarletElement<T> {
// data[d, p, b, j] = inner(self.coefficients[b, j, :], table[d, :, p])
*data.get_mut([d, p, b, j]).unwrap() = self
.coefficients
.view()
.r()
.slice(0, b)
.slice(0, j)
.inner(table.view().slice(0, d).slice(1, p));
.inner(table.r().slice(0, d).slice(1, p));
}
}
}
Expand Down

0 comments on commit ebfd460

Please sign in to comment.