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.

Parameters
  • output (tuple) – output of the model.

  • kwargs (input) – input to the model.

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. The residual f will be returned. :param output: output of the model. :type output: tuple :param kwargs: input to the model. :type kwargs: input

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.

Parameters
  • output (tuple) – output of the model.

  • kwargs (input) – input to the model.

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.

Parameters
  • output (tuple) – output of the model.

  • kwargs (input) – input to the model.