Skip to content

Commit

Permalink
created a finite volume discretization
Browse files Browse the repository at this point in the history
  • Loading branch information
Franz R. Sattler committed Dec 18, 2024
1 parent 0ae2b0f commit 437f57e
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions DiFfRG/include/DiFfRG/discretization/FV/discretization.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#pragma once

// external libraries
#include <deal.II/base/point.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_renumbering.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_q1.h>
#include <deal.II/lac/affine_constraints.h>
#include <spdlog/spdlog.h>

// DiFfRG
#include <DiFfRG/common/utils.hh>

namespace DiFfRG
{
namespace FV
{
using namespace dealii;

/**
* @brief Class to manage the system on which we solve, i.e. fe spaces, grids, etc.
* This class is a System for CG systems.
*
* @tparam Model_ The Model class used for the Simulation
*/
template <typename Components_, typename NumberType_, typename Mesh_> class Discretization
{
public:
using Components = Components_;
using NumberType = NumberType_;
using VectorType = Vector<NumberType>;
using SparseMatrixType = SparseMatrix<NumberType>;
using Mesh = Mesh_;
static constexpr uint dim = Mesh::dim;

Discretization(Mesh &mesh, const JSONValue &json) : mesh(mesh), json(json) {};

const auto &get_mapping() const { return mapping; }
const auto &get_triangulation() const { return mesh.get_triangulation(); }
auto &get_triangulation() { return mesh.get_triangulation(); }
const auto &get_json() const { return json; }

void reinit() {}

protected:
Mesh &mesh;
JSONValue json;

AffineConstraints<NumberType> constraints;
MappingQ1<dim> mapping;
};
} // namespace FV
} // namespace DiFfRG

0 comments on commit 437f57e

Please sign in to comment.