![]() |
OGS
|
|
A boundary condition whose values are computed by a Python script.
Definition at line 58 of file PythonBoundaryCondition.h.
#include <PythonBoundaryCondition.h>
Public Member Functions | |
| PythonBoundaryCondition (PythonBcData &&bc_data, unsigned const integration_order, bool const flush_stdout, unsigned const bulk_mesh_dimension, NumLib::LocalToGlobalIndexMap const &dof_table_bulk) | |
| void | getEssentialBCValues (const double t, const GlobalVector &x, NumLib::IndexValueVector< GlobalIndexType > &bc_values) const override |
Writes the values of essential BCs to bc_values. | |
| void | applyNaturalBC (const double t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac) override |
| Public Member Functions inherited from ProcessLib::BoundaryCondition | |
| virtual void | preTimestep (const double, std::vector< GlobalVector * > const &, int const) |
| virtual void | postTimestep (const double, std::vector< GlobalVector * > const &, int const) |
| virtual | ~BoundaryCondition ()=default |
Private Member Functions | |
| void | collectPrimaryVariables (std::vector< double > &primary_variables, MeshLib::Node const &boundary_node, GlobalVector const &x) const |
| GlobalIndexType | getDofIdx (std::size_t const boundary_node_id) const |
| GlobalIndexType | getDofIdx (std::size_t const boundary_node_id, int const var, int const comp) const |
| double | interpolateToHigherOrderNode (GlobalVector const &x, int const var, int const comp, MeshLib::Node const &boundary_node) const |
Private Attributes | |
| PythonBcData | _bc_data |
| Auxiliary data used by the local assemblers. | |
| std::unique_ptr< NumLib::LocalToGlobalIndexMap > | _dof_table_boundary |
| Local dof table for the boundary mesh. | |
| std::vector< std::unique_ptr< PythonBoundaryConditionLocalAssemblerInterface > > | _local_assemblers |
| Local assemblers for all elements of the boundary mesh. | |
| bool const | _flush_stdout |
| ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition | ( | PythonBcData && | bc_data, |
| unsigned const | integration_order, | ||
| bool const | flush_stdout, | ||
| unsigned const | bulk_mesh_dimension, | ||
| NumLib::LocalToGlobalIndexMap const & | dof_table_bulk ) |
Definition at line 64 of file PythonBoundaryCondition.cpp.
References _bc_data, _dof_table_boundary, _flush_stdout, _local_assemblers, ProcessLib::BoundaryConditionAndSourceTerm::createLocalAssemblersPython(), and NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap().
|
overridevirtual |
Applies natural BCs (i.e. non-Dirichlet BCs) to the stiffness matrix K and the vector b.
Reimplemented from ProcessLib::BoundaryCondition.
Definition at line 239 of file PythonBoundaryCondition.cpp.
References _dof_table_boundary, _flush_stdout, _local_assemblers, ProcessLib::GenericNaturalBoundaryConditionLocalAssemblerInterface::assemble(), DBUG(), NumLib::SerialExecutor::executeMemberOnDereferenced(), and OGS_FATAL.
|
private |
Collects primary variables at the passed node from the passed GlobalVector to primary_variables.
Primary variables at higher order nodes are interpolated from base nodes if necessary, e.g., for Taylor-Hood elements.
primary_variables will contain the value of each component of each primary variable. Their order is determined by the d.o.f. table. Definition at line 173 of file PythonBoundaryCondition.cpp.
References _dof_table_boundary, getDofIdx(), MathLib::Point3dWithID::getID(), interpolateToHigherOrderNode(), and NumLib::MeshComponentMap::nop.
Referenced by getEssentialBCValues().
|
private |
Get the d.o.f. index at the given boundary_node_id for this BC's variable and component.
Definition at line 156 of file PythonBoundaryCondition.cpp.
References _bc_data, _dof_table_boundary, and MeshLib::Node.
Referenced by collectPrimaryVariables(), and getEssentialBCValues().
|
private |
Get the d.o.f. index at the given boundary_node_id for the given variable and component.
Definition at line 165 of file PythonBoundaryCondition.cpp.
References _bc_data, _dof_table_boundary, and MeshLib::Node.
|
overridevirtual |
Writes the values of essential BCs to bc_values.
Reimplemented from ProcessLib::BoundaryCondition.
Definition at line 88 of file PythonBoundaryCondition.cpp.
References _bc_data, _flush_stdout, collectPrimaryVariables(), DBUG(), getDofIdx(), NumLib::IndexValueVector< IndexType >::ids, NumLib::MeshComponentMap::nop, OGS_FATAL, and NumLib::IndexValueVector< IndexType >::values.
|
private |
Interpolates the given component of the given variable to the given boundary_node.
Definition at line 199 of file PythonBoundaryCondition.cpp.
References _bc_data, _dof_table_boundary, _local_assemblers, DBUG(), and MathLib::Point3dWithID::getID().
Referenced by collectPrimaryVariables().
|
private |
Auxiliary data used by the local assemblers.
Definition at line 105 of file PythonBoundaryCondition.h.
Referenced by PythonBoundaryCondition(), getDofIdx(), getDofIdx(), getEssentialBCValues(), and interpolateToHigherOrderNode().
|
private |
Local dof table for the boundary mesh.
Definition at line 108 of file PythonBoundaryCondition.h.
Referenced by PythonBoundaryCondition(), applyNaturalBC(), collectPrimaryVariables(), getDofIdx(), getDofIdx(), and interpolateToHigherOrderNode().
|
private |
Whether or not to flush standard output before and after each call to Python code. Ensures right order of output messages and therefore simplifies debugging.
Definition at line 117 of file PythonBoundaryCondition.h.
Referenced by PythonBoundaryCondition(), applyNaturalBC(), and getEssentialBCValues().
|
private |
Local assemblers for all elements of the boundary mesh.
Definition at line 112 of file PythonBoundaryCondition.h.
Referenced by PythonBoundaryCondition(), applyNaturalBC(), and interpolateToHigherOrderNode().