Geode-Background
raw JSON → 9.12.0 verified Fri May 01 auth: no python
Geode-Background is a module from Geode-solutions for building background meshes used in mesh generation and numerical simulation. It is part of the OpenGeode ecosystem, currently at version 9.12.0, with a stable release cadence aligned with the Geode platform.
pip install geode-background Common errors
error ModuleNotFoundError: No module named 'geode_background' ↓
cause Package not installed or installed under different name (e.g., 'geode-background' without underscore).
fix
Install via pip:
pip install geode-background and import as from geode_background import ... error ImportError: cannot import name 'BackgroundCreator' from 'geode_background' ↓
cause Using an older version (<9.0.0) where BackgroundCreator does not exist.
fix
Upgrade to geode-background>=9.0.0:
pip install --upgrade geode-background error RuntimeError: No compute module available for this platform ↓
cause C++ backend not found; often missing Geode-Core or platform-specific binaries.
fix
Install geode-core and ensure compatible architecture. Use conda installation:
conda install -c geode-solutions geode-background Warnings
breaking Version 9.x introduced a new API: BackgroundCreator replaces old factory functions. Old code using `create_background_mesh` will break. ↓
fix Use `from geode_background import BackgroundCreator` and instantiate with `BackgroundCreator().create_*()` methods.
deprecated Direct import of names like `BackgroundMesh` from top-level package is deprecated; use submodule `geode_background.background_mesh`. ↓
fix Use `from geode_background.background_mesh import BackgroundMesh` instead.
gotcha Geode-Background requires a C++ compiled backend; pip install may fail without proper build tools (e.g., Visual C++ on Windows, GCC on Linux). ↓
fix Install pre-built wheels via conda: `conda install -c geode-solutions geode-background`
Imports
- BackgroundCreator
from geode_background import BackgroundCreator - BackgroundMesh
from geode_background import BackgroundMesh
Quickstart
from geode_background import BackgroundCreator
# Create a simple background mesh (example)
creator = BackgroundCreator()
background_mesh = creator.create_from_bounding_box(origin=(0.0,0.0,0.0), length=(1.0,1.0,1.0))
print('Background mesh created:', background_mesh.nb_vertices())