diff --git a/ProcessLib/SourceTerms/NodalSourceTerm.cpp b/ProcessLib/SourceTerms/NodalSourceTerm.cpp index aec79c2217edaf6f2e772ec11685e46b6df1a975..04d8619f2ed413923c7fb21239bf2160de672cad 100644 --- a/ProcessLib/SourceTerms/NodalSourceTerm.cpp +++ b/ProcessLib/SourceTerms/NodalSourceTerm.cpp @@ -20,7 +20,7 @@ NodalSourceTerm::NodalSourceTerm( const int variable_id, const int component_id, Parameter<double> const& parameter) - : _source_term_dof_table(source_term_dof_table), + : SourceTerm(source_term_dof_table), _bulk_mesh_id(bulk_mesh_id), _st_mesh(st_mesh), _variable_id(variable_id), diff --git a/ProcessLib/SourceTerms/NodalSourceTerm.h b/ProcessLib/SourceTerms/NodalSourceTerm.h index bdaa5a3d04a5e9d17c2eeef16ecac5c6ff731bbd..cc22ee10a8110f9f3db01bc2d60ddc538a965c90 100644 --- a/ProcessLib/SourceTerms/NodalSourceTerm.h +++ b/ProcessLib/SourceTerms/NodalSourceTerm.h @@ -9,12 +9,11 @@ #pragma once -#include "NumLib/DOF/LocalToGlobalIndexMap.h" -#include "ProcessLib/Parameter/Parameter.h" +#include "SourceTerm.h" namespace ProcessLib { -class NodalSourceTerm final +class NodalSourceTerm final : public SourceTerm { public: explicit NodalSourceTerm( @@ -23,10 +22,9 @@ public: const int variable_id, const int component_id, Parameter<double> const& parameter); - void integrate(const double t, GlobalVector& b) const; + void integrate(const double t, GlobalVector& b) const override; private: - NumLib::LocalToGlobalIndexMap const& _source_term_dof_table; std::size_t const _bulk_mesh_id; MeshLib::Mesh const& _st_mesh; int const _variable_id; diff --git a/ProcessLib/SourceTerms/SourceTerm.h b/ProcessLib/SourceTerms/SourceTerm.h new file mode 100644 index 0000000000000000000000000000000000000000..89d9e595f13e532b195f5b75d5f2b117142b6cc0 --- /dev/null +++ b/ProcessLib/SourceTerms/SourceTerm.h @@ -0,0 +1,32 @@ +/** + * \copyright + * Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "NumLib/DOF/LocalToGlobalIndexMap.h" +#include "ProcessLib/Parameter/Parameter.h" + +namespace ProcessLib +{ +class SourceTerm +{ +public: + SourceTerm(const NumLib::LocalToGlobalIndexMap& source_term_dof_table) + : _source_term_dof_table(source_term_dof_table) + { + } + + virtual void integrate(const double t, GlobalVector& b) const = 0; + + virtual ~SourceTerm() = default; +protected: + NumLib::LocalToGlobalIndexMap const& _source_term_dof_table; +}; + +} // namespace ProcessLib