diff --git a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.cpp b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.cpp index b28076ee3db5787663be59c045243de3b56758fc..2116437a3edbf9d2b34feaff60ee38314a0a3371 100644 --- a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.cpp +++ b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.cpp @@ -55,13 +55,14 @@ CalculateSurfaceFlux::CalculateSurfaceFlux( void CalculateSurfaceFlux::integrate(GlobalVector const& x, MeshLib::PropertyVector<double>& balance, + double const t, Process const& bulk_process) { DBUG("Integrate CalculateSurfaceFlux."); GlobalExecutor::executeMemberOnDereferenced( &CalculateSurfaceFluxLocalAssemblerInterface::integrate, - _local_assemblers, x, balance, bulk_process); + _local_assemblers, x, balance, t, bulk_process); } } // namespace ProcessLib diff --git a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h index 4a7a84da85e0b8c0b08d004fae2c54dec5bcacfc..983b33816bde2a8e7d0a4ecf7183ff76fb26c1c9 100644 --- a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h +++ b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFlux.h @@ -29,10 +29,12 @@ public: /// Executes for each element of the mesh the local intergration procedure. /// @param x The global solution the intergration values will be fetched of. /// @param balance The vector the integration results will be stored in. + /// @param t The balance will be computed at the time t. /// @param bulk_process Stores the variable that is used for the /// integration. void integrate(GlobalVector const& x, MeshLib::PropertyVector<double>& balance, + double const t, Process const& bulk_process); private: diff --git a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFluxLocalAssembler.h b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFluxLocalAssembler.h index 19ce5435aa519f2686cb421584624370e5b777a9..6634fff48800e5692243ba94e46d602501fb1543 100644 --- a/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFluxLocalAssembler.h +++ b/ProcessLib/CalculateSurfaceFlux/CalculateSurfaceFluxLocalAssembler.h @@ -31,6 +31,7 @@ public: virtual void integrate(std::size_t element_id, GlobalVector const& x, MeshLib::PropertyVector<double>& balance, + double const t, Process const& bulk_process) = 0; }; @@ -101,11 +102,13 @@ public: /// @param balance PropertyVector the integration result will be stored /// into, where balance has the same number of entries like mesh elements /// exists. + /// @param t The integration is performed at the time t. /// @param bulk_process Reference to the bulk process is used to compute the /// flux. void integrate(std::size_t element_id, GlobalVector const& x, MeshLib::PropertyVector<double>& balance, + double const t, Process const& bulk_process) override { auto surface_element_normal = @@ -126,8 +129,8 @@ public: auto const bulk_element_point = MeshLib::getBulkElementPoint( bulk_process.getMesh(), _bulk_element_id, _bulk_face_id, wp); - auto const bulk_flux = - bulk_process.getFlux(_bulk_element_id, bulk_element_point, x); + auto const bulk_flux = bulk_process.getFlux( + _bulk_element_id, bulk_element_point, t, x); for (int component_id(0); component_id < balance.getNumberOfComponents(); diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h index eb7733650812342ab7c8c54edfe43ac91d16f94c..185ce1872c8cc4b71ca90b7faec63d4219386f2a 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowFEM.h @@ -104,10 +104,9 @@ public: /// Computes the flux in the point \c p_local_coords that is given in local /// coordinates using the values from \c local_x. - // TODO add time dependency - Eigen::Vector3d getFlux( - MathLib::Point3d const& p_local_coords, - std::vector<double> const& local_x) const override + Eigen::Vector3d getFlux(MathLib::Point3d const& p_local_coords, + double const t, + std::vector<double> const& local_x) const override { // eval dNdx and invJ at p using FemType = @@ -127,8 +126,6 @@ public: // fetch hydraulic conductivity SpatialPosition pos; pos.setElementID(_element.getID()); - // TODO remove follwing line if time dependency is implemented - double const t = 0.0; auto const k = _process_data.hydraulic_conductivity(t, pos)[0]; Eigen::Vector3d flux; diff --git a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h index 5ce132d81af27f7de52b8dc6054649de298f10a9..9123e3ee744e7a0b5a87077f3f12899fd5138a48 100644 --- a/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h +++ b/ProcessLib/GroundwaterFlow/GroundwaterFlowProcess.h @@ -48,8 +48,9 @@ public: //! @} Eigen::Vector3d getFlux(std::size_t element_id, - MathLib::Point3d const& p, - GlobalVector const& x) const override + MathLib::Point3d const& p, + double const t, + GlobalVector const& x) const override { // fetch local_x from primary variable std::vector<GlobalIndexType> indices_cache; @@ -57,11 +58,11 @@ public: element_id, *_local_to_global_index_map, indices_cache); std::vector<double> local_x(x.get(r_c_indices.rows)); - return _local_assemblers[element_id]->getFlux(p, local_x); + return _local_assemblers[element_id]->getFlux(p, t, local_x); } void postTimestepConcreteProcess(GlobalVector const& x, - const double /*t*/, + const double t, const double /*delta_t*/, int const process_id) override { @@ -89,7 +90,7 @@ public: _balance_mesh->getProperties() .template getPropertyVector<double>(_balance_pv_name); - balance.integrate(x, *balance_pv, *this); + balance.integrate(x, *balance_pv, t, *this); // post: surface_mesh has vectorial element property // TODO output, if output classes are ready this has to be diff --git a/ProcessLib/HT/HTFEM.h b/ProcessLib/HT/HTFEM.h index ce156e71f35be02b9a46ab5d4f38a095ad7c70be..69f1c1ee4a3c3bee50098172465f96e7426f9b73 100644 --- a/ProcessLib/HT/HTFEM.h +++ b/ProcessLib/HT/HTFEM.h @@ -90,9 +90,9 @@ public: /// Computes the flux in the point \c pnt_local_coords that is given in /// local coordinates using the values from \c local_x. - // TODO add time dependency Eigen::Vector3d getFlux( MathLib::Point3d const& pnt_local_coords, + double const t, std::vector<double> const& local_x) const override { // eval dNdx and invJ at given point @@ -123,8 +123,6 @@ public: vars[static_cast<int>( MaterialLib::Fluid::PropertyVariableType::p)]); - // TODO remove following line if time dependency is implemented - double const t = 0.0; auto const K = this->_material_properties.porous_media_properties .getIntrinsicPermeability(t, pos) diff --git a/ProcessLib/HT/HTLocalAssemblerInterface.h b/ProcessLib/HT/HTLocalAssemblerInterface.h index fbcd85a711d8bec0067a4eb744802b261e1068c8..5e29303a1dc347152c5cbd43c18ff43e1927bba7 100644 --- a/ProcessLib/HT/HTLocalAssemblerInterface.h +++ b/ProcessLib/HT/HTLocalAssemblerInterface.h @@ -61,6 +61,7 @@ public: virtual Eigen::Vector3d getFlux( MathLib::Point3d const& pnt_local_coords, + double const t, std::vector<double> const& local_x) const = 0; protected: diff --git a/ProcessLib/HT/HTProcess.cpp b/ProcessLib/HT/HTProcess.cpp index 969b073abe99d6aba0dc079334fbbd5a4aeccdbf..d00b04b188d81d5df122d7cf78d75e3bdf627423 100644 --- a/ProcessLib/HT/HTProcess.cpp +++ b/ProcessLib/HT/HTProcess.cpp @@ -242,6 +242,7 @@ void HTProcess::setCoupledSolutionsOfPreviousTimeStep() Eigen::Vector3d HTProcess::getFlux(std::size_t element_id, MathLib::Point3d const& p, + double const t, GlobalVector const& x) const { // fetch local_x from primary variable @@ -250,7 +251,7 @@ Eigen::Vector3d HTProcess::getFlux(std::size_t element_id, element_id, *_local_to_global_index_map, indices_cache); std::vector<double> local_x(x.get(r_c_indices.rows)); - return _local_assemblers[element_id]->getFlux(p, local_x); + return _local_assemblers[element_id]->getFlux(p, t, local_x); } // this is almost a copy of the implemention in the GroundwaterFlow @@ -284,7 +285,7 @@ void HTProcess::postTimestepConcreteProcess(GlobalVector const& x, getProcessVariables(process_id)[0].get().getNumberOfComponents(), _integration_order); - balance.integrate(x, *balance_pv, *this); + balance.integrate(x, *balance_pv, t, *this); // post: surface_mesh has scalar element property // TODO output, if output classes are ready this has to be diff --git a/ProcessLib/HT/HTProcess.h b/ProcessLib/HT/HTProcess.h index ab13614ba7b8cf025b5a5d48b14f83290b01d2e7..35a8d3e0e6eb56669731fa86edb07644eff5f7d2 100644 --- a/ProcessLib/HT/HTProcess.h +++ b/ProcessLib/HT/HTProcess.h @@ -70,8 +70,9 @@ public: //! @} Eigen::Vector3d getFlux(std::size_t element_id, - MathLib::Point3d const& p, - GlobalVector const& x) const override; + MathLib::Point3d const& p, + double const t, + GlobalVector const& x) const override; void setCoupledTermForTheStaggeredSchemeToLocalAssemblers() override; diff --git a/ProcessLib/LocalAssemblerInterface.h b/ProcessLib/LocalAssemblerInterface.h index aa24d8d390730ba6255e82ea771608fdd27db970..d3f01175a99564d049d454468fb0913fb2714075 100644 --- a/ProcessLib/LocalAssemblerInterface.h +++ b/ProcessLib/LocalAssemblerInterface.h @@ -87,6 +87,7 @@ public: /// coordinates using the values from \c local_x. virtual Eigen::Vector3d getFlux( MathLib::Point3d const& /*p_local_coords*/, + double const /*t*/, std::vector<double> const& /*local_x*/) const { return Eigen::Vector3d{}; diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index 17718362a435b56ecd34dc0890077b76560814f4..f4f9e86b641d76f3e7b9ad520eeb3b6b90a67e0c 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -138,6 +138,7 @@ public: virtual Eigen::Vector3d getFlux(std::size_t /*element_id*/, MathLib::Point3d const& /*p*/, + double const /*t*/, GlobalVector const& /*x*/) const { return Eigen::Vector3d{};