Skip to content

Local volume constraints #326

Description

@mohdibntarek

TopOpt.jl provides only a global volume-fraction constraint via VolumeFun (src/Functions/volume.jl), bounding the total Σ x_e V_e / Σ V_e. There is no way to bound material volume locally — i.e. require the volume fraction inside a neighborhood of every element to stay below a threshold. This is listed as a beginner-friendly contribution in the README.

A local volume constraint prevents material from over-concentrating in any one region; it is the standard mechanism for infill/porous microstructure, discouraging member clustering, and controlling feature size.

Proposal: add a differentiable LocalVolumeFun following the Fun-suffix convention. It builds the same cell-neighborhood map as DensityFilterFun (FilterMetadata / get_neighbour_info in src/CheqFilters/) and returns either a per-cell vector (mirroring BlockComplianceFun) or an aggregate (max / p-norm / KS). It should extend AbstractFunction, remain Zygote-differentiable (rrule calling ChainRulesCore.unthunk), preserve PseudoDensities type parameters, and compose with the density filter.

Acceptance criteria: LocalVolumeFun in src/Functions/, finite-difference gradient tests, a feasibility test, and a docs entry.

Prepared with assistance from deepseek-v4-pro via opencode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions