Skip to content
Snippets Groups Projects
Commit 64c77f5e authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[PL] TES w/o VetMatAsm

parent 2fbdd7c5
No related branches found
No related tags found
No related merge requests found
......@@ -132,13 +132,16 @@ TESLocalAssembler<
template <typename ShapeFunction_, typename IntegrationMethod_,
unsigned GlobalDim>
void TESLocalAssembler<ShapeFunction_, IntegrationMethod_,
GlobalDim>::assemble(const double /*t*/,
std::vector<double> const& local_x)
void TESLocalAssembler<ShapeFunction_, IntegrationMethod_, GlobalDim>::assemble(
std::size_t const id, NumLib::LocalToGlobalIndexMap const& dof_table,
double const /*t*/, GlobalVector const& x, GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b)
{
_local_M.setZero();
_local_K.setZero();
_local_b.setZero();
auto const indices = NumLib::detail::getIndices(id, dof_table);
auto const local_x = NumLib::detail::getLocalNodalDOFs(x, indices);
IntegrationMethod_ integration_method(_integration_order);
unsigned const n_integration_points = integration_method.getNumberOfPoints();
......@@ -182,18 +185,12 @@ void TESLocalAssembler<ShapeFunction_, IntegrationMethod_,
ogs5OutVec(_local_b);
std::printf("\n");
}
}
template <typename ShapeFunction_, typename IntegrationMethod_,
unsigned GlobalDim>
void TESLocalAssembler<ShapeFunction_, IntegrationMethod_, GlobalDim>::
addToGlobal(
NumLib::LocalToGlobalIndexMap::RowColumnIndices const& indices,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) const
{
M.add(indices, _local_M);
K.add(indices, _local_K);
b.add(indices.rows, _local_b);
auto const r_c_indices =
NumLib::LocalToGlobalIndexMap::RowColumnIndices(indices, indices);
M.add(r_c_indices, _local_M);
K.add(r_c_indices, _local_K);
b.add(indices, _local_b);
}
template <typename ShapeFunction_, typename IntegrationMethod_,
......
......@@ -23,18 +23,12 @@ namespace ProcessLib
namespace TES
{
class TESLocalAssemblerInterface
: public NumLib::Extrapolatable<TESIntPtVariables>
: public ProcessLib::LocalAssemblerInterface,
public NumLib::Extrapolatable<TESIntPtVariables>
{
public:
virtual ~TESLocalAssemblerInterface() = default;
virtual void assemble(double const t,
std::vector<double> const& local_x) = 0;
virtual void addToGlobal(
NumLib::LocalToGlobalIndexMap::RowColumnIndices const&,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) const = 0;
virtual bool checkBounds(std::vector<double> const& local_x,
std::vector<double> const& local_x_prev_ts) = 0;
};
......@@ -54,11 +48,11 @@ public:
unsigned const integration_order,
AssemblyParams const& asm_params);
void assemble(double const t, std::vector<double> const& local_x) override;
void addToGlobal(
NumLib::LocalToGlobalIndexMap::RowColumnIndices const& indices,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) const override;
void assemble(std::size_t const id,
NumLib::LocalToGlobalIndexMap const& dof_table,
double const t, GlobalVector const& x,
GlobalMatrix& M, GlobalMatrix& K,
GlobalVector& b) override;
Eigen::Map<const Eigen::RowVectorXd> getShapeMatrix(
const unsigned integration_point) const override
......
......@@ -171,9 +171,6 @@ void TESProcess::initializeConcreteProcess(
NumLib::LocalToGlobalIndexMap const& dof_table,
MeshLib::Mesh const& mesh, unsigned const integration_order)
{
DBUG("Create global assembler.");
_global_assembler.reset(new GlobalAssembler(dof_table));
ProcessLib::createLocalAssemblers<TESLocalAssembler>(
mesh.getDimension(), mesh.getElements(), dof_table, integration_order,
_local_assemblers, _assembly_params);
......@@ -249,9 +246,9 @@ void TESProcess::assembleConcreteProcess(const double t,
DBUG("Assemble TESProcess.");
// Call global assembler for each local assembly item.
GlobalExecutor::executeMemberDereferenced(*_global_assembler,
&GlobalAssembler::assemble,
_local_assemblers, t, x, M, K, b);
GlobalExecutor::executeMemberOnDereferenced(
&TESLocalAssemblerInterface::assemble, _local_assemblers,
*_local_to_global_index_map, t, x, M, K, b);
}
void TESProcess::preTimestep(GlobalVector const& x, const double t,
......
......@@ -52,10 +52,6 @@ public:
bool isLinear() const override { return false; }
private:
using GlobalAssembler = NumLib::VectorMatrixAssembler<
TESLocalAssemblerInterface,
NumLib::ODESystemTag::FirstOrderImplicitQuasilinear>;
using ExtrapolatorInterface =
NumLib::Extrapolator<TESIntPtVariables, TESLocalAssemblerInterface>;
using ExtrapolatorImplementation =
......@@ -85,7 +81,6 @@ private:
NumLib::LocalToGlobalIndexMap const& dof_table,
std::unique_ptr<GlobalVector>& result_cache);
std::unique_ptr<GlobalAssembler> _global_assembler;
std::vector<std::unique_ptr<TESLocalAssemblerInterface>> _local_assemblers;
AssemblyParams _assembly_params;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment