Forked from
ogs / ogs
18053 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
LocalAssemblerInterface.h 2.85 KiB
/**
* \copyright
* Copyright (c) 2012-2017, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include "NumLib/NumericsConfig.h"
#include "MathLib/Point3d.h"
namespace NumLib
{
class LocalToGlobalIndexMap;
} // NumLib
namespace ProcessLib
{
/*! Common interface for local assemblers
* NumLib::ODESystemTag::FirstOrderImplicitQuasilinear ODE systems.
*
* \todo Generalize to other NumLib::ODESystemTag's.
*/
class LocalAssemblerInterface
{
public:
virtual ~LocalAssemblerInterface() = default;
virtual void assemble(
double const t, std::vector<double> const& local_x,
std::vector<double>& local_M_data, std::vector<double>& local_K_data,
std::vector<double>& local_b_data) = 0;
virtual void assembleWithJacobian(double const t,
std::vector<double> const& local_x,
std::vector<double> const& local_xdot,
const double dxdot_dx, const double dx_dx,
std::vector<double>& local_M_data,
std::vector<double>& local_K_data,
std::vector<double>& local_b_data,
std::vector<double>& local_Jac_data);
virtual void computeSecondaryVariable(std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const& dof_table,
const double t, GlobalVector const& x);
virtual void preTimestep(std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const& dof_table,
GlobalVector const& x, double const t,
double const delta_t);
virtual void postTimestep(std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const& dof_table,
GlobalVector const& x);
/// Computes the flux in the point \c p_local_coords that is given in local
/// coordinates using the values from \c local_x.
virtual std::vector<double> getFlux(
MathLib::Point3d const& /*p_local_coords*/,
std::vector<double> const& /*local_x*/) const
{
return std::vector<double>();
}
private:
virtual void preTimestepConcrete(std::vector<double> const& /*local_x*/,
double const /*t*/, double const /*dt*/)
{
}
virtual void postTimestepConcrete(std::vector<double> const& /*local_x*/) {}
virtual void computeSecondaryVariableConcrete
(double const /*t*/, std::vector<double> const& /*local_x*/) {}
};
} // namespace ProcessLib