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

[PL] use new matrix specs

parent d5311b47
No related branches found
No related tags found
No related merge requests found
......@@ -20,16 +20,10 @@
#include "AssemblerLib/VectorMatrixAssembler.h"
#include "BaseLib/ConfigTree.h"
#include "FileIO/VtkIO/VtuInterface.h"
#include "MathLib/LinAlg/SetMatrixSparsity.h"
#include "MeshGeoToolsLib/MeshNodeSearcher.h"
#include "MeshLib/MeshSubset.h"
#include "MeshLib/MeshSubsets.h"
#ifdef USE_PETSC
#include "MeshLib/NodePartitionedMesh.h"
#include "MathLib/LinAlg/PETSc/PETScMatrixOption.h"
#endif
#include "DirichletBc.h"
#include "NeumannBc.h"
#include "NeumannBcAssembler.h"
......@@ -128,44 +122,15 @@ public:
MathLib::MatrixSpecifications getMatrixSpecifications() const override final
{
return { _local_to_global_index_map->dofSize(), _local_to_global_index_map->dofSize() };
}
#if 0
std::size_t getNumEquations() const override final
{
return _local_to_global_index_map->dofSize();
#ifdef USE_PETSC
// TODO for PETSc the method and the interface maybe have to be extended
// this is the old code moved here from th deleted createLinearSolver() method.
MathLib::PETScMatrixOption mat_opt;
const MeshLib::NodePartitionedMesh& pmesh =
static_cast<const MeshLib::NodePartitionedMesh&>(_mesh);
mat_opt.d_nz = pmesh.getMaximumNConnectedNodesToNode();
mat_opt.o_nz = mat_opt.d_nz;
mat_opt.is_global_size = false;
const std::size_t num_unknowns =
_local_to_global_index_map->dofSizeLocal();
_A.reset(_global_setup.createMatrix(num_unknowns, mat_opt));
// In the following two lines, false is assigned to
// the argument of is_global_size, which indicates num_unknowns
// is local.
_x.reset( _global_setup.createVector(num_unknowns,
_local_to_global_index_map->getGhostIndices(), false) );
_rhs.reset( _global_setup.createVector(num_unknowns,
_local_to_global_index_map->getGhostIndices(), false) );
#endif
return { 0u, 0u,
&_sparsity_pattern,
_local_to_global_index_map.get(),
&_mesh };
}
#endif
void assemble(const double t, GlobalVector const& x,
GlobalMatrix& M, GlobalMatrix& K, GlobalVector& b) override final
{
MathLib::setMatrixSparsity(M, _sparsity_pattern);
MathLib::setMatrixSparsity(K, _sparsity_pattern);
assembleConcreteProcess(t, x, M, K, b);
// Call global assembler for each Neumann boundary local assembler.
......@@ -179,8 +144,6 @@ public:
const double dx_dx, GlobalMatrix const& K,
GlobalMatrix& Jac) override final
{
MathLib::setMatrixSparsity(Jac, _sparsity_pattern);
assembleJacobianConcreteProcess(t, x, xdot, dxdot_dx, M, dx_dx, K, Jac);
// TODO In this method one could check if the user wants to use an
......
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