LCOV - code coverage report
Current view: top level - ugbase/bridge/disc_bridges - finite_volume_bridge.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 96.9 % 32 31
Test Date: 2025-09-21 23:31:46 Functions: 100.0 % 25 25

            Line data    Source code
       1              : /*
       2              :  * Copyright (c) 2012-2015:  G-CSC, Goethe University Frankfurt
       3              :  * Author: Andreas Vogel
       4              :  * 
       5              :  * This file is part of UG4.
       6              :  * 
       7              :  * UG4 is free software: you can redistribute it and/or modify it under the
       8              :  * terms of the GNU Lesser General Public License version 3 (as published by the
       9              :  * Free Software Foundation) with the following additional attribution
      10              :  * requirements (according to LGPL/GPL v3 §7):
      11              :  * 
      12              :  * (1) The following notice must be displayed in the Appropriate Legal Notices
      13              :  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
      14              :  * 
      15              :  * (2) The following notice must be displayed at a prominent place in the
      16              :  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
      17              :  * 
      18              :  * (3) The following bibliography is recommended for citation and must be
      19              :  * preserved in all covered files:
      20              :  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
      21              :  *   parallel geometric multigrid solver on hierarchically distributed grids.
      22              :  *   Computing and visualization in science 16, 4 (2013), 151-164"
      23              :  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
      24              :  *   flexible software system for simulating pde based models on high performance
      25              :  *   computers. Computing and visualization in science 16, 4 (2013), 165-179"
      26              :  * 
      27              :  * This program is distributed in the hope that it will be useful,
      28              :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      29              :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
      30              :  * GNU Lesser General Public License for more details.
      31              :  */
      32              : 
      33              : // extern headers
      34              : #include <iostream>
      35              : #include <sstream>
      36              : #include <string>
      37              : 
      38              : // include bridge
      39              : #include "bridge/bridge.h"
      40              : #include "bridge/util.h"
      41              : #include "bridge/util_domain_algebra_dependent.h"
      42              : 
      43              : // lib_disc includes
      44              : #include "lib_disc/function_spaces/grid_function.h"
      45              : #include "lib_disc/function_spaces/approximation_space.h"
      46              : 
      47              : #include "lib_disc/spatial_disc/disc_util/fv_output.h"
      48              : 
      49              : using namespace std;
      50              : 
      51              : namespace ug{
      52              : namespace bridge{
      53              : namespace FiniteVolume{
      54              : 
      55              : /**
      56              :  * \defgroup finitvolume_bridge Finite Volume Bridge
      57              :  * \ingroup disc_bridge
      58              :  * \{
      59              :  */
      60              : 
      61              : /**
      62              :  * Class exporting the functionality. All functionality that is to
      63              :  * be used in scripts or visualization must be registered here.
      64              :  */
      65              : struct Functionality
      66              : {
      67              : 
      68              : /**
      69              :  * Function called for the registration of Domain and Algebra dependent parts.
      70              :  * All Functions and Classes depending on both Domain and Algebra
      71              :  * are to be placed here when registering. The method is called for all
      72              :  * available Domain and Algebra types, based on the current build options.
      73              :  *
      74              :  * @param reg                           registry
      75              :  * @param parentGroup           group for sorting of functionality
      76              :  */
      77              : template <typename TDomain, typename TAlgebra>
      78            9 : static void DomainAlgebra(Registry& reg, string grp)
      79              : {
      80              :         string suffix = GetDomainAlgebraSuffix<TDomain,TAlgebra>();
      81              :         string tag = GetDomainAlgebraTag<TDomain,TAlgebra>();
      82              : 
      83            9 : }
      84              : 
      85              : template <template <class, int> class TFVGeom, typename TDomain>
      86            6 : static void DomainFVGeom(Registry& reg, string grp, string append)
      87              : {
      88              :         string suffix = GetDomainSuffix<TDomain>();
      89              :         string tag = GetDomainTag<TDomain>();
      90              : 
      91            6 :         std::string name = "";
      92              :         {
      93           12 :                 name = std::string("CreateSubControlVolumeFaceDomain"); name.append(append);
      94           18 :                 reg.add_function(name, &CreateSubControlVolumeFaceDomain<TFVGeom, TDomain>, grp);
      95           12 :                 name = std::string("CreateSubControlVolumeDomain"); name.append(append);
      96           18 :                 reg.add_function(name, &CreateSubControlVolumeDomain<TFVGeom, TDomain>, grp);
      97           12 :                 name = std::string("CreateControlVolumeDomain");name.append(append);
      98           18 :                 reg.add_function(name, &CreateControlVolumeDomain<TFVGeom, TDomain>, grp);
      99              :         }
     100            6 : }
     101              : 
     102              : /**
     103              :  * Function called for the registration of Domain dependent parts.
     104              :  * All Functions and Classes depending on the Domain
     105              :  * are to be placed here when registering. The method is called for all
     106              :  * available Domain types, based on the current build options.
     107              :  *
     108              :  * @param reg                           registry
     109              :  * @param parentGroup           group for sorting of functionality
     110              :  */
     111              : template <typename TDomain>
     112            3 : static void Domain(Registry& reg, string grp)
     113              : {
     114              :         string suffix = GetDomainSuffix<TDomain>();
     115              :         string tag = GetDomainTag<TDomain>();
     116              : 
     117              : //      CreateSubControlVolumeFaceDomain
     118              :         {
     119            9 :                 DomainFVGeom<FV1Geometry, TDomain>(reg, grp, "_FV1");
     120            9 :                 DomainFVGeom<HFV1Geometry, TDomain>(reg, grp, "_HFV1");
     121              :         }
     122            3 : }
     123              : 
     124              : /**
     125              :  * Function called for the registration of Dimension dependent parts.
     126              :  * All Functions and Classes depending on the Dimension
     127              :  * are to be placed here when registering. The method is called for all
     128              :  * available Dimension types, based on the current build options.
     129              :  *
     130              :  * @param reg                           registry
     131              :  * @param parentGroup           group for sorting of functionality
     132              :  */
     133              : template <int dim>
     134            3 : static void Dimension(Registry& reg, string grp)
     135              : {
     136            3 :         string suffix = GetDimensionSuffix<dim>();
     137            3 :         string tag = GetDimensionTag<dim>();
     138              : 
     139            3 : }
     140              : 
     141              : /**
     142              :  * Function called for the registration of Algebra dependent parts.
     143              :  * All Functions and Classes depending on Algebra
     144              :  * are to be placed here when registering. The method is called for all
     145              :  * available Algebra types, based on the current build options.
     146              :  *
     147              :  * @param reg                           registry
     148              :  * @param parentGroup           group for sorting of functionality
     149              :  */
     150              : template <typename TAlgebra>
     151            3 : static void Algebra(Registry& reg, string grp)
     152              : {
     153            3 :         string suffix = GetAlgebraSuffix<TAlgebra>();
     154            3 :         string tag = GetAlgebraTag<TAlgebra>();
     155            3 : }
     156              : 
     157              : /**
     158              :  * Function called for the registration of Domain and Algebra independent parts.
     159              :  * All Functions and Classes not depending on Domain and Algebra
     160              :  * are to be placed here when registering.
     161              :  *
     162              :  * @param reg                           registry
     163              :  * @param parentGroup           group for sorting of functionality
     164              :  */
     165              : static void Common(Registry& reg, string grp)
     166              : {
     167              : }
     168              : 
     169              : }; // end Functionality
     170              : 
     171              : // end group finitvolume_bridge
     172              : /// \}
     173              : 
     174              : }// end FiniteVolume
     175              : 
     176              : /// \addtogroup finitvolume_bridge
     177            1 : void RegisterBridge_FiniteVolume(Registry& reg, string grp)
     178              : {
     179            1 :         grp.append("/Discretization");
     180              :         typedef FiniteVolume::Functionality Functionality;
     181              : 
     182              :         try{
     183            2 :                 RegisterCommon<Functionality>(reg,grp);
     184            2 :                 RegisterDimensionDependent<Functionality>(reg,grp);
     185            2 :                 RegisterDomainDependent<Functionality>(reg,grp);
     186            2 :                 RegisterAlgebraDependent<Functionality>(reg,grp);
     187            1 :                 RegisterDomainAlgebraDependent<Functionality>(reg,grp);
     188              :         }
     189            0 :         UG_REGISTRY_CATCH_THROW(grp);
     190            1 : }
     191              : 
     192              : }// namespace bridge
     193              : }// namespace ug
        

Generated by: LCOV version 2.0-1