bte.dvm.solver#
Module Contents#
Classes#
A grid class that stores the details and solution of the |
|
Base class for all neural network modules. |
Functions#
|
|
|
|
|
linear_reconstruction using VanLeer limiter |
|
linear_reconstruction using MinMod limiter |
|
|
|
[summary] |
Attributes#
- bte.dvm.solver.linear_reconstruction_VanLeer(fL, f, fR)[source]#
linear_reconstruction using VanLeer limiter
- Parameters:
fL (torch.Tensor) – left cell
f (torch.Tensor) – cell
fR (torch.Tensor) – right cell
- Returns:
leftRec, rightRec
- Return type:
torch.Tensor
- bte.dvm.solver.linear_reconstruction_MinMod(fL, f, fR)[source]#
linear_reconstruction using MinMod limiter
- Parameters:
fL (torch.Tensor) – left cell
f (torch.Tensor) – cell
fR (torch.Tensor) – right cell
- Returns:
leftRec, rightRec
- Return type:
torch.Tensor
- bte.dvm.solver.get_reflecting_bdv(dis, BV, xi, side, no_linear=False)[source]#
[summary]
- Parameters:
dis (DVDis) – [description]
BV ([type]) – [description]
xi ([type]) – [description]
side ([type]) – side=-1 for left BV, side=1 for right BV
no_linear (bool, optional) – [description]. Defaults to False.
- Raises:
ValueError – [description]
- Returns:
[description]
- Return type:
[type]
- class bte.dvm.solver.Grid_onDVDis_NU(xmin, xmax, nx, vmin, vmax, nv, v_discrete='uni', device='cpu')[source]#
Bases:
bte.dvm.distribution.DVDisA grid class that stores the details and solution of the computational grid.
- class bte.dvm.solver.BGKSolver(xmin, xmax, nx, vmin, vmax, nv, v_discrete='uni', BC_type='constant', bgk_simple_kn='simple', device='cpu')[source]#
Bases:
torch.nn.ModuleBase class for all neural network modules.
Your models should also subclass this class.
Modules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes:
import torch.nn as nn import torch.nn.functional as F class Model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(1, 20, 5) self.conv2 = nn.Conv2d(20, 20, 5) def forward(self, x): x = F.relu(self.conv1(x)) return F.relu(self.conv2(x))
Submodules assigned in this way will be registered, and will have their parameters converted too when you call
to(), etc.Note
As per the example above, an
__init__()call to the parent class must be made before assignment on the child.- Variables:
training (bool) – Boolean represents whether this module is in training or evaluation mode.
- set_time_stepper(method)[source]#
set time stepper
- Parameters:
method (str) – can be “bgk-RK1”,”bgk-RK2”,”bgk-RK3”,”bgk-RKs1”,”bgk-RKs2”
"Euler" –
"IMEX-1" –
"IMEX-2" –
"IMEX" –