OGS
SurfaceFlux.cpp
Go to the documentation of this file.
1 
11 #include "SurfaceFlux.h"
12 
13 #include <cassert>
14 
16 
17 namespace ProcessLib
18 {
20  std::size_t bulk_property_number_of_components,
21  unsigned const integration_order)
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>(
43  "bulk_element_ids", MeshLib::MeshItemType::Cell, 1);
44  auto const bulk_face_ids =
45  boundary_mesh.getProperties().template getPropertyVector<std::size_t>(
46  "bulk_face_ids", MeshLib::MeshItemType::Cell, 1);
47 
48  ProcessLib::createLocalAssemblers<SurfaceFluxLocalAssembler>(
49  boundary_mesh.getDimension() + 1, // or bulk_mesh.getDimension()?
50  boundary_mesh.getElements(), *dof_table, 1, _local_assemblers,
51  boundary_mesh.isAxiallySymmetric(), integration_order,
52  *bulk_element_ids, *bulk_face_ids);
53 }
54 
56  std::vector<GlobalVector*> const& x,
58  double const t,
59  MeshLib::Mesh const& bulk_mesh,
60  std::vector<std::size_t> const& active_element_ids,
61  std::function<Eigen::Vector3d(
62  std::size_t const, MathLib::Point3d const&, double const,
63  std::vector<GlobalVector*> const&)> const& getFlux)
64 {
65  DBUG("Integrate SurfaceFlux.");
66 
69  active_element_ids, x, balance, t, bulk_mesh, getFlux);
70 }
71 
72 } // namespace ProcessLib
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
bool isAxiallySymmetric() const
Definition: Mesh.h:126
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition: Mesh.h:95
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition: Mesh.h:71
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition: Mesh.h:98
Properties & getProperties()
Definition: Mesh.h:123
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)
Definition: SurfaceFlux.cpp:55
SurfaceFlux(MeshLib::Mesh &boundary_mesh, std::size_t bulk_property_number_of_components, unsigned const integration_order)
Definition: SurfaceFlux.cpp:19
std::vector< std::unique_ptr< SurfaceFluxLocalAssemblerInterface > > _local_assemblers
Definition: SurfaceFlux.h:55
@ BY_LOCATION
Ordering data by spatial location.
static void executeSelectedMemberOnDereferenced(Method method, Container const &container, std::vector< std::size_t > const &active_container_ids, Args &&... args)