Skip to content

sub-cell smoothing 1st implementation WIP#86

Open
Clara2223 wants to merge 19 commits into
ImpedanCEI:mainfrom
Clara2223:feature/PBA-implementation
Open

sub-cell smoothing 1st implementation WIP#86
Clara2223 wants to merge 19 commits into
ImpedanCEI:mainfrom
Clara2223:feature/PBA-implementation

Conversation

@Clara2223

@Clara2223 Clara2223 commented May 28, 2026

Copy link
Copy Markdown
Contributor

📝 Pull Request Summary

SCS implementation

  • We voxelize in a grid that has $factor \times$ resolution, --> subdivides each cell in subcells
  • We compute the gradient to have an idea of boundaries and make the mask continuous (not sure if this step is needed)
  • We add an extra step of gaussian blurring to make the material/mask changes smooth without loosing accuracy

and then we generate an accumulated mask by combining the $factor$ masks (e.g.) if $factor=4$ we sum 4 sub masks.

Finally, we clip the values to the maximum of int8 = 255. Each value that has 255 is fully inside the solid. Every cell that has value<255 is a partially filled cell with a volume fraction value/255.

🔧 Changes Made

✅ Checklist

  • Code follows the project's style and guidelines
  • Added tests for new functionality
  • Updated documentation (mentioned in docs/ or included in examples/ and notebooks/)
  • Verified that changes do not break existing functionality (automatic tests passing)

📌 Related Issues / PRs

Closes #issue-number

@Clara2223 Clara2223 requested a review from elenafuengar May 29, 2026 10:09
@Clara2223 Clara2223 self-assigned this May 29, 2026
@Clara2223 Clara2223 added the enhancement New feature or request label May 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an initial (WIP) implementation of sub-cell/subpixel smoothing for STL voxel masks and refactors SIBC (surface impedance boundary condition) handling for conductive solids in the FIT3D solver.

Changes:

  • Added optional subpixel smoothing to STL voxelization in GridFIT3D and adjusted solver material-mask handling to accept non-binary (float) masks.
  • Refactored SIBC application into a dedicated _apply_SIBC() method and changed the default use_sibc behavior in SolverFIT3D.
  • Updated an MPI lossy cavity test fixture to include an explicit sigma=0.0 entry for vacuum materials.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
wakis/solverFIT3D.py Changes default SIBC behavior, updates STL material masking to float masks, and adds/refactors SIBC application logic.
wakis/gridFIT3D.py Adds subpixel smoothing options and implementation for voxelized STL masks; adjusts surface-mask handling for SIBC.
tests/test_007_mpi_lossy_cavity.py Updates STL material input format to include explicit conductivity for vacuum.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wakis/solverFIT3D.py Outdated
Comment thread wakis/gridFIT3D.py Outdated
Comment thread wakis/gridFIT3D.py Outdated
Comment thread wakis/gridFIT3D.py
Comment thread wakis/gridFIT3D.py Outdated

@Clara2223 Clara2223 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

Clara2223 and others added 6 commits June 1, 2026 10:35
make_bool=False now that the SolverFit3D tries to work with a float mask

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…count the factor**3 sub_cells and not only the diagonals
… properties, it should substract bool (i.e. set mat props to 0) and add float (add materials with fractions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants