Commit 6152d552 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts Committed by Valentin Vallaeys
Browse files

slim3d: do not fill sparsity pattern for vert face

parent c7210b0a
......@@ -27,9 +27,9 @@ class dgDofManager {
const dgGroupCollection *_groups;
linearSystemBase *_lsysBase;
dgDofManager (const dgGroupCollection *groups);
virtual void finalizeSparsity() {};
bool _needSparsityFill, _assembleZeros;
public:
virtual void finalizeSparsity() {};
virtual void clawSparsityFill(bool needSparsityFill){Msg::Fatal("Claw sparsity fill unsupported for this type of linear system");};
virtual int nField(const dgGroupOfElements &group) const = 0;
......
......@@ -118,6 +118,27 @@ class slim3dTracerSolver {
dgDofManager *_dof;
linearSystem<fullMatrix<double> > *_sys;
dgDofContainer &_c, _MCOld;
void _fillDofSparsity() {
const dgGroupCollection *groups = _c.getGroups();
for (int iGroup = 0; iGroup < groups->getNbElementGroups(); iGroup++) {
dgGroupOfElements *group = groups->getElementGroup(iGroup);
for (size_t iElement = 0 ; iElement < group->getNbElements(); iElement++) {
_dof->insertInSparsityPattern(iGroup, iElement, iGroup, iElement);
}
}
for (int iFG = 0; iFG < groups->getNbFaceGroups(); iFG++) {
dgGroupOfFaces *group = groups->getFaceGroup(iFG);
if(group->nConnection() != 2 || group->orientationTag() == dgGroupOfFaces::ORIENTATION_VERTICAL)
continue;
int iGroup = groups->getElementGroupId(&group->elementGroup(0));
int jGroup = groups->getElementGroupId(&group->elementGroup(1));
for (size_t iFace = 0 ; iFace < group->size(); iFace++) {
_dof->insertInSparsityPattern(iGroup, group->elementId(iFace, 0), jGroup, group->elementId(iFace, 1));
_dof->insertInSparsityPattern(iGroup, group->elementId(iFace, 1), jGroup, group->elementId(iFace, 0));
}
}
_dof->finalizeSparsity();
}
public :
slim3dTracerSolver(dgConservationLawSW3dTracer &law, dgDofContainer &c, bool implicitVertical, bool applyLimiter): _implicitVertical(implicitVertical), _applyLimiter(applyLimiter), _law(law), _c(c),_MCOld(*_c.getGroups(), 1){
if (_implicitVertical){
......@@ -125,6 +146,7 @@ class slim3dTracerSolver {
_sys = new linearSystemPETSc<fullMatrix<double> >();
//_sys->setParameter("petsc_solver_options", "-pc_type lu");
_dof = dgDofManager::newDGBlock (_c.getGroups(), 1, _sys);
_fillDofSparsity();
}
};
~slim3dTracerSolver() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment