api.fem_common#
Functions#
|
This function collect the arguments used in the assembly function |
|
|
|
The string representation (i.e. the names) of the free arguments in the given BilinearForm, LinearForm, or Functional. |
|
Compute all the imports to be added to the generated Python code. |
|
Compute the highest derivative order in the given kernel expression. |
|
|
|
|
|
|
|
|
|
|
|
Details#
- compute_max_nderiv(kernel_expr: KernelExpression) int[source]#
Compute the highest derivative order in the given kernel expression.
- Parameters:
- kernel_exprKernelExpression (from sympde.expr.evaluation)
- Returns:
- nderivint
The highest order of derivation in terminal_expr.
- compute_imports(expr: Expr, spaces: Iterable[FemSpace], *, openmp: bool) dict[str, list[str]][source]#
Compute all the imports to be added to the generated Python code.
- Parameters:
- exprsympy.Expr
The integrand expression of a BilinearForm, LinearForm, or Functional. This is a pure SymPy expression where SymPDE partial derivatives have been converted to SymPy symbols. See Notes.
- spacesiterable of psydac.fem.FemSpace
The discrete spaces which define the finite element representation of a BilinearForm, LinearForm, or Functional.
- openmpbool
Whether or not OpenMP pragmas and functions are used in the code.
- Returns:
- importsdict[str, list[str]]
A dictionary whose keys are the names of the Python modules to be imported, and whose values are the names of the corresponding objects (variables, functions, classes) to be imported from the modules.
Notes
Assume that we start from an object of type BilinearForm, LinearForm, or Functional. We take the integrand and expand its vector operations with TerminalExpr(), then pull back from physical to logical coordinates with LogicalExpr(), and finally convert the symbolic partial derivatives with SymbolicExpr(). Where: - TerminalExpr is defined in sympde.expr.evaluation - LogicalExpr is defined in sympde.topology.mapping - SymbolicExpr is defined in sympde.topology.mapping
The resulting expression expr can be passed to this function.
- compute_free_arguments(expr: BasicForm, kernel_expr: KernelExpression) tuple[str][source]#
The string representation (i.e. the names) of the free arguments in the given BilinearForm, LinearForm, or Functional.
- Parameters:
- exprBilinearForm | LinearForm | Functional
The expression of which we want to compute the free arguments.
- kernel_exprsympde.expr.evaluation.KernelExpression
The atomic representation of the form, which is obtained after using LogicalExpr (if there is a mapping) and TerminalExpr on expr.
- Returns:
- tuple[str]
The string representation (i.e. the names) of the free arguments in the given BilinearForm, LinearForm, or Functional.
- collect_spaces(space, *args)[source]#
This function collect the arguments used in the assembly function
- Parameters:
- space: <FunctionSpace>
the symbolic space
- args<list>
list of discrete space components like basis values, spans, …
- Returns:
- args<list>
list of discrete space components elements used in the asembly