Skip to content

Commit

Permalink
Some docs on geometry output
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Jan 18, 2024
1 parent 51ab747 commit 8dee837
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 163 deletions.
320 changes: 167 additions & 153 deletions docs/_site/assets/js/search-data.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion docs/_site/output/levelset.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion docs/_site/output/surface.html

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion docs/_site/output/volume.html

Large diffs are not rendered by default.

40 changes: 38 additions & 2 deletions docs/output/levelset.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,41 @@ nav_order: 1

---

Coming soon
{: .label .label-yellow}
## Saving the Domain

Documentation Coming soon
{: .label .label-yellow}

## Visualization

ViennaPS provides a feature enabling users to save the level set grid points explicitly for each material layer within the domain in the VTK file format. This export includes the level set value associated with each grid point. Users also have the option to specify a width parameter, determining the number of grid points around the zero level set. This functionality enhances the ability to analyze and visualize the level set information in a detailed and customizable manner.

__Example usage:__

<details markdown="1">
<summary markdown="1">
C++
{: .label .label-blue }
</summary>
```c++
auto domain = psSmartPointer<psDomain<NumericType, D>>::New();
...
// create geometry in domain
...
domain->saveLevelSetMesh("fileNamePrefix", 3 /* width */);
```
</details>
<details markdown="1">
<summary markdown="1">
Python:
{: .label .label-green }
</summary>
```python
domain = vps.Domain()
...
# create geometry in domain
...
domain.saveLevelSetMesh(fileName="fileNamePrefix", width=3)
```
</details>
34 changes: 32 additions & 2 deletions docs/output/surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,35 @@ nav_order: 2

---

Coming soon
{: .label .label-yellow}
Documentation Coming soon
{: .label .label-yellow}

__Example usage:__

<details markdown="1">
<summary markdown="1">
C++
{: .label .label-blue }
</summary>
```c++
auto domain = psSmartPointer<psDomain<NumericType, D>>::New();
...
// create geometry in domain
...
domain->saveSurfaceMesh("fileName", true);
```
</details>
<details markdown="1">
<summary markdown="1">
Python:
{: .label .label-green }
</summary>
```python
domain = vps.Domain()
...
# create geometry in domain
...
domain.saveSurfaceMesh(fileName="fileName", addMaterialIds=True)
```
</details>
34 changes: 32 additions & 2 deletions docs/output/volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,35 @@ nav_order: 3

---

Coming soon
{: .label .label-yellow}
Documentation Coming soon
{: .label .label-yellow}

__Example usage:__

<details markdown="1">
<summary markdown="1">
C++
{: .label .label-blue }
</summary>
```c++
auto domain = psSmartPointer<psDomain<NumericType, D>>::New();
...
// create geometry in domain
...
domain->saveVolumeMesh("fileName");
```
</details>
<details markdown="1">
<summary markdown="1">
Python:
{: .label .label-green }
</summary>
```python
domain = vps.Domain()
...
# create geometry in domain
...
domain.saveVolumeMesh(fileName="fileName")
```
</details>
3 changes: 2 additions & 1 deletion include/psDomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ template <class NumericType = float, int D = 3> class psDomain {
std::cout << "**************************" << std::endl;
}

// Save the level set as a VTK file.
// Save all level sets as a VTK files. The width parameter specifies the
// number of grid points around the zero level set to be saved.
void saveLevelSetMesh(std::string name, int width = 1) {
for (int i = 0; i < levelSets->size(); i++) {
auto mesh = psSmartPointer<lsMesh<NumericType>>::New();
Expand Down

0 comments on commit 8dee837

Please sign in to comment.