60 lines
1.8 KiB
Rust
60 lines
1.8 KiB
Rust
//! Neural Operator Demo for `RustyTorch`++
|
|
//!
|
|
//! This crate provides an interactive demo for neural operators (FNO) solving
|
|
//! partial differential equations. It showcases:
|
|
//!
|
|
//! - Fourier Neural Operators for PDE solving
|
|
//! - 1000x+ speedup over traditional FEM solvers
|
|
//! - Interactive boundary condition editing
|
|
//! - Real-time visualization of solutions
|
|
//!
|
|
//! # Supported PDE Types
|
|
//!
|
|
//! - **Darcy Flow**: Flow through porous media
|
|
//! - **Heat Equation**: Steady-state heat conduction
|
|
//! - **Poisson**: Electrostatics potential
|
|
//! - **Navier-Stokes**: Simplified fluid flow
|
|
//!
|
|
//! # Example
|
|
//!
|
|
//! ```rust,ignore
|
|
//! use rtx_neural_operator_demo::NeuralOperatorDemo;
|
|
//! use rtx_neural_operator_shared::config::PDEConfig;
|
|
//!
|
|
//! // Create demo instance
|
|
//! let mut demo = NeuralOperatorDemo::new();
|
|
//!
|
|
//! // Initialize with Darcy flow
|
|
//! let config = PDEConfig::darcy(64);
|
|
//! demo.initialize(config)?;
|
|
//!
|
|
//! // Solve with input field
|
|
//! let input = vec![1.0; 64 * 64];
|
|
//! let solution = demo.solve(&input)?;
|
|
//! ```
|
|
|
|
#![forbid(unsafe_code)]
|
|
#![warn(missing_docs)]
|
|
|
|
pub mod benchmark;
|
|
pub mod data;
|
|
mod inference;
|
|
pub mod training;
|
|
|
|
pub use benchmark::{
|
|
BenchmarkConfig, BenchmarkResult, BenchmarkRunner, BenchmarkSummary, FdmSolver, FemSolver,
|
|
PDEType as BenchmarkPDEType,
|
|
};
|
|
pub use data::{DarcyDataConfig, DarcyDataGenerator, DarcySample, TrainingBatch};
|
|
pub use inference::{NeuralOperatorDemo, SolveResult};
|
|
pub use training::{FnoTrainer, TrainingError, TrainingResult, TrainingSession};
|
|
|
|
// Re-export shared types for convenience
|
|
pub use rtx_neural_operator_shared::{
|
|
config::{PDEConfig, PDEType},
|
|
error::{NeuralOperatorError, Result},
|
|
ipc::{
|
|
ModelInfo, NeuralOperatorRequest, NeuralOperatorResponse, PerformanceMetrics, SolutionData,
|
|
},
|
|
};
|