Own and reuse canonical whole-mesh function spaces within a process. More...
Collaboration diagram for Feel::FunctionSpaceManager:Classes | |
| struct | Impl |
| Private synchronized storage and policy implementation. More... | |
Public Types | |
| using | erased_factory_type = std::function< erased_space_ptrtype()> |
| Callable that constructs a type-erased function space on a miss. | |
| using | erased_space_ptrtype = std::shared_ptr< FunctionSpaceBase > |
| Type-erased function-space pointer retained by the manager. | |
| using | mesh_change_slot_type = std::function< void(MESH_CHANGES)> |
| Slot invoked when the associated mesh reports a change. | |
| using | mesh_connector_type = std::function< boost::signals2::connection(mesh_change_slot_type)> |
| Callable that connects a mesh-change slot and returns its connection. | |
Public Member Functions | |
| void | clear () |
| Release all entries retained by the manager. More... | |
| template<typename MeshType > | |
| void | clear (std::shared_ptr< MeshType > const &mesh) |
| Release entries retained for one mesh. More... | |
| FunctionSpaceManagerConfig | config () const |
| Return the effective manager configuration. More... | |
| void | configure (FunctionSpaceManagerConfig config) |
| Replace the manager configuration and enforce its capacity limits. More... | |
| erased_space_ptrtype | getOrCreate (std::weak_ptr< void > const &meshOwner, uint64_type structuralRevision, std::type_index spaceType, FunctionSpaceManagerOptions const &options, FunctionSpaceReusePolicy policy, WorldComm const &worldComm, erased_factory_type factory, mesh_connector_type connector) |
| Return a compatible retained space or construct one according to a policy. More... | |
| FunctionSpaceManagerStats | stats () const |
| Return aggregate statistics for all managed meshes. More... | |
| template<typename MeshType > | |
| FunctionSpaceManagerStats | stats (std::shared_ptr< MeshType > const &mesh) const |
| Return counters and retained-state measurements for one mesh. More... | |
Static Public Member Functions | |
| static FunctionSpaceManager & | instance () |
| Access the process-wide function-space manager. More... | |
Own and reuse canonical whole-mesh function spaces within a process.
Entries are keyed by mesh ownership identity, structural mesh revision, concrete function-space type, and normalized construction options. The manager holds strong references in bounded global and per-mesh LRU caches. Coordinate-only mesh changes refresh live function spaces without replacing their DOF topology.
Calls for a distributed mesh are collective on its communicator: all ranks must issue compatible requests in the same order. A cache hit is returned only when every rank reports a local hit.
| void Feel::FunctionSpaceManager::clear | ( | ) |
Release all entries retained by the manager.
Spaces that are still owned by callers remain valid.
| void Feel::FunctionSpaceManager::clear | ( | std::shared_ptr< MeshType > const & | mesh | ) |
Release entries retained for one mesh.
Spaces that are still owned by callers remain valid.
| MeshType | concrete mesh type |
| mesh | mesh whose retained entries are released |
| FunctionSpaceManagerConfig Feel::FunctionSpaceManager::config | ( | ) | const |
Return the effective manager configuration.
| void Feel::FunctionSpaceManager::configure | ( | FunctionSpaceManagerConfig | config | ) |
Replace the manager configuration and enforce its capacity limits.
| config | new process-local configuration |
| FunctionSpaceManager::erased_space_ptrtype Feel::FunctionSpaceManager::getOrCreate | ( | std::weak_ptr< void > const & | meshOwner, |
| uint64_type | structuralRevision, | ||
| std::type_index | spaceType, | ||
| FunctionSpaceManagerOptions const & | options, | ||
| FunctionSpaceReusePolicy | policy, | ||
| WorldComm const & | worldComm, | ||
| erased_factory_type | factory, | ||
| mesh_connector_type | connector | ||
| ) |
Return a compatible retained space or construct one according to a policy.
This type-erased entry point is intended for function-space factory helpers. Prefer getOrCreateFunctionSpace from typed code.
| meshOwner | weak ownership identity of the mesh |
| structuralRevision | current function-space structural mesh revision |
| spaceType | concrete requested function-space type |
| options | normalized construction options included in the key |
| policy | requested reuse policy |
| worldComm | communicator on which request consistency is checked |
| factory | construction callable used when a new space is required |
| connector | optional mesh-change signal connector |
| std::runtime_error | if request signatures differ across MPI ranks |
|
static |
Access the process-wide function-space manager.
| FunctionSpaceManagerStats Feel::FunctionSpaceManager::stats | ( | ) | const |
Return aggregate statistics for all managed meshes.
| FunctionSpaceManagerStats Feel::FunctionSpaceManager::stats | ( | std::shared_ptr< MeshType > const & | mesh | ) | const |
Return counters and retained-state measurements for one mesh.
| MeshType | concrete mesh type |
| mesh | mesh for which statistics are requested |
mesh