DomainDecompositionPINN<T>

Models & Types · AiDotNet.PhysicsInformed.PINNs

Domain Decomposition Physics-Informed Neural Network for large-scale problems.

Inheritance: NeuralNetworkBase<T> → PhysicsInformedNeuralNetwork<T> → DomainDecompositionPINN<T>

How It Works

For Beginners: Domain decomposition is a strategy for solving large problems by breaking them into smaller, manageable pieces. Think of it like solving a jigsaw puzzle:

  • Each piece (subdomain) is solved separately
  • The pieces must fit together at the edges (interface conditions)

Why Use Domain Decomposition?

  1. Memory: Large domains require too much memory for one network
  2. Parallelism: Subdomains can be trained independently (partially)
  3. Accuracy: Local networks can specialize for local behavior
  4. Geometry: Complex domains can be split into simpler shapes

Types of Decomposition:

  1. Non-overlapping (used here):

|—––|—––| | D1 | D2 | Interface at boundary |—––|—––|

  1. Overlapping:

|–––––| | D1 |—| |–––––| | D2 | |––|——| Overlap region

Interface Conditions: At subdomain interfaces, we enforce:

  1. Continuity: u_1 = u_2 (solutions match)
  2. Flux continuity: du_1/dn = du_2/dn (derivatives match)

Training Strategy:

  1. Train each subdomain network on its local domain
  2. Enforce interface conditions at boundaries
  3. Iterate until global convergence

References:

  • Jagtap, A.D., and Karniadakis, G.E. “Extended Physics-Informed Neural Networks

(XPINNs): A Generalized Space-Time Domain Decomposition Based Deep Learning Framework” Communications in Computational Physics, 2020.

Example

var architecture = new NeuralNetworkArchitecture<float>(
    inputType: InputType.OneDimensional,
    taskType: NeuralNetworkTaskType.Regression,
    inputSize: 2, outputSize: 1);
var pde = new HeatEquation<float>();
// No IBoundaryCondition implementation ships with the library: write your own with
// IsOnBoundary, ComputeBoundaryResidual and Name, then put instances in this array.
var bc = Array.Empty<IBoundaryCondition<float>>();
var subdomains = new List<SubdomainDefinition<float>>
{
    new SubdomainDefinition<float>(new float[] { 0 }, new float[] { 1 }, "left"),
    new SubdomainDefinition<float>(new float[] { 1 }, new float[] { 2 }, "right")
};
var ddPinn = new DomainDecompositionPINN<float>(architecture, pde, bc, subdomains);

Constructors

Constructor Summary
DomainDecompositionPINN(NeuralNetworkArchitecture<T> architecture, IPDESpecification<T> pdeSpecification, IBoundaryCondition<T>[] boundaryConditions, List<SubdomainDefinition<T>> subdomains, List<PhysicsInformedNeuralNetwork<T>> subdomainNetworks, IInitialCondition<T> initialCondition, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, DomainDecompositionPINNOptions options) Initializes the model from an already-resolved options instance.

Properties

Property Summary
IReadOnlyList<InterfaceDefinition<T>> Interfaces { get; } Gets all interface definitions.
IReadOnlyList<SubdomainDefinition<T>> Subdomains { get; } Gets all subdomain definitions.
int SubdomainCount { get; } Gets the number of subdomains.

Methods

Method Summary
DomainDecompositionTrainingHistory<T> SolveWithDecomposition(int epochs, double learningRate, bool verbose, int batchSize) Solves the PDE using domain decomposition.
PhysicsInformedNeuralNetwork<T> GetSubdomainNetwork(int index) Gets a specific subdomain network.
Tensor<T> Forward(Tensor<T> input) Evaluates the decomposed solution: each row is answered by the network of the subdomain that contains it (the first match, bounds inclusive), exactly as GetGlobalSolution chooses.
Tensor<T> ForwardForTraining(Tensor<T> input)
Vector<T> GetGlobalSolution(Vector<T> point) Gets the solution at a point by finding the appropriate subdomain.
void SetTrainingData(Tensor<T> inputs, Tensor<T> outputs) Sets the training data for SolveWithDecomposition: boundary, initial and measured values.