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

[Docs] Add user level documentation for Expressions #11990

Merged
merged 104 commits into from
Feb 6, 2024
Merged
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
8ea46bc
add build script nav menu custom build
sunethwarna Jan 24, 2024
2408cad
add expression util method docs
sunethwarna Jan 24, 2024
fd1d09f
add io docs
sunethwarna Jan 24, 2024
47e4072
ad general docs
sunethwarna Jan 24, 2024
51d281a
add menu infos
sunethwarna Jan 24, 2024
5a520df
update docs
sunethwarna Jan 25, 2024
65f1ba4
update IOs
sunethwarna Jan 27, 2024
1150805
add domain size exp io
sunethwarna Jan 27, 2024
b3fd523
update domain size exp io docs
sunethwarna Jan 27, 2024
02ae667
add expression arithmetics docs
sunethwarna Jan 27, 2024
57e86d3
add exp notes docs
sunethwarna Jan 27, 2024
f736e5c
add exp interface docs
sunethwarna Jan 27, 2024
fabd2a3
add abs docs
sunethwarna Jan 27, 2024
4e651c3
add Pow docs
sunethwarna Jan 27, 2024
1405537
add scale docs
sunethwarna Jan 27, 2024
1dce9d5
minor
sunethwarna Jan 27, 2024
b770f85
minor
sunethwarna Jan 27, 2024
e6873e4
add entity max docs
sunethwarna Jan 27, 2024
41b4dc0
add entity min docs
sunethwarna Jan 27, 2024
55df3d3
minor
sunethwarna Jan 27, 2024
2017d1a
fix for sets
sunethwarna Jan 27, 2024
5fd5dfa
minor
sunethwarna Jan 27, 2024
23e65bc
add scalar norm docs
sunethwarna Jan 27, 2024
617aed2
add collapse docs
sunethwarna Jan 27, 2024
b77b6cf
add comb docs
sunethwarna Jan 27, 2024
f9cb77d
add reshape docs
sunethwarna Jan 27, 2024
fc24f09
add slice docs
sunethwarna Jan 27, 2024
6de5f1a
Merge remote-tracking branch 'origin/master' into docs/expression_doc…
sunethwarna Feb 2, 2024
e7bc7f0
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
bb19329
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
025a2ae
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
ca6c0a7
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
8becb4b
Merge branch 'docs/expression_documentation' of https://github.com/Kr…
sunethwarna Feb 2, 2024
945983c
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
e984de2
Update docs/pages/Kratos/Expressions/General/Overview.md
sunethwarna Feb 2, 2024
a1c4ff3
Update docs/pages/Kratos/Expressions/General/Notes.md
sunethwarna Feb 2, 2024
71fa5db
Update docs/pages/Kratos/Expressions/General/Notes.md
sunethwarna Feb 2, 2024
630cbe8
Update docs/pages/Kratos/Expressions/General/Notes.md
sunethwarna Feb 2, 2024
25a767d
Update docs/pages/Kratos/Expressions/General/Expression_Types.md
sunethwarna Feb 2, 2024
0ea045f
Update docs/pages/Kratos/Expressions/General/Expression_Types.md
sunethwarna Feb 2, 2024
a076293
Update docs/pages/Kratos/Expressions/General/Expression_Types.md
sunethwarna Feb 2, 2024
2e43ac9
Update docs/pages/Kratos/Expressions/General/Expression_Types.md
sunethwarna Feb 2, 2024
a8f1bde
Update docs/pages/Kratos/Expressions/General/Expression_Types.md
sunethwarna Feb 2, 2024
33327ff
Update docs/pages/Kratos/Expressions/General/Expression_Arithmetics.md
sunethwarna Feb 2, 2024
50f52cb
Update docs/pages/Kratos/Expressions/General/Expression_Arithmetics.md
sunethwarna Feb 2, 2024
9b7d0b1
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
2e92fd8
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
8ee5530
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
396c2ad
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
dd57579
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
2c00817
Update docs/pages/Kratos/Expressions/General/Working_with_Numpy.md
sunethwarna Feb 2, 2024
90f3a75
Merge branch 'docs/expression_documentation' of https://github.com/Kr…
sunethwarna Feb 2, 2024
49060a5
minor
sunethwarna Feb 2, 2024
33f921f
add expected output
sunethwarna Feb 2, 2024
af0ebd6
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
dcb3acb
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
ccab6cf
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
8e58f61
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
9c465b9
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
a6b1f87
Update docs/pages/Kratos/Expressions/IOs/C_Array_Expression_IO.md
sunethwarna Feb 2, 2024
16c6488
Update docs/pages/Kratos/Expressions/IOs/Domain_Size_Expression_IO.md
sunethwarna Feb 2, 2024
d3b92b5
Update docs/pages/Kratos/Expressions/IOs/Domain_Size_Expression_IO.md
sunethwarna Feb 2, 2024
d7bd0fd
Update docs/pages/Kratos/Expressions/IOs/Integration_Point_Expression…
sunethwarna Feb 2, 2024
5131b41
Update docs/pages/Kratos/Expressions/IOs/Integration_Point_Expression…
sunethwarna Feb 2, 2024
5dd974a
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
4e537cf
Update docs/pages/Kratos/Expressions/IOs/Integration_Point_Expression…
sunethwarna Feb 2, 2024
172b51d
Update docs/pages/Kratos/Expressions/IOs/Literal_Expression_Input.md
sunethwarna Feb 2, 2024
03ac264
Update docs/pages/Kratos/Expressions/IOs/Literal_Expression_Input.md
sunethwarna Feb 2, 2024
0736590
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
5475531
Update docs/pages/Kratos/Expressions/IOs/Literal_Expression_Input.md
sunethwarna Feb 2, 2024
78b8aba
Update docs/pages/Kratos/Expressions/IOs/Literal_Expression_Input.md
sunethwarna Feb 2, 2024
19f5579
Update docs/pages/Kratos/Expressions/IOs/Nodal_Position_Expression_IO.md
sunethwarna Feb 2, 2024
4e60c14
Update docs/pages/Kratos/Expressions/IOs/Nodal_Position_Expression_IO.md
sunethwarna Feb 2, 2024
787c79c
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
0c1c235
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
75ca8d2
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
d51e94b
Update docs/pages/Kratos/Expressions/IOs/Variable_Expression_IO.md
sunethwarna Feb 2, 2024
486655a
Merge branch 'docs/expression_documentation' of https://github.com/Kr…
sunethwarna Feb 2, 2024
edd63e3
revert changes
sunethwarna Feb 2, 2024
f4065d1
add exp arithmetics exp output
sunethwarna Feb 2, 2024
b7de9eb
minor
sunethwarna Feb 2, 2024
9a32385
add expected output
sunethwarna Feb 2, 2024
156476e
Merge remote-tracking branch 'origin/master' into docs/expression_doc…
sunethwarna Feb 5, 2024
c5599c9
fix cpp output order
sunethwarna Feb 5, 2024
8988ac2
replace mathbb with mathbf
sunethwarna Feb 5, 2024
a7d7da1
minor
sunethwarna Feb 6, 2024
2821a6c
update abs
sunethwarna Feb 6, 2024
39f1f16
fix collapse
sunethwarna Feb 6, 2024
4956e08
fix comb
sunethwarna Feb 6, 2024
f9f5f1a
fix entity max
sunethwarna Feb 6, 2024
4dca0e6
fix entity min
sunethwarna Feb 6, 2024
b026471
fix entity sum
sunethwarna Feb 6, 2024
1ee6f76
fix inner product
sunethwarna Feb 6, 2024
e7e61da
fix inner product
sunethwarna Feb 6, 2024
cfc8b27
fix norm inf
sunethwarna Feb 6, 2024
23fe1ca
norm l2 fixing
sunethwarna Feb 6, 2024
578198d
fix p norm
sunethwarna Feb 6, 2024
da51ebb
minor
sunethwarna Feb 6, 2024
e0f0ef2
fix pow
sunethwarna Feb 6, 2024
6a8728c
fix reshape
sunethwarna Feb 6, 2024
996c089
fix scale
sunethwarna Feb 6, 2024
2f7b511
minor
sunethwarna Feb 6, 2024
b7248a5
fix bash with console
sunethwarna Feb 6, 2024
2d43e74
fix slice
sunethwarna Feb 6, 2024
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
Prev Previous commit
Next Next commit
fix comb
  • Loading branch information
sunethwarna committed Feb 6, 2024
commit 4956e08f4069f694c9d3b879bb54d898c530bbb0
24 changes: 12 additions & 12 deletions docs/pages/Kratos/Expressions/Utilities/Comb.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ summary:
---

## Introduction
This allows combining multiple expressions in to one expression. **The number of entities on all the combining expressions should have the same.**
`Comb` merges multiple expressions in to one. **All input expressions must have the same number of entities.**

Example:
All provided expressions in the list_of_expression.
```
For example, let the list_of_expression contain the following expressions:
exp_list[0] = data{1, 2, 3} with 3 items, and item shape = []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, if shape [ ] takes 1 item, shape = [3] takes 3 items. What should I aspect with shape = [1] and shape = [2]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shape[1] is not allowed. it will throw an error in the Expression if it find shape[1]. shape[2] cannot be used within Kratos since we don't have 2D vectors. But shape[2] can be used with Expressions, but won't be able to convert to Kratos::Variable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shape[1] and shape[] both represent scalar quantities.

Expand All @@ -21,10 +20,9 @@ The resulting expression has item shape [3] with 4 items:
output_exp = [1, 4, 5, -1, 2, 6, 7, -1, 3, 8, 9, -1]
--------- -------- --------
```
This creates a lazy expression, hence it has a constant cost complexity irrespective of the data size (The expression won't be evaluated unless @ref Expression::Evaluate is called).
The expression won't be evaluated unless `Expression::Evaluate` is called.

## Use case
Following code snippet illustrates how the above example can be replicated.
```python
import KratosMultiphysics as Kratos
model = Kratos.Model()
Expand Down Expand Up @@ -55,18 +53,20 @@ combined_exp = Kratos.Expression.Utils.Comb([p_exp, u_exp])

print(combined_exp.Evaluate())
```

Expected output:
```bash
[[ 1. 4. 5. -1.]
[ 2. 6. 7. -1.]
[ 3. 8. 9. -1.]]
| / |
' / __| _` | __| _ \ __|
. \ | ( | | ( |\__ \
```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: 502917
[[ 1. 4. 5. -1.]
[ 2. 6. 7. -1.]
[ 3. 8. 9. -1.]]
```