ParGeo
Overview | Installation | Basic Usage | Getting Started | Documentation | Cite
Generate complex two-dimensional geometries for simulations based on mesh discretizations.
Overview
With ParGeo you can create complex domains, where a domain is a two-dimensional geometry which is described by a collection of shapely Polygons and MultiPolygons called subdomains.
This domain could then be used for mesh generation, to further perform 2D mesh based simulations, like the Finite Element Methods (FEM). We provide mesh generating functionalities based on Gmsh.
To generate the desired domain you will use the pargeo.domain.Domain class and sequentially add subdomains. Each subdomain is associated with a visibility level. The visibility level is an integer, and subdomains with a higher visibility level will cover those with a lower one and be merged with those having the same one.
Following features support you with the domain-generating process:
-
Create Geometries (
pargeo.geometry):Create common geometries that can easly be transformed into shapely Polygons.
Following geometries are provided:
- Box
- Circle & Ellipse
- Stellar
- NStar
- Raindrop
-
Transform Geometries (
pargeo.transform)Pass transforms to your domain while adding new sub-domains. The sub-domain will then be first accordingly transformed before being added to the domain.
Following transforms are provided:
- Repeat
- Periodic
- Diffeomorphism
-
Impose Constraints (
pargeo.constraint)Pass constraints to the domain while adding new sub-domains. The new sub-domain is only added, if the constraints are met.
Following constraints are provided:
- DistanceConstraint
Check out the documentation for more information.
Installation
Install the latest version of ParGeo from PyPI using pip:
pip install pargeo
Basic Usage
Here's a simple example of how to use ParGeo.
from pargeo import write_mesh
from pargeo.domain import Domain
from pargeo.geometry import Box, Circle, Stellar
# Create a domain
background = Box((0, 0), (1, 1)).to_polygon()
domain = Domain(background)
# Add some subdomains
subdomain = Circle((0.3, 0.5), 0.3).to_polygon(refs=50)
domain.add_subdomain(subdomain=subdomain, level=1)
subdomain = Circle((0.7, 0.5), 0.3).to_polygon(refs=50)
domain.add_subdomain(subdomain=subdomain, level=1)
subdomain = Stellar((0.5, 0.3), 0.2).to_polygon(refs=50)
domain.add_subdomain(subdomain=subdomain, level=2)
# Plot the domain
domain.plot()
# Mesh the domain using Gmsh and write the .MSH file
write_mesh(domain, "basic_usage")
Cite
If you use ParGeo in your research, please cite it. You can use the following BibTeX entry:
@software{Schafer_ParGeo_2024,
author = {Gruhlke, Robert and Schäfer, Till},
month = feb,
title = {{ParGeo}},
url = {https://github.com/Priusds/ParGeo},
version = {0.3.4},
year = {2024}
}
Metadata
Release files for pargeo 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pargeo-0.3.4.tar.gz | 21.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pargeo-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.5 kB
Release files / pargeo-0.3.4.tar.gz
| Download URL | pargeo-0.3.4.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff52bec9ae1f9c53895e5befd9b9fd77297e7439f5f35c07b350455b7ac3192a
|
|
BLAKE2b-256 checksum How to use checksums |
e0fa486af50f9be5592e4aaf96b203d16727ed6ad9737222b8444e24b35ebe61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / pargeo-0.3.4-py3-none-any.whl
| Download URL | pargeo-0.3.4-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
673a27feeec09375718698cd67da018218fa416e57a25828e3ca854094735d92
|
|
BLAKE2b-256 checksum How to use checksums |
48e1db1a846ede002c585d7299cef923829859c7df0cb7ac7bd71fd156258613
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|