class SolutionPreprocessing[source]

SolutionPreprocessing(name:str=None, normalize:bool=False) :: Preprocessing

A parent class for several solution preprocessing strategies. Solution preprocessing processes the data based on solution specific information like stresses, displacements and densities.

Type Default Details
name str None The name of the preprocessing.
normalize bool False Whether to normalize the output of the preprocessing.

SolutionPreprocessing.__call__[source]

SolutionPreprocessing.__call__(problem_or_solution:Union[ForwardRef('dl4to.problem.Problem'), ForwardRef('dl4to.solution.Solution')])

Applies the preprocessing to a problem or solution object. Returns a torch.Tensor object. If a problem object is passed, then it is automatically converted to its trivial solution via problem.trivial_solution.

Type Default Details
problem_or_solution typing.Union[ForwardRef('dl4to.problem.Problem'), ForwardRef('dl4to.solution.Solution')] A problem or solution object.

class PDEPreprocessing[source]

PDEPreprocessing(use_u:bool=False, use_σ_vm:bool=True, normalize:bool=False) :: SolutionPreprocessing

PDE preprocessing [1, 2] computes the von Mises stresses for the trivial solution. We normalize the resulting tensor with $20\%$ of the yield stress to obtain outputs that are likely close to the unit interval. These initial von Mises stresses are then used as a $1$-channel input to the neural network. It is also possible to use the displacements $u$ as input, or a concatenation of $u$ and $\sigma_{vM}$. We found that using the von Mises stresses $\sigma_{vM}$ is usually enough.

Type Default Details
use_u bool False Whether to use the displacements in the preprocessing.
use_σ_vm bool True Whether to use the von Mises stresses in the preprocessing.
normalize bool False Whether to normalize the forces in the output of the preprocessing. If True, then a dataset is required.

class DensityPreprocessing[source]

DensityPreprocessing(binary:bool=False, normalize:bool=False) :: SolutionPreprocessing

A preprocessing that simply returns the density distribution of the solution objects as outputs.

Type Default Details
binary bool False Whether the density should be binarized.
normalize bool False Whether to normalize the output of the preprocessing.

References

[1] Dittmer, Sören, et al. "SELTO: Sample-Efficient Learned Topology Optimization." arXiv preprint arXiv:2209.05098 (2022).

[2] Zhang, Yiquan, et al. "A deep convolutional neural network for topology optimization with strong generalization ability." arXiv preprint arXiv:1901.07761 (2019).