This module contains SWIG-generated wrappers of C++ classes from BEM++.
Many of the classes occur in several variants corresponding to particular instantiations of C++ class templates depending on parameters such as BasisFunctionType and ResultType (see the documentation of the C++ interface for more information on the meaning of these types). These variants are distinguished by their names. For example, the group of classes denoted symbolically as BoundaryOperator_BasisFunctionType_ResultType has six concrete representatives:
Here, float32 and float64 stand for single- and double-precision floating-point numbers, whereas complex64 and complex128 denote single- and double-precision complex numbers.
It would be tedious and error-prone to have to specify these numeric types explicitly whenever a new object is constructed. For this reason, the bempp.lib module provides create... helper functions that construct new instances of classes from bempp.core with automatically determined values of BasisFunctionType and ResultType. These “non-member constructors” should be used in preference to the usual constructors.
The documentation of this module is in preliminary stage. The Grid-related classes have been almost fully documented; for the remaining classes only member signatures are provided. Please refer to the documentation of the C++ interface for more complete information.
Bases: object
Proxy of C++ AbstractBoundaryOperator<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Bempp::AcaOptions class
eps -> float
eta -> float
firstClusterIndex -> int
globalAssemblyBeforeCompression (deprecated) -> bool
maximumBlockSize -> int
maximumRank -> int
minimumBlockSize -> int
mode -> “global_assembly”, “local_assembly” or “hybrid_assembly”
outputFname -> string
outputPostscript -> bool
reactionToUnsupportedMode -> “ignore”, “warning” or “error”
recompress -> bool
scaling -> float
The membership flag
AcaOptions_useAhmedAca_get(self) -> bool
Bases: object
Proxy of C++ Fiber::AccuracyOptions class
doubleRegular -> QuadratureOptions
doubleSingular -> QuadratureOptions
singleRegular -> QuadratureOptions
The membership flag
Bases: object
Proxy of C++ Fiber::AccuracyOptionsEx class
setDoubleRegular(self, maxNormalizedDistance1, accuracyOrder1, accuracyOrder2, relativeToDefault=True)
setDoubleRegular(self, maxNormalizedDistances, accuracyOrders, relativeToDefault=True)
setSingleRegular(self, maxNormalizedDistance1, accuracyOrder1, accuracyOrder2, relativeToDefault=True)
setSingleRegular(self, maxNormalizedDistances, accuracyOrders, relativeToDefault=True)
singleRegular(self, normalizedDistance) -> QuadratureOptions
The membership flag
Bases: object
Proxy of C++ AssembledPotentialOperator<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Bempp::AssemblyOptions class
enableSparseStorageOfLocalOperators(self)
makeQuadratureOrderUniformInEachCluster(self)
The membership flag
Bases: object
Proxy of C++ BlockedBoundaryOperator<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ BlockedOperatorStructure<BasisFunctionType,ResultType> class
The membership flag
Bases: bempp.core.SolutionBase_BasisFunctionType_ResultType
Proxy of C++ BlockedSolution<BasisFunctionType,ResultType> class
gridFunction(self, i) -> GridFunction_BasisFunctionType_ResultType
The membership flag
Bases: object
Proxy of C++ BoundaryOperator<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Context<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Bempp::ConvergenceTestMode class
The membership flag
Bases: bempp.core.Solver_BasisFunctionType_ResultType
Proxy of C++ DefaultDirectSolver<BasisFunctionType,ResultType> class
The membership flag
Bases: bempp.core.Solver_BasisFunctionType_ResultType
Proxy of C++ DefaultIterativeSolver<BasisFunctionType,ResultType> class
initializeSolver(self, paramList, preconditioner)
The membership flag
Bases: object
Proxy of C++ DiscreteBoundaryOperator<ValueType> class
apply(self, trans, x_in, y_inout, alpha, beta)
Return a representation as Trilinos Epetra Inverse Operator.
The operator’s label.
Id of the process in which the operator lives (not yet supported).
Return a representation as Trilinos Epetra Operator.
The operator’s label.
Id of the process in which the operator lives (not yet supported).
Multiply this operator with the matrix ‘other’ and return the result.
Matrix that should be multiplied with this operator.
Multiply this operator with ‘other’ and return the result.
Vector or matrix that should be multiplied with this operator.
Multiply the conjugate transpose of this operator with ‘other’ and return the result.
Vector or matrix that should be multiplied with the conjugate transpose of this operator.
The membership flag
Bases: object
Entity of codimension 0.
Inter-level access to father entity on the next-coarser grid.
The given entity resulted directly from a subdivision of its father entity. For macro (level-0) elements father() returns None.
Geometry of this entity.
This object gives, among other things, the map from a reference element to world coordinates.
True if entity has a father entity which can be accessed using the father() method.
True if the entity is contained in the leaf grid.
True if the entity has been created during the last call to adapt().
True if the element is of regular type in red/green type refinement.
In bisection or hanging node refinement this is always true.
Entity level.
True if the entity might disappear during the next call to adapt().
If the method returns False, the entity is guaranteed to still be present after adaptation.
Parent grid
Iterator over elements that resulted from (recursive) subdivision of this element.
Iterator does not stop at elements with level greater than maxLevel.
Iterator over subentities of codimension codimSub.
Note: codimSub must be greater than 0 and less than the dimension of the grid.
Number of subentities of codimension codimSub.
The membership flag
Type of the reference element.
Bases: object
Entity of codimension 1.
Geometry of this entity.
This object gives, among other things, the map from a reference element to world coordinates.
Entity level.
Parent grid
The membership flag
Type of the reference element.
Bases: object
Entity of codimension 2.
Geometry of this entity.
This object gives, among other things, the map from a reference element to world coordinates.
Entity level.
Parent grid
The membership flag
Type of the reference element.
Bases: object
Entity of codimension 3.
Geometry of this entity.
This object gives, among other things, the map from a reference element to world coordinates.
Entity level.
Parent grid
The membership flag
Type of the reference element.
Bases: object
Iterator over entities of codimension 0.
Return the current entity and increment the iterator.
Parent grid
The membership flag
Bases: object
Iterator over entities of codimension 1.
Return the current entity and increment the iterator.
Parent grid
The membership flag
Bases: object
Iterator over entities of codimension 2.
Return the current entity and increment the iterator.
Parent grid
The membership flag
Bases: object
Iterator over entities of codimension 3.
Return the current entity and increment the iterator.
Parent grid
The membership flag
Bases: object
Proxy of C++ Bempp::EvaluationOptions class
The membership flag
Bases: object
Geometry of an entity.
True if the geometry mapping is affine and false otherwise.
Center of geometry.
Note that this method is still subject to a change of name and semantics. At the moment, the center is not required to be the centroid of the geometry, or even the centroid of its corners. This makes acceptable the current default implementation, which maps the centroid of the reference element to the geometry.
We may change the name (and semantics) of the method to centroid() if Dune’s developers find reasonably efficient ways to implement it properly.
Returns a vector containing the coordinates of the center of geometry.
Number of corners of the reference element.
Positions of the geometry corners.
Returns a 2D array whose ith column contains the coordinates of the ith corner. The numbering of corners follows the conventions of the generic reference element.
Convert global (physical) to local (logical) coordinates.
2D array whose ith column contains the global coordinates of a point x_i.
Returns a 2D whose ith column contains the local coordinates of x_i.
integrationElement(self, local) -> ndarray
The factor mu appearing in the integral transformation formula.
See the documentation of the C++ interface for the definition of mu.
2D array whose ith column contains the local coordinates of a point x_i.
Returns a vector whose ith entry contains the integration element mu(x_i).
Inverses of the transposed Jacobian matrices.
See the documentation of the C++ interface for the definition of the Jacobian matrix.
2D array whose ith column contains the local coordinates of a point x_i.
Returns a 3D array whose ith slice (i.e. ...[:,:,i]) contains the inverse of the transposed Jacobian matrix at x_i.
Note: In the non-symmetric case dimGrid != dimWorld the pseudoinverse of the transposed Jacobian matrix is returned. This means that it is an inverse for all vectors tangential to the grid while mapping all normal vectors to zero.
Transposed Jacobian matrices.
See the documentation of the C++ interface for the definition of the Jacobian matrix.
2D array whose ith column contains the local coordinates of a point x_i.
Returns a 3D array whose ith slice (i.e. ...[:,:,i]) contains the transposed Jacobian matrix at x_i.
Convert local (logical) to global (physical) coordinates.
2D array whose ith column contains the local coordinates of a point x_i
Returns a 2D array whose ith column contains the global coordinates of x_i.
Parent entity
The membership flag
Type of the reference element.
Volume of geometry.
Bases: object
Unique label for each type of entities that can occur in grids.
Return dimension of the type.
Return true if entity is a cube of any dimension
Return true if entity is a hexahedron.
Return true if entity is a line segment
Return true if entity is a singular of any dimension
Return true if entity is a prism.
Return true if entity is a pyramid.
Return true if entity is a quadrilateral.
Return true if entity is a simplex of any dimension.
Return true if entity is a tetrahedron.
Return true if entity is a triangle
Return true if entity is a vertex
Make a hypercube of dimension dim.
Make a hexahedron
Make a line segment
Make a singular of dimension dim.
Make a prism
Make a pyramid
Make a quadrilateral
Make a simplex of dimension dim.
Make a tetrahedron
Make a triangle
Make a vertex
The membership flag
Bases: object
Grid.
Dimension of the grid.
Dimension of the space containing the grid.
Grid’s global id set.
View of the leaf entities.
View of the entities on grid level ‘level’.
Maximum level defined in this grid.
Levels are numbered 0 ... maxLevel() with 0 the coarsest level.
Visualize the Grid.
The membership flag
Bases: object
Grid factory.
This class provides static member functions to construct grids on the fly and to import grids from existing files.
Create a grid from connectivity arrays.
Topology of the grid to be constructed (one of ‘linear’, ‘triangular’, ‘quadrilateral’, ‘hybrid’).
2D array whose (i, j)th element contains the ith component of the jth vertex.
2D array whose (i, j)th element contains the index of the ith vertex of the jth element.
Note: Currently only grids with triangular topology are supported.
Construct a regular structured grid.
Topology of the grid to be constructed (one of ‘linear’, ‘triangular’, ‘quadrilateral’, ‘hybrid’).
Coordinates of the lower left corner of the grid.
Coordinates of the upper right corner of the grid.
Number of grid subdivisions in each direction.
This function constructs a regular structured grid. Its dimension, dimGrid, and the dimension of the surrounding space, dimWorld, are determined from the parameter ‘topology’. The constructed grid covers the dimGrid-dimensional cube
- [lowerLeft(0) upperRight(0)] x [lowerLeft(1) upperRight(1)]
- x ... x [lowerLeft(dimGrid-1), upperRight(dimGrid-1)].
The last (dimWorld - dimGrid) dimensions of all grid points are set to zero.
Each side of the cube parallel to the nth coordinate axis is subdivided into nElements(n) segments.
Note: Currently only grids with triangular topology are supported.
Import grid from a file in Gmsh format.
Topology of the grid to be constructed (one of ‘linear’, ‘triangular’, ‘quadrilateral’, ‘hybrid’).
Name of the Gmsh file.
Output diagnostic information.
Insert boundary segments.
See http://geuz.org/gmsh for information about the Gmsh file format. See Dune::GmshReader documentation for information about the supported Gmsh features.
The membership flag
Bases: object
Proxy of C++ GridFunction<BasisFunctionType,ResultType> class
Visualize the GridFunction.
projections(self, dualSpace)
The membership flag
Bases: object
Proxy of C++ Bempp::GridParameters class
The membership flag
topology -> string
Bases: object
Proxy of C++ Bempp::GridSegment class
closedDomain(grid, domain) -> GridSegment
markExcludedEntities(self, codim, marks)
openDomain(grid, domain) -> GridSegment
The membership flag
wholeGrid(grid) -> GridSegment
closedDomain(grid, domain, level=0) -> GridSegment GridSegment_closedDomain(grid, domain) -> GridSegment
openDomain(grid, domain, level=0) -> GridSegment GridSegment_openDomain(grid, domain) -> GridSegment
wholeGrid(grid, level=0) -> GridSegment GridSegment_wholeGrid(grid) -> GridSegment
Bases: object
Grid view.
This class provides a means to access a specific subset of entities, for example the leaf entities or the entities on a certain refinement level.
containsEntity(self, e) -> bool containsEntity(self, e) -> bool containsEntity(self, e) -> bool
True if the entity e belongs to this grid view.
If e is not an element of the grid, then the result of containsEntity() is undefined.
Iterator over entities of codimension codim contained in this view.
entityCount(self, type) -> int
Number of entities with certain characteristics.
codimension
geometry type
The index set.
Parent grid
The membership flag
VtkWriter for this grid view.
data mode, ‘conforming’ (default) or ‘nonconforming’
See the documentation of Dune::VTK::DataMode for more information about the implications of the choice of data mode.
Bases: object
Id set.
entityId(self, e) -> int entityId(self, e) -> int entityId(self, e) -> int
Id of the entity e.
Parent grid
Id of i’th subentity of codimension codimSub of entity e of codimension 0.
The membership flag
Bases: object
Index set.
entityIndex(self, e) -> int entityIndex(self, e) -> int entityIndex(self, e) -> int
Index of the entity e.
The result of calling this method with an entity that is not in the index set is undefined.
Returns an integer in the range 0 ... (max number of entities in set - 1).
Parent grid view
Index of i’th subentity of codimension codimSub of entity e of codimension 0.
The membership flag
Bases: object
Proxy of C++ Fiber::OpenClOptions class
The membership flag
OpenClOptions_useOpenCl_get(self) -> bool
Bases: object
Proxy of C++ Fiber::ParallelizationOptions class
The membership flag
Bases: object
Proxy of C++ PotentialOperator<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Preconditioner<ValueType> class
The membership flag
Bases: object
Proxy of C++ Fiber::QuadratureOptions class
The membership flag
Bases: object
Proxy of C++ Fiber::QuadratureStrategyBase<BasisFunctionType,ResultType,Bempp::GeometryFactory)> class
The membership flag
Bases: bempp.core.QuadratureStrategyBase_BasisFunctionType_ResultType
Proxy of C++ Fiber::QuadratureStrategy<BasisFunctionType,ResultType,Bempp::GeometryFactory)> class
The membership flag
Bases: object
Proxy of C++ SolutionBase<BasisFunctionType,ResultType> class
The membership flag
Bases: object
Proxy of C++ Bempp::SolutionStatus class
The membership flag
Bases: bempp.core.SolutionBase_BasisFunctionType_ResultType
Proxy of C++ Solution<BasisFunctionType,ResultType> class
gridFunction(self) -> GridFunction_BasisFunctionType_ResultType
The membership flag
Bases: object
Proxy of C++ Solver<BasisFunctionType,ResultType> class
solve(self, rhs) -> BlockedSolution_BasisFunctionType_ResultType
The membership flag
Bases: object
Proxy of C++ Space<BasisFunctionType> class
The membership flag
Bases: object
Proxy of C++ Fiber::VerbosityLevel class
The membership flag
Bases: object
Exporter of data in the vtk format.
Exports data (living on cells or vertices of a grid) to a file suitable for easy visualization with the Visualization Toolkit (VTK; see http://public.kitware.com/VTK)
addCellData(self, data, name)
Add to the visualization output a grid function representing data associated with the cells of the grid.
2D array whose (m, n)th entry contains the value of the mth component of the grid function in the nth cell.
Name to identify the grid function.
addVertexData(self, data, name)
Add to the visualization output a grid function representing data associated with the vertices of the grid.
2D array whose (m, n)th entry contains the value of the mth component of the grid function at the nth vertex.
Name to identify the grid function.
Clear the list of registered functions.
Parent grid view
Write output (interface might change later).
‘pwrite’ means ‘path write’ (i.e. write somewhere else than the current directory). The ‘p’ does not mean this method has a monopoly on parallel writing, the regular write() method can do that just fine.
Base name of the output files. This should not contain any directory part or filename extensions. It will be used both for the piece file of each process and the parallel collection file.
Directory where to put the parallel collection (.pvtu/.pvtp) file. If it is relative, it is taken relative to the current directory.
Directory where to put the piece file (.vtu/.vtp) of this process. If it is relative, it is taken relative to the directory denoted by path.
Format of the output, one of ‘ascii’ (default), ‘base64’, ‘appendedraw’ or ‘appendedbase64’.
Returns the name of the created file.
Note: Currently, extendpath may not be absolute unless path is.
The membership flag
Write output (interface might change later).
This method can be used in parallel as well as in serial programs. For serial runs (commSize=1) it chooses other names without the ‘s####:p####:’ prefix for the .vtu/.vtp files and omits writing of the .pvtu/pvtp file however. For parallel runs (commSize > 1) it is the same as a call to pwrite() with path=’’ and extendpath=’‘.
Basic name to write (may not contain a path).
Format of the output, one of ‘ascii’ (default), ‘base64’, ‘appendedraw’ or ‘appendedbase64’.
Returns the name of the created file.
adjoint_complex128_complex128(op, range) -> BoundaryOperator_BasisFunctionType_ResultType
defaultCgParameterList(tol) -> Teuchos::RCP< Teuchos::ParameterList >
defaultGmresParameterList(tol) -> Teuchos::RCP< Teuchos::ParameterList >
exportToVtk_complex128_complex128(gridFunction, dataType, dataLabel, fileNamesBase, filesPath=None)
exportToVtk_complex128_complex128(gridFunction, dataType, dataLabel, fileNamesBase)
gridSegmentWithPositiveX(grid) -> GridSegment
numericalQuadratureStrategy_BasisFunctionType_ResultType(accuracyOptions) -> QuadratureStrategy_BasisFunctionType_ResultType
piecewiseLinearDiscontinuousScalarSpaceBarycentric_complex128(grid, segment=None) -> Space_BasisFunctionType
piecewiseLinearDiscontinuousScalarSpaceBarycentric_complex128(grid) -> Space_BasisFunctionType
raviartThomas0VectorSpace_BasisFunctionType(grid, segment=None, putDofsOnBoundaries=False) -> Space_BasisFunctionType
raviartThomas0VectorSpace_BasisFunctionType(grid, segment=None) -> Space_BasisFunctionType
raviartThomas0VectorSpace_BasisFunctionType(grid) -> Space_BasisFunctionType
scaledAcaOperator_ValueType(op, multiplier) -> DiscreteBoundaryOperator_ValueType
Bases: object
Proxy of C++ std::vector<(double)> class
erase(self, first, last) -> std::vector< double >::iterator
insert(self, pos, n, x)
resize(self, new_size, x)
The membership flag
Bases: object
Proxy of C++ std::vector<(int)> class
erase(self, first, last) -> std::vector< int >::iterator
insert(self, pos, n, x)
resize(self, new_size, x)
The membership flag