Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • I INMOST
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Terekhov
  • INMOST
  • Wiki
  • 1490 Distributed Octree Mesh Example

1490 Distributed Octree Mesh Example · Changes

Page history
new example with distributed octree mesh authored Mar 15, 2017 by Igor Konshin's avatar Igor Konshin
Hide whitespace changes
Inline Side-by-side
1490-Distributed-Octree-Mesh-Example.md 0 → 100644
View page @ a297b536
# Dynamic Distributed Octree Mesh Example
The code for this example is located in `examples/Octree`
## Brief
This example creates distributed octree mesh with dynamical modification.
## Description
Example contains the grid, which can refine and coarse by some user defined rule.
This example may run in both serial and parallel modes with `NP` processes. For parallel run the dynamic load balancing is used.
The main feature of this example is user-defined function, which determines how grid should split and unite.
In this example, grid refines around mouse cursor.
User should define the function
```
int cell_should_split(struct grid * g, Cell cell, int level)
```
which returns 1 if this cell must split to 8 children cells.
In addition, user should define the function
```
int cell_should_unite(struct grid * g, Cell cell)
```
which returns 1 if cell must unite with 7 neighbors.
After that user must create "struct grid thegrid" object and makes next assignments
```
thegrid.cell_should_split = cell_should_split;
thegrid.cell_should_unite = cell_should_unite;
```
Main function of Octree is `gridAMR`.
This function makes all changes with the grid.
First it's check all cells to unite, next check to split.
Example contains the graphic representation of it's workflow.
User must install and configure the `OpenGL` library.
## Arguments
Run with no arguments produces a brief help of example arguments and hotkeys available:
```
$ ./Octree
Command arguments:
-n=10x10x1 - grid size
-r=0.01 - refine radius
-l=2 - refine level
Hotkeys:
Space - refine grid around mouse cursor
f - dump grid to file (see grids folder)
x - redistribute grid
```
as well as the run of the example with the specified default set of parameters.
## Running example
First go to the Octree folder
```
$ cd Examples/Octree
```
### Single process run:
Example runs with following command:
```
$ ./Octree
```
In this case example runs on single process and all cells will locate on one process.
User can use 'spacebar' key to calls `gridAMR` function, which changes the grid.
### Parallel processes run:
User can use mpi to run distribute version of example:
```
$ mpirun -np 3 ./Octree.
```
User must activate `USE_MPI` key in `cmake` configuration.
In this case grid splits to `NP` parts.
Each part located on separate process. Graphic representation draws each part with unique color.
Before redrawing, example transfers information about grid from all processes (slaves) to one process (master).
After that master can redraw the grid.
User still use 'spacebar' key to calls `gridAMR`.
But in this case user can use 'x' key to make redistribution of grid.
User can adjust redistribution settings.
Clone repository
  • 0100 Compilation
  • 0200 Compilation Windows
  • 0201 Obtain MSVC
  • 0202 Obtain MSMPI
  • 0203 Compilation INMOST Windows
  • 0204 Compilation ParMETIS Windows
  • 0205 Compilation Zoltan Windows
  • 0206 Compilation PETSc Windows
  • 0207 Compilation Trilinos Windows
  • 0400 Compilation Linux
  • 0401 Install MPI
  • 0402 Compilation INMOST Linux
  • 0403 Compilation PETSc Linux
  • 0404 Compilation Trilinos Linux
  • 0405 Compilation ParMETIS Linux
View All Pages