mindelec.solver.Problem

class mindelec.solver.Problem[source]

Base class of user-defined problems. All user-defined problems to set constraint on each dataset should be and must be inherited from this class. It is utilized to establish the mapping between each sub-dataset and used-defined loss functions. The mapping will be constructed by the Constraint API, and the loss will be calculated automatically by the constraint type of each sub-dataset. Corresponding member functions must be overloaded by user based on the constraint type in order to obtain the target label output. For example, for dataset1 the constraint type is set to be “Equation”, so the member function “governing_equation” must be overloaded to tell that how to get the equation residual.

Supported Platforms:

Ascend

boundary_condition(*output, **kwargs)[source]

boundary condition, abstract method. this function must be overloaded, if the corresponding constraint type is “BC”. if boundary condition can be expressed as f(bc_points) = 0, the residual f will be returned, bc_points are data on the boundary.

Parameters
  • output (tuple) – output of surrogate model, such as electric field and magnetic field,etc.

  • kwargs (dict) – input of surrogate model, such as time and space coordinates,etc.

constraint_function(*output, **kwargs)[source]

general case of functional constraint, abstract method. this function must be overloaded, if the corresponding constraint type is “Label” or “Function”. It’s more general case of constraint types which can be expressed as f(inputs) = 0, inputs are data corresponding to general function. The residual f will be returned.

Parameters
  • output (tuple) – output of surrogate model, such as electric field and magnetic field,etc.

  • kwargs (dict) – input of surrogate model, such as time and space coordinates,etc.

governing_equation(*output, **kwargs)[source]

governing equation, abstract method. this function must be overloaded, if the corresponding constraint type is “Equation”. if equation is f(inputs) = 0, the residual f will be returned, inputs are data in governing domain.

Parameters
  • output (tuple) – output of surrogate model, such as electric field and magnetic field,etc.

  • kwargs (dict) – input of surrogate model, such as time and space coordinates,etc.

initial_condition(*output, **kwargs)[source]

initial condition, abstract method. this function must be overloaded, if the corresponding constraint type is “IC” if initial condition can be expressed f(ic_points) = 0, the residual f will be returned, ic_points are data at initial time.

Parameters
  • output (tuple) – output of surrogate model, such as electric field and magnetic field,etc.

  • kwargs (dict) – input of surrogate model, such as time and space coordinates,etc.