OGS
ProcessLib::SurfaceFlux Class Referencefinal

Detailed Description

Definition at line 19 of file SurfaceFlux.h.

#include <SurfaceFlux.h>

Public Member Functions

 SurfaceFlux (MeshLib::Mesh &boundary_mesh, std::size_t bulk_property_number_of_components, unsigned const integration_order)
 
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)
 

Private Attributes

std::vector< std::unique_ptr< SurfaceFluxLocalAssemblerInterface > > _local_assemblers
 

Constructor & Destructor Documentation

◆ SurfaceFlux()

ProcessLib::SurfaceFlux::SurfaceFlux ( MeshLib::Mesh & boundary_mesh,
std::size_t bulk_property_number_of_components,
unsigned const integration_order )

Constructs an object that is able to compute a balance.

Parameters
boundary_meshThe integration boundary mesh.
bulk_property_number_of_componentsThe number of components the variable has.
integration_orderIntegration order used in local assembly.

Definition at line 19 of file SurfaceFlux.cpp.

22{
23 DBUG("Create local balance assemblers.");
24 // Populate the vector of local assemblers.
25 _local_assemblers.resize(boundary_mesh.getElements().size());
26
27 // needed to create dof table
28 auto mesh_subset_all_nodes = std::make_unique<MeshLib::MeshSubset>(
29 boundary_mesh, boundary_mesh.getNodes());
30
31 // Collect the mesh subsets in a vector.
32 std::vector<MeshLib::MeshSubset> all_mesh_subsets;
33 std::generate_n(std::back_inserter(all_mesh_subsets),
34 bulk_property_number_of_components,
35 [&]() { return *mesh_subset_all_nodes; });
36
37 // needed for creation of local assemblers
38 auto dof_table = std::make_unique<NumLib::LocalToGlobalIndexMap const>(
39 std::move(all_mesh_subsets), NumLib::ComponentOrder::BY_LOCATION);
40
41 auto const bulk_element_ids =
42 boundary_mesh.getProperties().template getPropertyVector<std::size_t>(
45 auto const bulk_face_ids =
46 boundary_mesh.getProperties().template getPropertyVector<std::size_t>(
49
51 boundary_mesh.getDimension() + 1, // or bulk_mesh.getDimension()?
52 boundary_mesh.getElements(), *dof_table, _local_assemblers,
53 NumLib::IntegrationOrder{integration_order},
54 boundary_mesh.isAxiallySymmetric(), *bulk_element_ids, *bulk_face_ids);
55}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
bool isAxiallySymmetric() const
Definition Mesh.h:137
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88
Properties & getProperties()
Definition Mesh.h:134
std::vector< std::unique_ptr< SurfaceFluxLocalAssemblerInterface > > _local_assemblers
Definition SurfaceFlux.h:54
constexpr std::string_view getBulkIDString(MeshItemType mesh_item_type)
Definition Properties.h:188
@ 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)

References _local_assemblers, NumLib::BY_LOCATION, MeshLib::Cell, ProcessLib::createLocalAssemblers(), DBUG(), MeshLib::Face, MeshLib::getBulkIDString(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getProperties(), and MeshLib::Mesh::isAxiallySymmetric().

Member Function Documentation

◆ integrate()

void ProcessLib::SurfaceFlux::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 )

Executes for each element of the mesh the local integration procedure.

Parameters
xThe global solution the integration values will be fetched of.
balanceThe vector the integration results will be stored in.
tThe balance will be computed at the time t.
bulk_meshStores a reference to the bulk mesh that is needed to fetch the information for the integration over the surface mesh.
active_element_idsThe IDs of active elements. It is empty if there is no deactivated subdomain.
getFluxfunction that calculates the flux in the integration points of the face elements of the bulk element that belongs to the surface.

Definition at line 57 of file SurfaceFlux.cpp.

66{
67 DBUG("Integrate SurfaceFlux.");
68
71 active_element_ids, x, balance, t, bulk_mesh, getFlux);
72}
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
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)

References _local_assemblers, DBUG(), NumLib::SerialExecutor::executeSelectedMemberOnDereferenced(), and ProcessLib::SurfaceFluxLocalAssemblerInterface::integrate().

Member Data Documentation

◆ _local_assemblers

std::vector<std::unique_ptr<SurfaceFluxLocalAssemblerInterface> > ProcessLib::SurfaceFlux::_local_assemblers
private

Definition at line 54 of file SurfaceFlux.h.

Referenced by SurfaceFlux(), and integrate().


The documentation for this class was generated from the following files: