Skip to content
Permalink
Browse files

add Symmetry

Fixes #224.
  • Loading branch information...
nschloe committed Mar 27, 2019
1 parent 78a32cd commit 8900e69881cf2942845fa9bd5b779b2d36a289a3
Showing with 18 additions and 0 deletions.
  1. +1 −0 README.md
  2. +16 −0 pygmsh/built_in/geometry.py
  3. +1 −0 setup.py
@@ -7,6 +7,7 @@
[![PyPi Version](https://img.shields.io/pypi/v/pygmsh.svg)](https://pypi.org/project/pygmsh)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1173105.svg)](https://doi.org/10.5281/zenodo.1173105)
[![GitHub stars](https://img.shields.io/github/stars/nschloe/pygmsh.svg?logo=github&label=Stars&logoColor=white)](https://github.com/nschloe/pygmsh)
[![PyPi downloads](https://img.shields.io/pypi/dd/pygmsh.svg)](https://pypistats.org/packages/pygmsh)

<p align="center">
<img src="https://nschloe.github.io/pygmsh/logo.svg" width="20%">
@@ -974,3 +974,19 @@ def translate(self, input_entity, vector):
input_entity.id,
)
)

def symmetry(self, input_entity, coefficients, duplicate=True):
"""Transforms all elementary entities symmetrically to a plane. The vector
should contain four expressions giving the coefficients of the plane's equation.
"""
d = {1: "Line", 2: "Surface", 3: "Volume"}
entity = "{}{{{}}};".format(d[input_entity.dimension], input_entity.id)

if duplicate:
entity = "Duplicata{{{}}}".format(entity)

self._GMSH_CODE.append(
"Symmetry {{{}}} {{{}}}".format(
", ".join([str(co) for co in coefficients]), entity
)
)
@@ -34,6 +34,7 @@ def read(fname):
"all": ["pipdate >=0.3.0, <0.4.0"],
"update": ["pipdate >=0.3.0, <0.4.0"],
},
keywords=["mesh", "gmsh", "mesh generation", "mathematics"],
classifiers=[
about["__status__"],
about["__license__"],

0 comments on commit 8900e69

Please sign in to comment.
You can’t perform that action at this time.