OGS
SurfaceFlux.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "SurfaceFlux.h"
5
6#include <cassert>
7
9
10namespace ProcessLib
11{
13 std::size_t bulk_property_number_of_components,
14 unsigned const integration_order)
15{
16 DBUG("Create local balance assemblers.");
17 // Populate the vector of local assemblers.
18 _local_assemblers.resize(boundary_mesh.getElements().size());
19
20 // needed to create dof table
21 auto mesh_subset_all_nodes = std::make_unique<MeshLib::MeshSubset>(
22 boundary_mesh, boundary_mesh.getNodes());
23
24 // Collect the mesh subsets in a vector.
25 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
26 std::generate_n(std::back_inserter(all_mesh_subsets),
27 bulk_property_number_of_components,
28 [&]() { return *mesh_subset_all_nodes; });
29
30 // needed for creation of local assemblers
31 auto dof_table = std::make_unique<NumLib::LocalToGlobalIndexMap const>(
32 std::move(all_mesh_subsets), NumLib::ComponentOrder::BY_LOCATION);
33
34 auto const bulk_element_ids =
35 boundary_mesh.getProperties().template getPropertyVector<std::size_t>(
38 auto const bulk_face_ids =
39 boundary_mesh.getProperties().template getPropertyVector<std::size_t>(
42
44 boundary_mesh.getDimension() + 1, // or bulk_mesh.getDimension()?
45 boundary_mesh.getElements(), *dof_table, _local_assemblers,
46 NumLib::IntegrationOrder{integration_order},
47 boundary_mesh.isAxiallySymmetric(), *bulk_element_ids, *bulk_face_ids);
48}
49
51 std::vector<GlobalVector*> const& x,
53 double const t,
54 MeshLib::Mesh const& bulk_mesh,
55 std::vector<std::size_t> const& active_element_ids,
56 std::function<Eigen::Vector3d(
57 std::size_t const, MathLib::Point3d const&, double const,
58 std::vector<GlobalVector*> const&)> const& getFlux)
59{
60 DBUG("Integrate SurfaceFlux.");
61
64 active_element_ids, x, balance, t, bulk_mesh, getFlux);
65}
66
67} // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
bool isAxiallySymmetric() const
Definition Mesh.h:128
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:97
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:100
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:79
Properties & getProperties()
Definition Mesh.h:125
virtual void integrate(std::size_t const element_id, std::vector< GlobalVector * > const &x, MeshLib::PropertyVector< double > &specific_flux, double const t, MeshLib::Mesh const &bulk_mesh, std::function< Eigen::Vector3d(std::size_t const, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &)>)=0
void integrate(std::vector< GlobalVector * > const &x, MeshLib::PropertyVector< double > &balance, double const t, MeshLib::Mesh const &bulk_mesh, std::vector< std::size_t > const &active_element_ids, std::function< Eigen::Vector3d(std::size_t const, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &)> const &getFlux)
SurfaceFlux(MeshLib::Mesh &boundary_mesh, std::size_t bulk_property_number_of_components, unsigned const integration_order)
std::vector< std::unique_ptr< SurfaceFluxLocalAssemblerInterface > > _local_assemblers
Definition SurfaceFlux.h:47
constexpr std::string_view getBulkIDString(MeshItemType mesh_item_type)
@ BY_LOCATION
Ordering data by spatial location.
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, ProviderOrOrder const &provider_or_order, ExtraCtorArgs &&... extra_ctor_args)
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)