diff --git a/ProcessLib/NeumannBc.h b/ProcessLib/NeumannBc.h index 1a5d24f8649fd5c899081f159c9dbce5b37874e2..7e348743b0ed1ddb962973f40f666a18ae2d784e 100644 --- a/ProcessLib/NeumannBc.h +++ b/ProcessLib/NeumannBc.h @@ -29,10 +29,26 @@ namespace ProcessLib { +/// The NeumannBc class is a process which is integrating a single, Neumann type +/// boundary conditions in to the global matrix and the right-hand-side. +/// +/// The process operates on a set of elements and a subset of the DOF-table (the +/// local to global index map). For each element a local assembler is created +/// (NeumannBcAssembler). +/// +/// In the construction phase the NeumannBcConfig together with global DOF-table +/// and mesh subset are used. +/// The creation of the local assemblers and binding to the global matrix and +/// right-hand-sides happen in the initialize() function. +/// The integration() function provides calls then the actual integration of the +/// Neumann boundary conditions. template <typename GlobalSetup_> class NeumannBc { public: + /// Create a Neumann boundary condition process from given config, + /// DOF-table, and a mesh subset. + /// A local DOF-table, a subset of the given one, is constructed. NeumannBc( NeumannBcConfig* bc, unsigned const integration_order, @@ -68,6 +84,8 @@ public: delete p; } + /// Allocates the local assemblers for each element and stores references to + /// global matrix and the right-hand-side. template <typename GlobalSetup> void initialize(GlobalSetup const& global_setup, @@ -111,6 +129,8 @@ public: new GlobalAssembler(A, rhs, *_local_to_global_index_map)); } + /// Calls local assemblers which calculate their contributions to the global + /// matrix and the right-hand-side. template <typename GlobalSetup> void integrate(GlobalSetup const& global_setup) @@ -120,14 +140,23 @@ public: private: + /// The right-hand-side function of the Neumann boundary condition given as + /// \f$ \alpha(x) \, \partial u(x) / \partial n = \text{_function}(x)\f$. MathLib::ConstantFunction<double> const _function; + /// Vector of lower-dimensional elements on which the boundary condition is + /// defined. std::vector<MeshLib::Element const*> _elements; + MeshLib::MeshSubset const* _mesh_subset_all_nodes = nullptr; std::vector<MeshLib::MeshSubsets*> _all_mesh_subsets; + /// Local dof table, a subset of the global one restricted to the + /// participating #_elements of the boundary condition. std::unique_ptr<AssemblerLib::LocalToGlobalIndexMap> _local_to_global_index_map; + /// Integration order for integration over the lower-dimensional elements of + /// the #_function. unsigned const _integration_order; using GlobalAssembler = @@ -140,6 +169,7 @@ private: using LocalAssembler = LocalNeumannBcAsmDataInterface< typename GlobalSetup_::MatrixType, typename GlobalSetup_::VectorType>; + /// Local assemblers for each element of #_elements. std::vector<LocalAssembler*> _local_assemblers; }; diff --git a/ProcessLib/NeumannBcConfig.h b/ProcessLib/NeumannBcConfig.h index 741432e3194bde2dd01e079e19dff07f23d80926..ac4ae385d4907b0d506800966a1d82a7c1518246 100644 --- a/ProcessLib/NeumannBcConfig.h +++ b/ProcessLib/NeumannBcConfig.h @@ -39,6 +39,7 @@ protected: }; +/// Configuration of a Neumann type boundary condition read from input file. class NeumannBcConfig : public BoundaryConditionConfig { using ConfigTree = boost::property_tree::ptree; @@ -76,18 +77,22 @@ public: std::mem_fn(&MeshLib::Element::clone)); } + /// Iterator over elements of the boundary condition. std::vector<MeshLib::Element*>::const_iterator elementsBegin() const { return _elements.cbegin(); } + /// Past the end iterator over elements of the boundary condition. + /// \sa elementsBegin(). std::vector<MeshLib::Element*>::const_iterator elementsEnd() const { return _elements.cend(); } + /// Returns the right-hand-side function of the boundary condition. MathLib::ConstantFunction<double>* getFunction() const { @@ -95,7 +100,8 @@ public: } private: - std::vector<MeshLib::Element*> _elements; ///< boundary domain + /// Domain of the boundary condition. + std::vector<MeshLib::Element*> _elements; /// A function given on the domain of the boundary condition. MathLib::ConstantFunction<double>* _function = nullptr;