Skip to content

Commit

Permalink
fix slice
Browse files Browse the repository at this point in the history
  • Loading branch information
sunethwarna committed Feb 6, 2024
1 parent b7248a5 commit 2d43e74
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Expression Arithmetics
keywords:
keywords:
tags: [expression, arithmetics]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Working with Numpy
keywords:
keywords:
tags: [numpy, scipy, expressions, variable expression io, carray expression io]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: C Array Expression IO
keywords:
keywords:
tags: [c array expression io, numpy, scipy, Vector]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Domain Size Expression IO
keywords:
keywords:
tags: [domain size, condition, element, expression io]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Kratos/Expressions/IOs/Literal_Expression_Input.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Literal Expression Input
keywords:
keywords:
tags: [literal values, expressions, scalars]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Nodal Position Expression IO
keywords:
keywords:
tags: [nodal position, initial, current, expressions]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Variable Expression IO
keywords:
keywords:
tags: [variable expression io, expressions, variable]
sidebar: kratos_expressions
summary:
summary:
---

## Introduction
Expand Down
14 changes: 7 additions & 7 deletions docs/pages/Kratos/Expressions/Utilities/Slice.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ summary:
---

## Introduction
This method slice existing expression to expressions having a new shape with some sub components from the original expression.
`Slice` method slices existing expression to expressions having a new shape with some sub components from the original expression.
```
Assume an @ref Expression of shape [3] and 3 entities with
the following data in the flattened representation:
Expand All @@ -24,7 +24,6 @@ output container shape = [2] = equal to Stride.
```

## Use case
Following code snippet replicates the above example.
```python
import KratosMultiphysics as Kratos
model = Kratos.Model()
Expand Down Expand Up @@ -52,17 +51,18 @@ print(sliced_exp.Evaluate())
```

Expected output:
```bash
[[2. 3.]
[5. 6.]
[8. 9.]]
```console
| / |
' / __| _` | __| _ \ __|
. \ | ( | | ( |\__ \
_|\_\_| \__,_|\__|\___/ ____/
Multi-Physics 9.4."3"-docs/expression_documentation-6de5f1a499-Release-x86_64
Multi-Physics 9.4."3"-docs/add_python_processing_locally-eb00abccc7-FullDebug-x86_64
Compiled for GNU/Linux and Python3.11 with GCC-13.2
Compiled with threading and MPI support.
Maximum number of threads: 30.
Running without MPI.
Process Id: 540110
[[2. 3.]
[5. 6.]
[8. 9.]]
```

0 comments on commit 2d43e74

Please sign in to comment.