Files
rustytorch/demos/rtx-hemodynamics/src/lib.rs
T
2026-03-04 00:08:42 +00:00

62 lines
1.8 KiB
Rust

//! GPU-accelerated Physics-Informed Neural Network for hemodynamics simulation
//!
//! This crate provides the core PINN implementation for solving 2D incompressible
//! Navier-Stokes equations in arterial hemodynamics simulation.
//!
//! # Overview
//!
//! The hemodynamics PINN solves the inverse problem of determining pressure fields
//! from velocity measurements (simulating data from 4D Flow MRI or ultrasound).
//!
//! # Modules
//!
//! - [`navier_stokes`]: Navier-Stokes residual computation
//! - [`network`]: LFFN-MLP network architecture
//! - [`vessel`]: Vessel geometry and SDF functions
//! - [`boundary`]: Boundary condition handling
//! - [`wss`]: Wall Shear Stress computation
//! - [`inference`]: Optimized inference mode
//!
//! # Example
//!
//! ```rust,ignore
//! use rtx_hemodynamics::{NavierStokesResidual, VesselPinn, VesselGeometry};
//! use rtx_hemodynamics_shared::geometry::VesselGeometry;
//! use rtx_hemodynamics_shared::physics::FluidProperties;
//!
//! // Create vessel geometry
//! let vessel = VesselGeometry::straight(0.1, 0.005).unwrap();
//!
//! // Create PINN model
//! let config = PinnConfig::default();
//! let model = VesselPinn::new(config, &vessel).unwrap();
//!
//! // Train on synthetic data
//! model.train(5000).await?;
//!
//! // Infer pressure field
//! let points = vessel.sample_interior(1000);
//! let fields = model.infer(&points)?;
//! ```
#![forbid(unsafe_code)]
#![warn(missing_docs)]
pub mod boundary;
pub mod config;
pub mod inference;
pub mod navier_stokes;
pub mod network;
pub mod training;
pub mod vessel;
pub mod wss;
pub use boundary::BoundaryEnforcer;
pub use config::PinnConfig;
pub use inference::InferenceEngine;
pub use navier_stokes::NavierStokesResidual;
pub use network::VesselPinn;
pub use training::Trainer;
pub use vessel::VesselSdf;
pub use wss::WssComputer;