From ddc705287157116e39927428a98e3cdfa89a1524 Mon Sep 17 00:00:00 2001 From: Bruno Seny <bruno.seny@student.uclouvain.be> Date: Tue, 24 Nov 2009 10:59:40 +0000 Subject: [PATCH] update in Solver --- Solver/dgAlgorithm.cpp | 18 +++++++++--------- Solver/dgAlgorithm.h | 5 +---- Solver/dgMainTest.cpp | 6 ++---- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Solver/dgAlgorithm.cpp b/Solver/dgAlgorithm.cpp index 9edb3a4ca5..5aaaf3e1de 100644 --- a/Solver/dgAlgorithm.cpp +++ b/Solver/dgAlgorithm.cpp @@ -163,7 +163,6 @@ void dgAlgorithm::multAddInverseMassMatrix ( /*dofManager &dof,*/ const dgGroupOfElements & group, fullMatrix<double> &residu, fullMatrix<double> &sol) - { for(int i=0;i<group.getNbElements();i++) { fullMatrix<double> residuEl(residu,i,1); @@ -172,14 +171,15 @@ void dgAlgorithm::multAddInverseMassMatrix ( /*dofManager &dof,*/ } } - void dgAlgorithm::rungeKutta (const dgConservationLaw &claw, // conservation law - std::vector<dgGroupOfElements*> &eGroups, //group of elements - std::vector<dgGroupOfFaces*> &fGroups, // group of interfacs - std::vector<dgGroupOfFaces*> &bGroups, // group of boundaries - double h, - fullMatrix<double> &residu, - fullMatrix<double> &sol, - int orderRK) + void dgAlgorithm::rungeKutta ( + const dgConservationLaw &claw, // conservation law + std::vector<dgGroupOfElements*> &eGroups, // group of elements + std::vector<dgGroupOfFaces*> &fGroups, // group of interfacs + std::vector<dgGroupOfFaces*> &bGroups, // group of boundaries + double h, // time-step + fullMatrix<double> &residu, + fullMatrix<double> &sol, + int orderRK) // order of RK integrator { diff --git a/Solver/dgAlgorithm.h b/Solver/dgAlgorithm.h index 91061c7ef3..4d1c81bb08 100644 --- a/Solver/dgAlgorithm.h +++ b/Solver/dgAlgorithm.h @@ -34,13 +34,11 @@ class dgAlgorithm { std::vector<dgGroupOfFaces*> &bGroups, // group of boundaries const fullMatrix<double> &solution, // solution !! at faces nodes fullMatrix<double> &residual // residual !! at faces nodes - ); - + ); void multAddInverseMassMatrix ( /*dofManager &dof,*/ const dgGroupOfElements & group, fullMatrix<double> &residu, fullMatrix<double> &sol); - void rungeKutta ( const dgConservationLaw &claw, std::vector<dgGroupOfElements*> &eGroups, //group of elements @@ -50,7 +48,6 @@ class dgAlgorithm { fullMatrix<double> &residu, fullMatrix<double> &sol, int orderRK=4); - void buildGroups(GModel *model, int dim, int order, std::vector<dgGroupOfElements*> &eGroups, std::vector<dgGroupOfFaces*> &fGroups, diff --git a/Solver/dgMainTest.cpp b/Solver/dgMainTest.cpp index 03f4ee006d..3b8fc082c8 100644 --- a/Solver/dgMainTest.cpp +++ b/Solver/dgMainTest.cpp @@ -82,17 +82,15 @@ int main(int argc, char **argv){ print("output/init.pos",*elementGroups[0],&sol(0,0)); for(int iT=0; iT<1000; iT++) { - algo.residual(*law,elementGroups,faceGroups,boundaryGroups,sol,residu); + algo.residual(*law,elementGroups,faceGroups,boundaryGroups,sol,residu); algo.rungeKutta(*law,elementGroups,faceGroups,boundaryGroups,0.01,residu,sol); if(iT%10==0){ - char name[10]; + char name[100]; sprintf(name,"output/test_%05i.pos",iT/10); printf("%i\n",iT); print(name,*elementGroups[0],&sol(0,0)); - } } - delete law; } -- GitLab