Mapping finite element data between meshes
Project description
Mapping finite element data between meshes
This package is a handy Python (re-)wrapper of MEDCoupling. It can be used to transfer finite element data defined on nodes (P1 fields) or on cells (P0 fields) between two meshio-compatible meshes.
Some notebook examples can be found in examples
.
Documentation is available here.
Installing MEDCoupling
Before using this package, you need to install MEDCoupling. Currently the 9.3.0 version only supports Python 3.6 and not Python 3.7.
- Download and extract the source package from salome-platform.org
- You will obtain two folders:
CONFIGURATION_9.3.0
andMEDCOUPLING-9.3.0
, enterMEDCOUPLING-9.3.0
and usingcmake
to build/install
mkdir build
cd build
cmake -DCONFIGURATION_ROOT_DIR=../../CONFIGURATION_9.3.0 -DCMAKE_INSTALL_PREFIX=[TO BE SPECIFIED] -DPYTHON_ROOT_DIR=[TO BE SPECIFIED] -DMEDCOUPLING_MICROMED=ON -DMEDCOUPLING_BUILD_DOC=OFF -DMEDCOUPLING_ENABLE_PARTITIONER=OFF -DMEDCOUPLING_PARTITIONER_SCOTCH=OFF -DMEDCOUPLING_PARTITIONER_METIS=OFF -DMEDCOUPLING_BUILD_TESTS=OFF -DMEDCOUPLING_ENABLE_RENUMBER=OFF -DMEDCOUPLING_WITH_FILE_EXAMPLES=OFF ..
cmake --build . --config Release --target install
For Windows users, the building has been tested with the latest Visual Studio 2019, with -G "Visual Studio 16 2019" -A x64
. However you must modify MEDCOUPLING-9.3.0/src/MEDCoupling_Swig/CMakeLists.txt
and add the last missing line
IF(WIN32)
# Under Windows MEDCoupling conflicts wiht medcoupling from PyWrapping
SET(MEDCouling_target_name MEDCouplingCompat)
SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY SWIG_MODULE_NAME MEDCouplingCompat)
SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY COMPILE_DEFINITIONS WIN32)
SET(SWIG_MODULE_MEDCouplingCompat_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
ELSE()
If you are using conda
with py36
a Python 3.6 environment, you can
- Specify
DCMAKE_INSTALL_PREFIX=...\Miniconda3\envs\py36\Library
- Specify
DPYTHON_ROOT_DIR=...\Miniconda3\envs\py36
- After installation, move files in
py36\Library\lib\python3.6\site-packages
topy36\Lib\site-packages
, and move.dll
files inpy36\Library\lib
topy36\Library\bin
To assure that MEDCoupling is well installed, try importing it in your Python
import medcoupling # should not raise error
Testing
To run the pymapping
unit tests, check out this repository and type
pytest
License
pymapping
is published under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pymapping-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a1d988c18071c3ed3539c3b0528ffed1360489daa0ac1164c0b813aa6a7321a |
|
MD5 | ba727dd38c9884cc30d69bdc2afe5e7c |
|
BLAKE2b-256 | f7e434a1368c279e0522507fe67f40cea51940a94d264af227832a11f8a9abab |