From c8cf1ae4a3aaf2dcab28c094d1b1db2197633da8 Mon Sep 17 00:00:00 2001 From: eaulisa Date: Wed, 25 Feb 2015 16:52:52 -0600 Subject: [PATCH 01/91] fixed the restriction operator in FSI --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 19 +++++++++------- .../MonolithicFSINonLinearImplicitSystem.cpp | 14 +++++++----- src/fe/ElemType.cpp | 20 ++++++++++++----- src/fe/ElemType.hpp | 3 ++- src/solution/GMVWriter.cpp | 2 +- src/solution/MultiLevelSolution.cpp | 22 +++++++++++++++---- src/solution/MultiLevelSolution.hpp | 7 +++++- 7 files changed, 62 insertions(+), 25 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 262b45a36..98f16f92e 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -39,9 +39,9 @@ int main(int argc,char **args) { /// Init Petsc-MPI communicator FemusInit mpinit(argc,args,MPI_COMM_WORLD); - Files files; - files.CheckIODirectories(); - files.RedirectCout(); + //Files files; + //files.CheckIODirectories(); + //files.RedirectCout(); unsigned simulation; bool dimension2D; @@ -225,13 +225,16 @@ int main(int argc,char **args) { //Start System Variables ml_sol.AddSolution("DX",LAGRANGE,SECOND,1); ml_sol.AddSolution("DY",LAGRANGE,SECOND,1); - if (!dimension2D) ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); - ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line - ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line - if (!dimension2D) ml_sol.AssociatePropertyToSolution("DZ","Displacement"); // Add this line + //ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); + //if (!dimension2D) ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); ml_sol.AddSolution("U",LAGRANGE,SECOND,1); ml_sol.AddSolution("V",LAGRANGE,SECOND,1); if (!dimension2D) ml_sol.AddSolution("W",LAGRANGE,SECOND,1); + // Pair each dispacement varible with the corresponding velocity variable + ml_sol.AssociatePropertyToSolution("U","Displacement","DX"); // Add this line + ml_sol.AssociatePropertyToSolution("V","Displacement","DY"); // Add this line + if (!dimension2D) ml_sol.AssociatePropertyToSolution("W","Displacement","DZ"); // Add this line + // Since the Pressure is a Lagrange multiplier it is used as an implicit variable ml_sol.AddSolution("P",DISCONTINOUS_POLYNOMIAL,FIRST,1); //ml_sol.AddSolution("P",LAGRANGE,FIRST,1); @@ -393,7 +396,7 @@ int main(int argc,char **args) { if (!dimension2D) print_vars.push_back("W"); print_vars.push_back("P"); - ml_sol.GetWriter()->write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + ml_sol.GetWriter()->write_system_solutions(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // Destroy all the new systems ml_prob.clear(); diff --git a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp index 8f0cbce2d..380b76116 100644 --- a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp +++ b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp @@ -154,11 +154,15 @@ void MonolithicFSINonLinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf for (unsigned k=0; k<_SolSystemPdeIndex.size(); k++) { unsigned SolIndex=_SolSystemPdeIndex[k]; - unsigned SolType = _ml_sol->GetSolutionType(SolIndex); + unsigned solPairIndex=_ml_sol->GetSolPairIndex(k); + unsigned SolType = _ml_sol->GetSolutionType(SolIndex); + unsigned solPairPdeIndex = GetSolPdeIndex( _ml_sol->GetSolutionName(solPairIndex) ); + + //bool TestDisp=0; //if(_ml_sol->TestIfSolutionIsDisplacemenet(SolIndex) ) TestDisp=1; - bool TestDisp=1; - if(_ml_sol->TestIfSolutionIsPressure(SolIndex) ) TestDisp=0; + bool testIfPressure=0; + if(_ml_sol->TestIfSolutionIsPressure(SolIndex) ) testIfPressure=1; // loop on the coarse grid @@ -169,8 +173,8 @@ void MonolithicFSINonLinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - if(TestDisp){ - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildRestrictionTranspose(*LinSolf,*LinSolc,iel,RRt,SolIndex,k,TestDisp); + if(!testIfPressure){ + _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildRestrictionTranspose(*LinSolf,*LinSolc,iel,RRt,SolIndex,k,solPairIndex,solPairPdeIndex); } else{ _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel, RRt,SolIndex,k); diff --git a/src/fe/ElemType.cpp b/src/fe/ElemType.cpp index ffaeb43a4..dca4f9b79 100644 --- a/src/fe/ElemType.cpp +++ b/src/fe/ElemType.cpp @@ -198,7 +198,9 @@ void elem_type::GetSparsityPatternSize(const LinearEquation &lspdef,const Linear } void elem_type::BuildRestrictionTranspose(const LinearEquation &lspdef,const LinearEquation &lspdec, const int& ielc, SparseMatrix* Projmat, - const unsigned &index_sol, const unsigned &kkindex_sol, const bool &TestDisp) const { + const unsigned &index_sol, const unsigned &kkindex_sol, + const unsigned &index_pair_sol, const unsigned &kkindex_pair_sol) const{ + vector cols(27); bool fluid_region = (2==lspdec._msh->el->GetElementMaterial(ielc))?1:0; @@ -220,12 +222,20 @@ void elem_type::BuildRestrictionTranspose(const LinearEquation &lspdef,const Lin for (int k=0; kel->GetMeshDof(ielc,j,_SolType); - int jcolumn=lspdec.GetKKDof(index_sol,kkindex_sol,jadd); - cols[k]=jcolumn; - bool jsolidmark=lspdef._msh->el->GetNodeRegion(jadd); + if(isolidmark == jsolidmark){ + int jcolumn=lspdec.GetKKDof(index_sol,kkindex_sol,jadd); + cols[k]=jcolumn; + copy_prol_val[k]=_prol_val[i][k]; + } + else { + int jcolumn=lspdec.GetKKDof(index_pair_sol,kkindex_pair_sol,jadd); + cols[k]=jcolumn; + copy_prol_val[k]=(index_sol != index_pair_sol) ? _prol_val[i][k]:0.; + } + - copy_prol_val[k]=(!TestDisp || !fluid_region || isolidmark==jsolidmark)?_prol_val[i][k]:0.; + //copy_prol_val[k]=(!fluid_region || isolidmark==jsolidmark)?_prol_val[i][k]:0.; } Projmat->insert_row(irow,ncols,cols,©_prol_val[0]); } diff --git a/src/fe/ElemType.hpp b/src/fe/ElemType.hpp index 7f2d20f69..3e2f1f58c 100644 --- a/src/fe/ElemType.hpp +++ b/src/fe/ElemType.hpp @@ -56,7 +56,8 @@ class elem_type { /** To be Added */ void BuildRestrictionTranspose(const LinearEquation &lspdef,const LinearEquation &lspdec, const int& ielc, SparseMatrix* Projmat, - const unsigned &index_sol, const unsigned &kkindex_sol, const bool &TestDisp) const; + const unsigned &index_sol, const unsigned &kkindex_sol, + const unsigned &index_pair_sol, const unsigned &kkindex_pair_sol) const; /** To be Added */ void BuildProlongation(const Mesh &meshf, const Mesh &meshc, const int& ielc, SparseMatrix* Projmat) const; diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index e82b57942..6a6d5d388 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -107,7 +107,7 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { unsigned indDXDYDZ=_ml_sol.GetIndex(_moving_vars[i].c_str()); Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],*_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)][ig]); Mysol[ig]->localize_to_one(v_local,0); diff --git a/src/solution/MultiLevelSolution.cpp b/src/solution/MultiLevelSolution.cpp index b260b42eb..df29647d2 100644 --- a/src/solution/MultiLevelSolution.cpp +++ b/src/solution/MultiLevelSolution.cpp @@ -110,7 +110,9 @@ void MultiLevelSolution::AddSolution(const char name[], const FEFamily fefamily, _PdeType.resize(n+1u); _TestIfPressure.resize(n+1u); _TestIfDisplacement.resize(n+1u); - + _SolPairIndex.resize(n+1u); + + _TestIfDisplacement[n]=0; _TestIfPressure[n]=0; _family[n] = fefamily; @@ -121,7 +123,8 @@ void MultiLevelSolution::AddSolution(const char name[], const FEFamily fefamily, strcpy(_SolName[n],name); _SolTmorder[n]=tmorder; _PdeType[n]=PdeType; - + _SolPairIndex[n]=n; + cout << " Add variable " << std::setw(3) << _SolName[n] << " discretized with FE type " << std::setw(12) << order << " and time discretzation order " << tmorder << endl; @@ -132,10 +135,21 @@ void MultiLevelSolution::AddSolution(const char name[], const FEFamily fefamily, } //--------------------------------------------------------------------------------------------------- -void MultiLevelSolution::AssociatePropertyToSolution(const char solution_name[], const char solution_property[]){ +void MultiLevelSolution::AssociatePropertyToSolution(const char solution_name[], const char solution_property[], const char solution_pair[]){ unsigned index=GetIndex(solution_name); if( !strcmp(solution_property,"pressure") || !strcmp(solution_property,"Pressure") ) _TestIfPressure[index]=1; - else if( !strcmp(solution_property,"displacement") || !strcmp(solution_property,"Displacement") ) _TestIfDisplacement[index]=1; + else if( !strcmp(solution_property,"displacement") || !strcmp(solution_property,"Displacement") ) { + _TestIfDisplacement[index]=1; + if( solution_pair != NULL){ + unsigned indexPair=GetIndex(solution_pair); + _SolPairIndex[index]=indexPair; + } + else{ + std::cout<<"In function AssociatePropertyToSolution(\"disp\",\"Displacement\",\"Vel\")\n" + <<"pair each Displacement type variable, disp, to a Velocity type variable, vel"< _PdeType; vector _TestIfPressure; vector _TestIfDisplacement; + vector _SolPairIndex; /** Multilevel solution writer */ Writer* _writer; From a067197111085f8c0797e578029e2b2d450eb5f3 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Mon, 2 Mar 2015 07:32:46 -0600 Subject: [PATCH 02/91] trying multiple declarartions in Ex2, vtk not working --- .../NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index ac0b0e406..5eca3c1b3 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -48,22 +48,26 @@ int main(int argc, char **args) { // print mesh info mlMsh.PrintInfo(); + + for(unsigned i=0;i<2;i++){ // define the multilevel solution and attach the mlMsh object to it - MultiLevelSolution mlSol(&mlMsh); + MultiLevelSolution *mlSol; + mlSol=new MultiLevelSolution(&mlMsh); // add variables to mlSol - mlSol.AddSolution("u",LAGRANGE, FIRST); - mlSol.Initialize("All"); + mlSol->AddSolution("u",LAGRANGE, FIRST); + mlSol->Initialize("All"); // attach the boundary condition function and generate boundary data - mlSol.AttachSetBoundaryConditionFunction(SetBoundaryCondition); - mlSol.GenerateBdc("u"); + mlSol->AttachSetBoundaryConditionFunction(SetBoundaryCondition); + mlSol->GenerateBdc("u"); // define the multilevel problem attach the mlSol object to it - MultiLevelProblem mlProb(&mlSol); + MultiLevelProblem *mlProb; + mlProb = new MultiLevelProblem(mlSol); // add system Poisson in mlProb as a Linear Implicit System - LinearImplicitSystem & system = mlProb.add_system < LinearImplicitSystem > ("Poisson"); + LinearImplicitSystem & system = mlProb->add_system < LinearImplicitSystem > ("Poisson"); // add solution "u" to system system.AddSolutionToSystemPDE("u"); @@ -79,13 +83,19 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + VTKWriter *vtkIO; + vtkIO = new VTKWriter(*mlSol); + vtkIO->write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); - gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); +// GMVWriter gmvIO(*mlSol); +// gmvIO.SetDebugOutput(true); +// gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + delete vtkIO; + delete mlProb; + delete mlSol; + } + return 0; } From 3ef0ea4d1a4abfb5a53d8d19c2502e82c39240ec Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Mon, 2 Mar 2015 07:44:06 -0600 Subject: [PATCH 03/91] trying multiple declarartions in Ex2, working --- src/solution/Writer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/solution/Writer.cpp b/src/solution/Writer.cpp index 278cdd951..ce43aacb5 100644 --- a/src/solution/Writer.cpp +++ b/src/solution/Writer.cpp @@ -52,15 +52,17 @@ Writer::Writer(MultiLevelSolution& ml_sol): Writer::~Writer() { - for (int igridn=0; igridn<_gridn; igridn++) { + for (int itype=0; itype<3; itype++) { for (int jtype=0; jtype<3; jtype++) { - if(_ProlQitoQj[itype][jtype][igridn]) - { - delete _ProlQitoQj[itype][jtype][igridn]; - _ProlQitoQj[itype][jtype][igridn] = NULL; + for (int igridn=0; igridn<_gridn; igridn++) { + if(_ProlQitoQj[itype][jtype][igridn]) + { + delete _ProlQitoQj[itype][jtype][igridn]; + _ProlQitoQj[itype][jtype][igridn] = NULL; + } } - } + _ProlQitoQj[itype][jtype].resize(0); } } From 855585047fa827f8c429723fef09c03b46247494 Mon Sep 17 00:00:00 2001 From: eaulisa Date: Mon, 2 Mar 2015 08:36:33 -0600 Subject: [PATCH 04/91] a few changes to fix the projection matrix in FSI --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 8 ++-- .../FSI/FSITimeDependentBenchmarks/main.cpp | 8 +++- applications/FSI/FSI_TUREK_3/main.cpp | 8 +++- .../MonolithicFSINonLinearImplicitSystem.cpp | 2 +- src/solution/MultiLevelSolution.cpp | 37 +++++++++++-------- src/solution/MultiLevelSolution.hpp | 12 +++--- unittests/testFSISteady/main.cpp | 5 ++- 7 files changed, 46 insertions(+), 34 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 98f16f92e..19ea18324 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -230,10 +230,10 @@ int main(int argc,char **args) { ml_sol.AddSolution("U",LAGRANGE,SECOND,1); ml_sol.AddSolution("V",LAGRANGE,SECOND,1); if (!dimension2D) ml_sol.AddSolution("W",LAGRANGE,SECOND,1); - // Pair each dispacement varible with the corresponding velocity variable - ml_sol.AssociatePropertyToSolution("U","Displacement","DX"); // Add this line - ml_sol.AssociatePropertyToSolution("V","Displacement","DY"); // Add this line - if (!dimension2D) ml_sol.AssociatePropertyToSolution("W","Displacement","DZ"); // Add this line + // Pair each velocity varible with the corresponding displacement variable + ml_sol.PairSolution("U","DX"); // Add this line + ml_sol.PairSolution("V","DY"); // Add this line + if (!dimension2D) ml_sol.PairSolution("W","DZ"); // Add this line // Since the Pressure is a Lagrange multiplier it is used as an implicit variable ml_sol.AddSolution("P",DISCONTINOUS_POLYNOMIAL,FIRST,1); diff --git a/applications/FSI/FSITimeDependentBenchmarks/main.cpp b/applications/FSI/FSITimeDependentBenchmarks/main.cpp index a66e91bba..c0c6c317f 100644 --- a/applications/FSI/FSITimeDependentBenchmarks/main.cpp +++ b/applications/FSI/FSITimeDependentBenchmarks/main.cpp @@ -97,10 +97,14 @@ int main(int argc,char **args) { //Start System Variables ml_sol.AddSolution("DX",LAGRANGE,SECOND,1); ml_sol.AddSolution("DY",LAGRANGE,SECOND,1); - ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line - ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line ml_sol.AddSolution("U",LAGRANGE,SECOND,1); ml_sol.AddSolution("V",LAGRANGE,SECOND,1); + +// ml_sol.PairSolution("U","DX"); // Add this line +// ml_sol.PairSolution("V","DY"); // Add this line + // Since the Pressure is a Lagrange multiplier it is used as an implicit variable ml_sol.AddSolution("P",DISCONTINOUS_POLYNOMIAL,FIRST,1); ml_sol.AssociatePropertyToSolution("P","Pressure"); // Add this line diff --git a/applications/FSI/FSI_TUREK_3/main.cpp b/applications/FSI/FSI_TUREK_3/main.cpp index a1aec14b5..b236229b1 100644 --- a/applications/FSI/FSI_TUREK_3/main.cpp +++ b/applications/FSI/FSI_TUREK_3/main.cpp @@ -62,10 +62,14 @@ int main(int argc,char **args) { //Start System Variables ml_sol.AddSolution("DX",LAGRANGE,SECOND,2); ml_sol.AddSolution("DY",LAGRANGE,SECOND,2); - ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line - ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line ml_sol.AddSolution("U",LAGRANGE,SECOND,2); ml_sol.AddSolution("V",LAGRANGE,SECOND,2); + + // ml_sol.PairSolution("U","DX"); // Add this line + // ml_sol.PairSolution("V","DY"); // Add this line + ml_sol.AddSolution("AX",LAGRANGE,SECOND,1,0); ml_sol.AddSolution("AY",LAGRANGE,SECOND,1,0); // Since the Pressure is a Lagrange multiplier it is used as an implicit variable diff --git a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp index 380b76116..744f023aa 100644 --- a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp +++ b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp @@ -154,7 +154,7 @@ void MonolithicFSINonLinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf for (unsigned k=0; k<_SolSystemPdeIndex.size(); k++) { unsigned SolIndex=_SolSystemPdeIndex[k]; - unsigned solPairIndex=_ml_sol->GetSolPairIndex(k); + unsigned solPairIndex=_ml_sol->GetSolutionPairIndex(k); unsigned SolType = _ml_sol->GetSolutionType(SolIndex); unsigned solPairPdeIndex = GetSolPdeIndex( _ml_sol->GetSolutionName(solPairIndex) ); diff --git a/src/solution/MultiLevelSolution.cpp b/src/solution/MultiLevelSolution.cpp index df29647d2..5fa1a9913 100644 --- a/src/solution/MultiLevelSolution.cpp +++ b/src/solution/MultiLevelSolution.cpp @@ -109,11 +109,9 @@ void MultiLevelSolution::AddSolution(const char name[], const FEFamily fefamily, _SolTmorder.resize(n+1u); _PdeType.resize(n+1u); _TestIfPressure.resize(n+1u); - _TestIfDisplacement.resize(n+1u); _SolPairIndex.resize(n+1u); - _TestIfDisplacement[n]=0; _TestIfPressure[n]=0; _family[n] = fefamily; _order[n] = order; @@ -135,24 +133,11 @@ void MultiLevelSolution::AddSolution(const char name[], const FEFamily fefamily, } //--------------------------------------------------------------------------------------------------- -void MultiLevelSolution::AssociatePropertyToSolution(const char solution_name[], const char solution_property[], const char solution_pair[]){ +void MultiLevelSolution::AssociatePropertyToSolution(const char solution_name[], const char solution_property[]){ unsigned index=GetIndex(solution_name); if( !strcmp(solution_property,"pressure") || !strcmp(solution_property,"Pressure") ) _TestIfPressure[index]=1; - else if( !strcmp(solution_property,"displacement") || !strcmp(solution_property,"Displacement") ) { - _TestIfDisplacement[index]=1; - if( solution_pair != NULL){ - unsigned indexPair=GetIndex(solution_pair); - _SolPairIndex[index]=indexPair; - } - else{ - std::cout<<"In function AssociatePropertyToSolution(\"disp\",\"Displacement\",\"Vel\")\n" - <<"pair each Displacement type variable, disp, to a Velocity type variable, vel"< _SolTmorder; vector _PdeType; vector _TestIfPressure; - vector _TestIfDisplacement; vector _SolPairIndex; /** Multilevel solution writer */ diff --git a/unittests/testFSISteady/main.cpp b/unittests/testFSISteady/main.cpp index b18d180e4..9082d51b5 100644 --- a/unittests/testFSISteady/main.cpp +++ b/unittests/testFSISteady/main.cpp @@ -58,10 +58,11 @@ int main(int argc,char **args) { //Start System Variables ml_sol.AddSolution("DX",LAGRANGE,SECOND,1); ml_sol.AddSolution("DY",LAGRANGE,SECOND,1); - ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line - ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DX","Displacement"); // Add this line +// ml_sol.AssociatePropertyToSolution("DY","Displacement"); // Add this line ml_sol.AddSolution("U",LAGRANGE,SECOND,1); ml_sol.AddSolution("V",LAGRANGE,SECOND,1); + // Since the Pressure is a Lagrange multiplier it is used as an implicit variable ml_sol.AddSolution("P",DISCONTINOUS_POLYNOMIAL,FIRST,1); ml_sol.AssociatePropertyToSolution("P","Pressure"); // Add this line From 20a52b62146b3afb62f624f850425866a2de5bbf Mon Sep 17 00:00:00 2001 From: eaulisa Date: Mon, 2 Mar 2015 11:37:28 -0600 Subject: [PATCH 05/91] added prol in mesh not working --- src/mesh/Mesh.cpp | 96 +++++++++++++++++++++++++++++++++++-- src/mesh/Mesh.hpp | 11 +++-- src/mesh/MeshRefinement.cpp | 2 + src/mesh/MultiLevelMesh.cpp | 19 ++++---- 4 files changed, 113 insertions(+), 15 deletions(-) diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 9db94cbc1..5ab449713 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -53,6 +53,15 @@ Mesh::~Mesh(){ delete _coordinate; delete [] epart; delete [] npart; + + for (int itype=0; itype<3; itype++) { + for (int jtype=0; jtype<3; jtype++) { + delete _ProlQitoQj[itype][jtype]; + _ProlQitoQj[itype][jtype] = NULL; + } + } + + } /// print Mesh info @@ -67,8 +76,10 @@ void Mesh::PrintInfo() { /** * This function generates the coarse Mesh level, $l_0$, from an input Mesh file (Now only the Gambit Neutral File) **/ -void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vector &type_elem_flag) { - +void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vector &type_elem_flag, const elem_type *otherFiniteElement[6][5]) { + + SetFiniteElementPtr(otherFiniteElement); + vector > coords(3); _grid=0; @@ -128,7 +139,9 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto _coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); _coordinate->ResizeSolutionVector("AMR"); - + + BuildLagrangeProlongatorMatrices(); + }; /** @@ -139,7 +152,10 @@ void Mesh::GenerateCoarseBoxMesh( const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax, - const ElemType type, std::vector &type_elem_flag) { + const ElemType type, std::vector &type_elem_flag, + const elem_type *otherFiniteElement[6][5]) { + + SetFiniteElementPtr(otherFiniteElement); vector > coords(3); @@ -185,6 +201,8 @@ void Mesh::GenerateCoarseBoxMesh( _coordinate->ResizeSolutionVector("AMR"); + BuildLagrangeProlongatorMatrices(); + } @@ -640,6 +658,76 @@ void Mesh::FillISvector() { } + + +void Mesh::BuildLagrangeProlongatorMatrices(){ + + for(int itype=0;itype<3;itype++){ + int ni = MetisOffset[itype][_nprocs]; + int ni_loc = own_size[itype][_iproc]; + for (int jtype=0; jtype<3; jtype++) { + int nj = MetisOffset[jtype][_nprocs]; + int nj_loc = own_size[itype][_iproc]; + + NumericVector *NNZ_d = NumericVector::build().release(); + NumericVector *NNZ_o = NumericVector::build().release(); + if(_nprocs==1) { // IF SERIAL + NNZ_d->init(ni,ni_loc,false,SERIAL); + NNZ_o->init(ni,ni_loc,false,SERIAL); + } + else{ + NNZ_d->init(ni,ni_loc,false,PARALLEL); + NNZ_o->init(ni,ni_loc,false,PARALLEL); + } + NNZ_d->zero(); + NNZ_o->zero(); + + for(int isdom=_iproc; isdom<_iproc+1; isdom++) { + for (int iel_mts=IS_Mts2Gmt_elem_offset[isdom];iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ + unsigned iel = IS_Mts2Gmt_elem[iel_mts]; + short unsigned ielt= el->GetElementType(iel); + _finiteElement[ielt][jtype]->GetSparsityPatternSize(*this, iel, NNZ_d, NNZ_o, itype); + } + } + + NNZ_d->close(); + NNZ_o->close(); + + unsigned offset = MetisOffset[itype][_iproc]; + + vector nnz_d(ni_loc); + vector nnz_o(ni_loc); + for(int i=0; i ((*NNZ_d)(offset+i)); + nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); + } + + delete NNZ_d; + delete NNZ_o; + + _ProlQitoQj[itype][jtype] = SparseMatrix::build().release(); + _ProlQitoQj[itype][jtype]->init(ni,nj, own_size[itype][_iproc], own_size[jtype][_iproc],nnz_d,nnz_o); + for(int isdom=_iproc; isdom<_iproc+1; isdom++) { + for (int iel_mts=IS_Mts2Gmt_elem_offset[isdom];iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ + unsigned iel = IS_Mts2Gmt_elem[iel_mts]; + short unsigned ielt=el->GetElementType(iel); + _finiteElement[ielt][jtype]->BuildProlongation(*this, iel, _ProlQitoQj[itype][jtype], itype); + } + } + _ProlQitoQj[itype][jtype]->close(); + } + } +} + + + + + + + + + + } //end namespace femus diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 6a8f5e712..56ed534bf 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -124,7 +124,8 @@ class Mesh : public ParallelObject { /** Generate mesh functions */ /** This function generates the coarse mesh level, $l_0$, from an input mesh file */ - void ReadCoarseMesh(const std::string& name, const double Lref, std::vector &_finiteElement_flag); + void ReadCoarseMesh(const std::string& name, const double Lref, std::vector &_finiteElement_flag, + const elem_type *otherFiniteElement[6][5]); /** This function generates a coarse box mesh */ void GenerateCoarseBoxMesh(const unsigned int nx, @@ -133,7 +134,8 @@ class Mesh : public ParallelObject { const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax, - const ElemType type, std::vector &type_elem_flag); + const ElemType type, std::vector &type_elem_flag, + const elem_type *otherFiniteElement[6][5]); /** To be added */ @@ -165,7 +167,10 @@ class Mesh : public ParallelObject { static bool _TestSetRefinementFlag; std::map _boundaryinfo; - + SparseMatrix* _ProlQitoQj[3][3]; + void BuildLagrangeProlongatorMatrices(); + + private: /** To be added */ diff --git a/src/mesh/MeshRefinement.cpp b/src/mesh/MeshRefinement.cpp index 2e652fed6..b879061b6 100644 --- a/src/mesh/MeshRefinement.cpp +++ b/src/mesh/MeshRefinement.cpp @@ -297,6 +297,8 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t _mesh._coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); _mesh._coordinate->ResizeSolutionVector("AMR"); + + _mesh.BuildLagrangeProlongatorMatrices(); //build projection Matrix unsigned thisSolType=2; diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index 66004c90c..aafe9d21b 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -116,12 +116,14 @@ MultiLevelMesh::MultiLevelMesh(const unsigned short &igridn,const unsigned short _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); + BuildElemType(GaussOrder); + //coarse mesh _level0[0] = new Mesh(); std::cout << " Reading corse mesh from file: " << mesh_file << std::endl; - _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag); + _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag,_finiteElement); + - BuildElemType(GaussOrder); //totally refined meshes for (unsigned i=1; i<_gridr0; i++) { @@ -180,12 +182,13 @@ void MultiLevelMesh::ReadCoarseMesh(const char mesh_file[], const char GaussOrde _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); + BuildElemType(GaussOrder); + //coarse mesh _level0[0] = new Mesh(); std::cout << " Reading corse mesh from file: " << mesh_file << std::endl; - _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag); + _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag,_finiteElement); - BuildElemType(GaussOrder); _gridn=_gridn0; _gridr=_gridr0; @@ -207,14 +210,14 @@ void MultiLevelMesh::GenerateCoarseBoxMesh( _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); + BuildElemType(GaussOrder); + //coarse mesh _level0[0] = new Mesh(); std::cout << " Building brick mesh using the built-in mesh generator" << std::endl; - _level0[0]->GenerateCoarseBoxMesh(nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,_finiteElementGeometryFlag); - - BuildElemType(GaussOrder); - + _level0[0]->GenerateCoarseBoxMesh(nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,_finiteElementGeometryFlag,_finiteElement); + _gridn=_gridn0; _gridr=_gridr0; _level.resize(_gridn); From b2b8aa99f40c58f5e10f43a8a70e2f3c00f845ab Mon Sep 17 00:00:00 2001 From: Sureka Pathmanathan Date: Mon, 2 Mar 2015 14:34:41 -0600 Subject: [PATCH 06/91] Setup new testSalomeIO --- unittests/CMakeLists.txt | 6 ++---- unittests/testSalomeIO/CMakeLists.txt | 12 ++++++++++++ unittests/testSalomeIO/input/Mesh_1.med | Bin 0 -> 9637 bytes unittests/testSalomeIO/testSalomeIO.cpp | 25 ++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 unittests/testSalomeIO/CMakeLists.txt create mode 100644 unittests/testSalomeIO/input/Mesh_1.med create mode 100644 unittests/testSalomeIO/testSalomeIO.cpp diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index b266729a5..9ecf0b06a 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -3,9 +3,7 @@ ############################################################################################# ADD_SUBDIRECTORY(testNSSteadyDD/) -# FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/unittests/testNSSteadyDD/input/) -# FILE(COPY testNSSteadyDD/input/ DESTINATION ${PROJECT_BINARY_DIR}/unittests/testNSSteadyDD/input/) ADD_SUBDIRECTORY(testFSISteady/) -# FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/unittests/testFSISteady/input/) -# FILE(COPY testFSISteady/input/ DESTINATION ${PROJECT_BINARY_DIR}/unittests/testFSISteady/input/) \ No newline at end of file + +ADD_SUBDIRECTORY(testSalomeIO/) diff --git a/unittests/testSalomeIO/CMakeLists.txt b/unittests/testSalomeIO/CMakeLists.txt new file mode 100644 index 000000000..f6fb0d3fc --- /dev/null +++ b/unittests/testSalomeIO/CMakeLists.txt @@ -0,0 +1,12 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +get_filename_component(APP_FOLDER_NAME ${CMAKE_CURRENT_LIST_DIR} NAME) +set(THIS_APPLICATION ${APP_FOLDER_NAME}) + +PROJECT(${THIS_APPLICATION}) + +INCLUDE(CTest) + +ADD_TEST(NAME ${THIS_APPLICATION} COMMAND ${THIS_APPLICATION}) + +femusMacroBuildApplication(${THIS_APPLICATION} ${THIS_APPLICATION}) \ No newline at end of file diff --git a/unittests/testSalomeIO/input/Mesh_1.med b/unittests/testSalomeIO/input/Mesh_1.med new file mode 100644 index 0000000000000000000000000000000000000000..130be0df20a78daa5f8a38dca2463717b3900a05 GIT binary patch literal 9637 zcmeGhTWB0r^vrH|^V&9POlq6ZnAlbmV>F?uu~2C@yR+F%cV{-UyRz-iB2ANuM65w* zYD1({sz^m?DZ!GDLKX4RkM={vM?NA#@Bu}H8b53)3dLA0`q7{zo-_B}?at2ZgJeTZ z+yk>`=HBzV=iE8x+}T(CUf=5Sx^i1-DF~S7@b(rq(#|IihxS#fey?V0tUvQtH1#@U zt0o%3C~&zABmid}AgT-~J~fi)kri2U2j$2V7wSY#2})!ok_froV@OZnTtlOFpF1*M z&PG7j!0(gj*TXYTYm?4qGpV*3R+-IpH38Uh!bOuIcP~_-Pw*C@5p4Kt$ID0*P)tNb zZXnX+poxf_JvaSvkG1XD-MN-r;|%Q|K9K0BCbI}U3@!3^;^ywpbd#D=qf7U)l-r-f z2E^heI7eOiz z_VE{$%M{W`Sr`tX4hlWNDA!c4KLH5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Ex2.cpp | 6 +- src/mesh/Mesh.cpp | 28 +--- src/mesh/Mesh.hpp | 9 +- src/mesh/MultiLevelMesh.cpp | 30 ++-- src/solution/GMVWriter.cpp | 59 +++---- src/solution/VTKWriter.cpp | 100 ++++++------ src/solution/Writer.cpp | 151 +++--------------- src/solution/Writer.hpp | 36 ++--- src/solution/XDMFWriter.cpp | 6 +- 9 files changed, 150 insertions(+), 275 deletions(-) diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index 5eca3c1b3..e9ed7bfc0 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -87,9 +87,9 @@ int main(int argc, char **args) { vtkIO = new VTKWriter(*mlSol); vtkIO->write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); -// GMVWriter gmvIO(*mlSol); -// gmvIO.SetDebugOutput(true); -// gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + GMVWriter gmvIO(*mlSol); + gmvIO.SetDebugOutput(true); + gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); delete vtkIO; delete mlProb; diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 5ab449713..862c2a3f9 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -76,10 +76,8 @@ void Mesh::PrintInfo() { /** * This function generates the coarse Mesh level, $l_0$, from an input Mesh file (Now only the Gambit Neutral File) **/ -void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vector &type_elem_flag, const elem_type *otherFiniteElement[6][5]) { - - SetFiniteElementPtr(otherFiniteElement); - +void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vector &type_elem_flag) { + vector > coords(3); _grid=0; @@ -139,9 +137,7 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto _coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); _coordinate->ResizeSolutionVector("AMR"); - - BuildLagrangeProlongatorMatrices(); - + }; /** @@ -152,10 +148,7 @@ void Mesh::GenerateCoarseBoxMesh( const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax, - const ElemType type, std::vector &type_elem_flag, - const elem_type *otherFiniteElement[6][5]) { - - SetFiniteElementPtr(otherFiniteElement); + const ElemType type, std::vector &type_elem_flag) { vector > coords(3); @@ -201,8 +194,6 @@ void Mesh::GenerateCoarseBoxMesh( _coordinate->ResizeSolutionVector("AMR"); - BuildLagrangeProlongatorMatrices(); - } @@ -658,8 +649,6 @@ void Mesh::FillISvector() { } - - void Mesh::BuildLagrangeProlongatorMatrices(){ for(int itype=0;itype<3;itype++){ @@ -718,15 +707,6 @@ void Mesh::BuildLagrangeProlongatorMatrices(){ } } } - - - - - - - - - } //end namespace femus diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 56ed534bf..5ffce36b1 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -124,8 +124,7 @@ class Mesh : public ParallelObject { /** Generate mesh functions */ /** This function generates the coarse mesh level, $l_0$, from an input mesh file */ - void ReadCoarseMesh(const std::string& name, const double Lref, std::vector &_finiteElement_flag, - const elem_type *otherFiniteElement[6][5]); + void ReadCoarseMesh(const std::string& name, const double Lref, std::vector &_finiteElement_flag); /** This function generates a coarse box mesh */ void GenerateCoarseBoxMesh(const unsigned int nx, @@ -134,8 +133,7 @@ class Mesh : public ParallelObject { const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax, - const ElemType type, std::vector &type_elem_flag, - const elem_type *otherFiniteElement[6][5]); + const ElemType type, std::vector &type_elem_flag); /** To be added */ @@ -169,8 +167,7 @@ class Mesh : public ParallelObject { SparseMatrix* _ProlQitoQj[3][3]; void BuildLagrangeProlongatorMatrices(); - - + private: /** To be added */ diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index aafe9d21b..28da70480 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -102,28 +102,29 @@ MultiLevelMesh::MultiLevelMesh() { _finiteElement[5][2]=new const elem_type_1D("line","biquadratic",GaussOrder); _finiteElement[5][3]=new const elem_type_1D("line","constant",GaussOrder); _finiteElement[5][4]=new const elem_type_1D("line","disc_linear",GaussOrder); - _level0[0]->SetFiniteElementPtr(_finiteElement); + _level0[0]->SetFiniteElementPtr(_finiteElement); + _level0[0]->BuildLagrangeProlongatorMatrices(); } //--------------------------------------------------------------------------------------------------- -MultiLevelMesh::MultiLevelMesh(const unsigned short &igridn,const unsigned short &igridr, const char mesh_file[], const char GaussOrder[], - const double Lref, bool (* SetRefinementFlag)(const double &x, const double &y, const double &z, - const int &ElemGroupNumber,const int &level)): +MultiLevelMesh::MultiLevelMesh(const unsigned short &igridn,const unsigned short &igridr, + const char mesh_file[], const char GaussOrder[], const double Lref, + bool (* SetRefinementFlag)(const double &x, const double &y, const double &z, + const int &ElemGroupNumber,const int &level) ): _gridn0(igridn), _gridr0(igridr) { + _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); - BuildElemType(GaussOrder); - //coarse mesh _level0[0] = new Mesh(); std::cout << " Reading corse mesh from file: " << mesh_file << std::endl; - _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag,_finiteElement); - + _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag); + BuildElemType(GaussOrder); //totally refined meshes for (unsigned i=1; i<_gridr0; i++) { @@ -182,13 +183,12 @@ void MultiLevelMesh::ReadCoarseMesh(const char mesh_file[], const char GaussOrde _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); - BuildElemType(GaussOrder); - //coarse mesh _level0[0] = new Mesh(); std::cout << " Reading corse mesh from file: " << mesh_file << std::endl; - _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag,_finiteElement); + _level0[0]->ReadCoarseMesh(mesh_file, Lref,_finiteElementGeometryFlag); + BuildElemType(GaussOrder); _gridn=_gridn0; _gridr=_gridr0; @@ -210,14 +210,14 @@ void MultiLevelMesh::GenerateCoarseBoxMesh( _level0.resize(_gridn0); _finiteElementGeometryFlag.resize(5,false); - BuildElemType(GaussOrder); - //coarse mesh _level0[0] = new Mesh(); std::cout << " Building brick mesh using the built-in mesh generator" << std::endl; - _level0[0]->GenerateCoarseBoxMesh(nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,_finiteElementGeometryFlag,_finiteElement); - + _level0[0]->GenerateCoarseBoxMesh(nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,_finiteElementGeometryFlag); + + BuildElemType(GaussOrder); + _gridn=_gridn0; _gridr=_gridr0; _level.resize(_gridn); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 6a6d5d388..cb9bc5fbc 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -43,6 +43,9 @@ GMVWriter::~GMVWriter() void GMVWriter::write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { + + MultiLevelMesh *mlMsh = _ml_sol._ml_msh; + unsigned igridn = _gridn; // aggiunta da me if (igridn==0) igridn=_gridn; @@ -73,7 +76,7 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char unsigned nvt=0; unsigned nvt_max=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; nvt_max=(nvt_max>nvt_ig)?nvt_max:nvt_ig; nvt+=nvt_ig; } @@ -82,7 +85,7 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char vector Mysol(igridn); for(unsigned ig=igridr-1u; ig<_gridn; ig++) { Mysol[ig] = NumericVector::build().release(); - Mysol[ig]->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index][_iproc],true,AUTOMATIC); + Mysol[ig]->init(mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs],mlMsh->GetLevel(ig)->own_size[index][_iproc],true,AUTOMATIC); } // ********** Header ********** @@ -99,19 +102,19 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char for (int i=0; i<3; i++) { for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol._ml_msh->GetLevel(ig)->_coordinate->_Sol[i],*_ProlQitoQj[index][2][ig]); + Mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][2][ig]); vector v_local; Mysol[ig]->localize_to_one(v_local,0); - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { + if (_moving_mesh && mlMsh->GetLevel(0)->GetDimension() > i) { unsigned indDXDYDZ=_ml_sol.GetIndex(_moving_vars[i].c_str()); - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],*_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)][ig]); Mysol[ig]->localize_to_one(v_local,0); - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements() - _ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber()); - nel+=_ml_sol._ml_msh->GetLevel(igridn-1u)->GetNumberOfElements(); + nel+=( mlMsh->GetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); + nel+=mlMsh->GetLevel(igridn-1u)->GetNumberOfElements(); fout.write((char *)&nel,sizeof(unsigned)); unsigned topology[27]; unsigned offset=1; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - short unsigned ielt=_ml_sol._ml_msh->GetLevel(ig)->el->GetElementType(ii); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + short unsigned ielt=mlMsh->GetLevel(ig)->el->GetElementType(ii); if (ielt==0) sprintf(det,"phex%d",eltp[index][0]); else if (ielt==1) sprintf(det,"ptet%d",eltp[index][1]); else if (ielt==2) sprintf(det,"pprism%d",eltp[index][2]); @@ -157,15 +160,15 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char fout.write((char *)&NVE[ielt][index],sizeof(unsigned)); for(unsigned j=0;jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; - unsigned jnode_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(jnode,index); + unsigned jnode=mlMsh->GetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; + unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index); topology[j]=jnode_Metis+offset; } fout.write((char *)topology,sizeof(unsigned)*NVE[ielt][index]); } } - offset+=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index][_nprocs]; + offset+=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; } // ********** End printing cell connectivity ********** @@ -184,9 +187,9 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=_ml_sol._ml_msh->GetLevel(ig)->el->GetElementGroup(ii); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=mlMsh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } } @@ -200,9 +203,9 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=_ml_sol._ml_msh->GetLevel(ig)->epart[ii]; + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=mlMsh->GetLevel(ig)->epart[ii]; icount++; } } @@ -240,16 +243,16 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char fout.write((char *)&one,sizeof(unsigned)); for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i],*_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); } else if (name==1){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i],*_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); } else if (name==2){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i],*_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); } else{ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i],*_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); } std::vector v_local; Mysol[ig]->localize_to_one(v_local,0); @@ -274,9 +277,9 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char else{ _ml_sol.GetSolutionLevel(ig)->_Eps[i]->localize_to_one(v_local,0); } - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(i)); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(i)); var_el[icount]=v_local[iel_Metis]; icount++; } diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 12e05c65f..7cdcf52dd 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -53,6 +53,8 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } + MultiLevelMesh *mlMsh = _ml_sol._ml_msh; + int icount; unsigned index=0; unsigned index_nd=0; @@ -96,28 +98,28 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; nvt+=nvt_ig; } unsigned nel=0; unsigned counter=0; for (unsigned ig=_gridr-1u; ig<_gridn-1u; ig++) { - nel+=( _ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements() - _ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber()); - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Hex")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Hex"))*NVE[0][index]; - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Tet")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Tet"))*NVE[1][index]; - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Wedge")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Wedge"))*NVE[2][index]; - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Quad")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Quad"))*NVE[3][index]; - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Triangle")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Triangle"))*NVE[4][index]; - counter+=(_ml_sol._ml_msh->GetLevel(ig)->el->GetElementNumber("Line")-_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber("Line"))*NVE[5][index]; + nel+=( mlMsh->GetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Hex")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Hex"))*NVE[0][index]; + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Tet")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Tet"))*NVE[1][index]; + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Wedge")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Wedge"))*NVE[2][index]; + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Quad")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Quad"))*NVE[3][index]; + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Triangle")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Triangle"))*NVE[4][index]; + counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Line")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Line"))*NVE[5][index]; } - nel+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->GetNumberOfElements(); - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Hex")*NVE[0][index]; - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Tet")*NVE[1][index]; - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Wedge")*NVE[2][index]; - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Quad")*NVE[3][index]; - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Triangle")*NVE[4][index]; - counter+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementNumber("Line")*NVE[5][index]; + nel+=mlMsh->GetLevel(_gridn-1u)->GetNumberOfElements(); + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Hex")*NVE[0][index]; + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Tet")*NVE[1][index]; + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Wedge")*NVE[2][index]; + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Quad")*NVE[3][index]; + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Triangle")*NVE[4][index]; + counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Line")*NVE[5][index]; const unsigned dim_array_coord [] = { nvt*3*sizeof(float) }; const unsigned dim_array_conn[] = { counter*sizeof(int) }; @@ -149,7 +151,7 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char vector mysol(_gridn); for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { mysol[ig] = NumericVector::build().release(); - mysol[ig]->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol[ig]->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); } // point pointer to common mamory area buffer of void type; @@ -158,9 +160,9 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned offset_nvt3=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { std::vector v_local; - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kk<3;kk++) { - mysol[ig]->matrix_mult(*_ml_sol._ml_msh->GetLevel(ig)->_coordinate->_Sol[kk],*_ProlQitoQj[index_nd][2][ig]); + mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; iGetLevel(0)->GetDimension() == 3) { + if(mlMsh->GetLevel(0)->GetDimension() == 3) { indDXDYDZ[2]=_ml_sol.GetIndex(_moving_vars[2].c_str()); } for(unsigned ig=_gridr-1u; ig<_gridn; ig++){ std::vector v_local; - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; - for(int kk=0;kk<_ml_sol._ml_msh->GetLevel(0)->GetDimension();kk++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]],*_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indDXDYDZ[kk])][ig]); + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + for(int kk=0;kkGetLevel(0)->GetDimension();kk++) { + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indDXDYDZ[kk])][ig]); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; iGetLevel(ig)->GetNumberOfElements(); iel++) { - if (ig==_gridn-1u || _ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0) { - for (unsigned j=0; j<_ml_sol._ml_msh->GetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { + for (unsigned iel=0; ielGetLevel(ig)->GetNumberOfElements(); iel++) { + if (ig==_gridn-1u || mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0) { + for (unsigned j=0; jGetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { unsigned loc_vtk_conn = map_pr[j]; - unsigned jnode=_ml_sol._ml_msh->GetLevel(ig)->el->GetElementVertexIndex(iel,loc_vtk_conn)-1u; - unsigned jnode_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(jnode,index_nd); + unsigned jnode=mlMsh->GetLevel(ig)->el->GetElementVertexIndex(iel,loc_vtk_conn)-1u; + unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index_nd); var_conn[icount] = offset_nvt+jnode_Metis; icount++; } } } - offset_nvt+=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + offset_nvt+=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; } //print connectivity dimension @@ -269,10 +271,10 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char int offset_el=0; //print offset array for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned iel=0; iel<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); iel++) { - if ( ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(iel)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(iel,3); - offset_el += _ml_sol._ml_msh->GetLevel(ig)->el->GetElementDofNumber(iel_Metis,index); + for (unsigned iel=0; ielGetLevel(ig)->GetNumberOfElements(); iel++) { + if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(iel,3); + offset_el += mlMsh->GetLevel(ig)->el->GetElementDofNumber(iel_Metis,index); var_off[icount] = offset_el; icount++; } @@ -304,10 +306,10 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned short *var_type = static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || _ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,3); - short unsigned ielt= _ml_sol._ml_msh->GetLevel(ig)->el->GetElementType(iel_Metis); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); + short unsigned ielt= mlMsh->GetLevel(ig)->el->GetElementType(iel_Metis); var_type[icount] = femusToVtkCellType[index][ielt]; icount++; } @@ -344,10 +346,10 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned short* var_reg=static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,3); - var_reg[icount]= _ml_sol._ml_msh->GetLevel(ig)->el->GetElementGroup(ii); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); + var_reg[icount]= mlMsh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } } @@ -376,10 +378,10 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned short* var_proc=static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,3); - var_proc[icount]=(unsigned short)(_ml_sol._ml_msh->GetLevel(ig)->epart[ii]); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); + var_proc[icount]=(unsigned short)(mlMsh->GetLevel(ig)->epart[ii]); icount++; } } @@ -413,9 +415,9 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { vector sol_local; _ml_sol.GetSolutionLevel(ig)->_Sol[indx]->localize_to_one(sol_local,0); - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); var_el[icount]=sol_local[iel_Metis]; icount++; } @@ -462,10 +464,10 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for (unsigned ii=0; ii Writer::_ProlQitoQj[3][3]; - -Writer::Writer(MultiLevelSolution& ml_sol): - _ml_sol(ml_sol) -{ - _gridn = ml_sol._ml_msh->GetNumberOfLevels(); - _gridr = ml_sol._ml_msh->GetNumberOfGridTotallyRefined(); - - if(Writer::_ProlQitoQj[0][0].size() == 0) + Writer::Writer(MultiLevelSolution& ml_sol): + _ml_sol(ml_sol) { - BuildProlongatorMatrices(); + _gridn = ml_sol._ml_msh->GetNumberOfLevels(); + _gridr = ml_sol._ml_msh->GetNumberOfGridTotallyRefined(); + _moving_mesh = 0; } - _moving_mesh = 0; -} -Writer::~Writer() -{ - - for (int itype=0; itype<3; itype++) { - for (int jtype=0; jtype<3; jtype++) { - for (int igridn=0; igridn<_gridn; igridn++) { - if(_ProlQitoQj[itype][jtype][igridn]) - { - delete _ProlQitoQj[itype][jtype][igridn]; - _ProlQitoQj[itype][jtype][igridn] = NULL; - } - } - _ProlQitoQj[itype][jtype].resize(0); - } - } - -} + Writer::~Writer() { } - std::auto_ptr Writer::build(const WriterEnum format, MultiLevelSolution * ml_sol) { + std::auto_ptr Writer::build(const WriterEnum format, MultiLevelSolution * ml_sol) { - switch (format) { - case VTK: { - std::auto_ptr ap(new VTKWriter(*ml_sol)); return ap; - } - case GMV: { - std::auto_ptr ap(new GMVWriter(*ml_sol)); return ap; - } - case XDMF: { - std::auto_ptr ap(new XDMFWriter(*ml_sol)); return ap; - } - default: { - std::cout << "Format not supported" << std::endl; - abort(); - } - - } //end switch - - - } - - -void Writer::SetMovingMesh(std::vector& movvars_in) -{ - _moving_mesh = 1; - _moving_vars = movvars_in; -} - - -void Writer::BuildProlongatorMatrices() { - - for(int i=0; i<3; i++){ - for(int j=0; j<3; j++){ - _ProlQitoQj[i][j].resize(_gridn); - } - } - - for (unsigned igridn=0; igridn<_gridn; igridn++){ - Mesh* msh = _ml_sol._ml_msh->GetLevel(igridn); - for(int itype=0;itype<3;itype++){ - int ni = msh->MetisOffset[itype][_nprocs]; - int ni_loc = msh->own_size[itype][_iproc]; - for (int jtype=0; jtype<3; jtype++) { - int nj = msh->MetisOffset[jtype][_nprocs]; - int nj_loc = msh->own_size[itype][_iproc]; - - NumericVector *NNZ_d = NumericVector::build().release(); - NumericVector *NNZ_o = NumericVector::build().release(); - if(_nprocs==1) { // IF SERIAL - NNZ_d->init(ni,ni_loc,false,SERIAL); - NNZ_o->init(ni,ni_loc,false,SERIAL); - } - else{ - NNZ_d->init(ni,ni_loc,false,PARALLEL); - NNZ_o->init(ni,ni_loc,false,PARALLEL); - } - NNZ_d->zero(); - NNZ_o->zero(); - - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=msh->IS_Mts2Gmt_elem_offset[isdom];iel_mts < msh->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ - unsigned iel = msh->IS_Mts2Gmt_elem[iel_mts]; - short unsigned ielt=msh->el->GetElementType(iel); - _ml_sol._ml_msh->_finiteElement[ielt][jtype]->GetSparsityPatternSize(*msh, iel, NNZ_d, NNZ_o, itype); - } - } - - NNZ_d->close(); - NNZ_o->close(); - - unsigned offset = msh->MetisOffset[itype][_iproc]; - - vector nnz_d(ni_loc); - vector nnz_o(ni_loc); - for(int i=0; i ((*NNZ_d)(offset+i)); - nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); - } - - delete NNZ_d; - delete NNZ_o; - - _ProlQitoQj[itype][jtype][igridn] = SparseMatrix::build().release(); - _ProlQitoQj[itype][jtype][igridn]->init(ni,nj,msh->own_size[itype][_iproc],msh->own_size[jtype][_iproc],nnz_d,nnz_o); - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=msh->IS_Mts2Gmt_elem_offset[isdom];iel_mts < msh->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ - unsigned iel = msh->IS_Mts2Gmt_elem[iel_mts]; - short unsigned ielt=msh->el->GetElementType(iel); - _ml_sol._ml_msh->_finiteElement[ielt][jtype]->BuildProlongation(*msh, iel, _ProlQitoQj[itype][jtype][igridn], itype); - } - } - _ProlQitoQj[itype][jtype][igridn]->close(); + switch (format) { + case VTK: { + std::auto_ptr ap(new VTKWriter(*ml_sol)); return ap; } - } + case GMV: { + std::auto_ptr ap(new GMVWriter(*ml_sol)); return ap; + } + case XDMF: { + std::auto_ptr ap(new XDMFWriter(*ml_sol)); return ap; + } + default: { + std::cout << "Format not supported" << std::endl; + abort(); + } + } //end switch } -} - + void Writer::SetMovingMesh(std::vector& movvars_in){ + _moving_mesh = 1; + _moving_vars = movvars_in; + } + } //end namespace femus diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index 9949c7d94..246caeb64 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -27,20 +27,20 @@ namespace femus { -// map from our connectivity to vtk-connectivity for paraview visualization //TODO move this to the appropriate place -const unsigned map_pr[27] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,21,20,22,24,25,26}; + // map from our connectivity to vtk-connectivity for paraview visualization //TODO move this to the appropriate place + const unsigned map_pr[27] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,23,21,20,22,24,25,26}; -//------------------------------------------------------------------------------ -// Forward declarations -//------------------------------------------------------------------------------ -class MultiLevelSolution; -class SparseMatrix; -class Vector; + //------------------------------------------------------------------------------ + // Forward declarations + //------------------------------------------------------------------------------ + class MultiLevelSolution; + class SparseMatrix; + class Vector; -class Writer : public ParallelObject { + class Writer : public ParallelObject { -public: + public: /** Constructor. */ Writer(MultiLevelSolution & ml_probl); @@ -56,10 +56,7 @@ class Writer : public ParallelObject { static std::auto_ptr build(const WriterEnum format, MultiLevelSolution * ml_sol); -protected: - - /** a set of matrix for the projection of the solution */ - static std::vector _ProlQitoQj[3][3]; + protected: /** a flag to move the output mesh */ int _moving_mesh; @@ -75,15 +72,10 @@ class Writer : public ParallelObject { int _gridr; -private: - - /** This routine generates the matrices for the projection of the solutions from different FE spaces */ - void BuildProlongatorMatrices(); - -}; - - + private: + }; + } //end namespace femus diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index c175b8593..978f6a2be 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -218,12 +218,12 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha mysol = NumericVector::build().release(); //mysol->init(_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol._ml_msh->GetLevel(ig)->_coordinate->_Sol[i],*Writer::_ProlQitoQj[index_nd][2][ig]); + mysol->matrix_mult(*_ml_sol._ml_msh->GetLevel(ig)->_coordinate->_Sol[i],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iimatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],*Writer::_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)][ig]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)][ig]); for (unsigned ii=0; iiinit(_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; ii Date: Mon, 2 Mar 2015 15:00:50 -0600 Subject: [PATCH 08/91] Added SalomeIO class files --- src/CMakeLists.txt | 1 + src/mesh/SalomeIO.cpp | 258 ++++++++++++++++++++++++++++++++++++++++++ src/mesh/SalomeIO.hpp | 73 ++++++++++++ 3 files changed, 332 insertions(+) create mode 100644 src/mesh/SalomeIO.cpp create mode 100644 src/mesh/SalomeIO.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5744f965f..c29bdd68c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,6 +75,7 @@ mesh/Mesh.cpp mesh/MultiLevelMesh.cpp mesh/MeshGeneration.cpp mesh/GambitIO.cpp +mesh/SalomeIO.cpp mesh/MeshRefinement.cpp mesh/MeshMetisPartitioning.cpp mesh/MeshPartitioning.cpp diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp new file mode 100644 index 000000000..57649c9ce --- /dev/null +++ b/src/mesh/SalomeIO.cpp @@ -0,0 +1,258 @@ +/*========================================================================= + + Program: FEMUS + Module: SalomeIO + Authors: Sureka Pathmanathan, Giorgio Bornia + + Copyright (c) FEMTTU + All rights reserved. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +//local include +#include "SalomeIO.hpp" +#include "Mesh.hpp" + +//C++ include +#include "cstdio" +#include "fstream" + + +namespace femus { + + const unsigned SalomeIO::GambitToFemusVertexIndex[6][27]= + { + { + 4,16,0,15,23,11,7,19,3, + 12,20,8,25,26,24,14,22,10, + 5,17,1,13,21,9,6,18,2 + }, + { + 0,4,1,6,5, + 2,7,8,9,3 + }, + { + 3, 11,5, 9, 10,4, + 12,17,14,15,16,13, + 0, 8, 2, 6, 7, 1 + }, + {0,4,1,5,2,6,3,7,8}, + {0,3,1,4,2,5}, + {0,2,1} + }; + + +const unsigned SalomeIO::GambitToFemusFaceIndex[6][6]= + { + {0,4,2,5,3,1}, + {0,1,2,3}, + {2,1,0,4,3}, + {0,1,2,3}, + {0,1,2}, + {0,1} + }; + + +void SalomeIO::read(const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag) { + + Mesh& mesh = GetMesh(); + + std::ifstream inf; + std::string str2; + unsigned ngroup; + unsigned nbcd; + unsigned dim; + double x,y,z; + unsigned nvt; + unsigned nel; + + mesh.SetGridNumber(0); + // read control data ******************** A + inf.open(name.c_str()); + if (!inf) { + std::cout<<"Generic-mesh file "<< name << " can not read parameters\n"; + exit(0); + } + str2="0"; + while (str2.compare("NDFVL") != 0) inf >> str2; + inf >> nvt >> nel >> ngroup >> nbcd >> dim >> str2 ; + mesh.SetDimension(dim); + mesh.SetNumberOfElements(nel); + mesh.SetNumberOfNodes(nvt); + inf >> str2; + if (str2.compare("ENDOFSECTION") != 0) { + std::cout<<"error control data mesh"<> str2; + inf >> str2; + for (unsigned iel=0; ielSetElementGroup(iel,1); + unsigned nve; + inf >> str2 >> str2 >> nve; + if (nve==27) { + type_elem_flag[0]=type_elem_flag[3]=true; + mesh.el->AddToElementNumber(1,"Hex"); + mesh.el->SetElementType(iel,0); + } else if (nve==10) { + type_elem_flag[1]=type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Tet"); + mesh.el->SetElementType(iel,1); + } else if (nve==18) { + type_elem_flag[2]=type_elem_flag[3]=type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Wedge"); + mesh.el->SetElementType(iel,2); + } else if (nve==9) { + type_elem_flag[3]=true; + mesh.el->AddToElementNumber(1,"Quad"); + mesh.el->SetElementType(iel,3); + } + else if (nve==6 && mesh.GetDimension()==2) { + type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Triangle"); + mesh.el->SetElementType(iel,4); + } + else if (nve==3 && mesh.GetDimension()==1) { + mesh.el->AddToElementNumber(1,"Line"); + mesh.el->SetElementType(iel,5); + } else { + std::cout<<"Error! Invalid element type in reading Gambit File!"<GetElementType(iel)][i]; + double value; + inf>>value; + mesh.el->SetElementVertexIndex(iel,inode,value); + } + } + inf >> str2; + if (str2.compare("ENDOFSECTION") != 0) { + std::cout<<"error element data mesh"<> str2; + inf >> str2; // 2.0.4 + coords[0].resize(nvt); + coords[1].resize(nvt); + coords[2].resize(nvt); + + if (mesh.GetDimension()==3) { + for (unsigned j=0; j> str2 >> x >> y >> z; + coords[0][j] = x/Lref; + coords[1][j] = y/Lref; + coords[2][j] = z/Lref; + } + } + + else if (mesh.GetDimension()==2) { + for (unsigned j=0; j> str2 >> x >> y; + coords[0][j] = x/Lref; + coords[1][j] = y/Lref; + coords[2][j] = 0.; + } + } + + else if (mesh.GetDimension()==1) { + for (unsigned j=0; j> str2 >> x; + coords[0][j] = x/Lref; + coords[1][j]=0.; + coords[2][j]=0.; + } + } + inf >> str2; // "ENDOFSECTION" + if (str2.compare("ENDOFSECTION") != 0) { + std::cout<<"error node data mesh 1"<SetElementGroupNumber(ngroup); + for (unsigned k=0; k> str2; + inf >> str2 >> str2 >> ngel >> str2 >> mat >>str2 >> str2 >>name>> str2; + for (int i=0; i> iel; + mesh.el->SetElementGroup(iel-1,name); + mesh.el->SetElementMaterial(iel-1,mat); + } + inf >> str2; + if (str2.compare("ENDOFSECTION") != 0) { + std::cout<<"error group data mesh"<> str2; + inf >> str2; + int value; + unsigned nface; + inf >>value>>str2>>nface>>str2>>str2; + value=-value-1; + for (unsigned i=0; i>iel>>str2>>iface; + iel--; + iface=SalomeIO::GambitToFemusFaceIndex[mesh.el->GetElementType(iel)][iface-1u]; + mesh.el->SetFaceElementIndex(iel,iface,value); + } + inf >> str2; + if (str2.compare("ENDOFSECTION") != 0) { + std::cout<<"error boundary data mesh"< +{ + public: + + /** + * Constructor. Takes a non-const Mesh reference which it + * will fill up with elements via the read() command. + */ + explicit + SalomeIO (Mesh& mesh); + + /** + * Reads in a mesh in the neutral gambit *.neu format + * from the ASCII file given by name. + * + */ + virtual void read (const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag); + + private: + + /** Map from Gambit vertex index to Femus vertex index */ + static const unsigned GambitToFemusVertexIndex[6][27]; + + /** Map from Gambit face index to Femus face index */ + static const unsigned GambitToFemusFaceIndex[6][6]; + +}; + + +inline +SalomeIO::SalomeIO (Mesh& mesh) : + MeshInput (mesh) +{ +} + + +} // namespace femus + +#endif \ No newline at end of file From 5f407d43f135a948c19c36052f590cb93629769b Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 2 Mar 2015 17:38:33 -0600 Subject: [PATCH 09/91] Added ReadFE function in SalomeIO, and interface to SalomeIO in ReadCoarseMesh --- .../GmresPetscLinearEquationSolver.cpp | 6 +- .../GmresPetscLinearEquationSolver.hpp | 4 +- src/algebra/LinearEquationSolver.hpp | 2 +- src/fe/ElemType.hpp | 10 +- src/mesh/Mesh.cpp | 4 + src/mesh/MultiLevelMesh.hpp | 2 +- src/mesh/SalomeIO.cpp | 471 +++++++++++------- src/mesh/SalomeIO.hpp | 16 +- unittests/testSalomeIO/testSalomeIO.cpp | 18 +- 9 files changed, 326 insertions(+), 207 deletions(-) diff --git a/src/algebra/GmresPetscLinearEquationSolver.cpp b/src/algebra/GmresPetscLinearEquationSolver.cpp index 9efbae620..f275f14a4 100644 --- a/src/algebra/GmresPetscLinearEquationSolver.cpp +++ b/src/algebra/GmresPetscLinearEquationSolver.cpp @@ -433,7 +433,7 @@ std::pair GmresPetscLinearEquationSolver::solve(SparseMatr } - // DEPRECATED ======================================================== + // @deprecated ======================================================== PetscErrorCode __libmesh_petsc_preconditioner_setup(PC pc) { void *ctx; PetscErrorCode ierr = PCShellGetContext(pc,&ctx); @@ -444,7 +444,7 @@ PetscErrorCode __libmesh_petsc_preconditioner_setup(PC pc) { } -// DEPRECATED ======================================================== +// @deprecated ======================================================== PetscErrorCode __libmesh_petsc_preconditioner_apply(PC pc, Vec x, Vec y) { void *ctx; PetscErrorCode ierr = PCShellGetContext(pc,&ctx); @@ -457,7 +457,7 @@ PetscErrorCode __libmesh_petsc_preconditioner_apply(PC pc, Vec x, Vec y) { } - // DEPRECATED ======================================================== + // @deprecated ======================================================== void GmresPetscLinearEquationSolver::init(SparseMatrix* matrix) { PetscMatrix* matrix_two = libmeshM_cast_ptr(matrix); diff --git a/src/algebra/GmresPetscLinearEquationSolver.hpp b/src/algebra/GmresPetscLinearEquationSolver.hpp index 5d6c59d81..085006b2a 100644 --- a/src/algebra/GmresPetscLinearEquationSolver.hpp +++ b/src/algebra/GmresPetscLinearEquationSolver.hpp @@ -71,12 +71,12 @@ class GmresPetscLinearEquationSolver : public LinearEquationSolver { clock_t BuildIndex(const vector &variable_to_be_solved); - /** DEPRECATED, remove soon */ + /** @deprecated, remove soon */ std::pair solve(SparseMatrix& matrix_in, SparseMatrix& precond_in, NumericVector& solution_in, NumericVector& rhs_in, const double tol, const unsigned int m_its); - /** DEPRECATED, remove soon */ + /** @deprecated, remove soon */ void init(SparseMatrix* matrix); private: diff --git a/src/algebra/LinearEquationSolver.hpp b/src/algebra/LinearEquationSolver.hpp index 756858c0c..30872e6fc 100644 --- a/src/algebra/LinearEquationSolver.hpp +++ b/src/algebra/LinearEquationSolver.hpp @@ -124,7 +124,7 @@ class LinearEquationSolver : public LinearEquation { /** Call the smoother-solver using the PetscLibrary. */ virtual void solve(const vector &VankaIndex, const bool &ksp_clean) = 0; - /** DEPRECATED Old solver with algebra objects passed as arguments TODO think of removing */ + /** @deprecated Old solver with algebra objects passed as arguments TODO think of removing */ virtual std::pair solve (SparseMatrix&, // System Matrix SparseMatrix&, // prec NumericVector&, // Solution vector diff --git a/src/fe/ElemType.hpp b/src/fe/ElemType.hpp index 1e89f95c9..bed0bec5e 100644 --- a/src/fe/ElemType.hpp +++ b/src/fe/ElemType.hpp @@ -98,19 +98,19 @@ class elem_type { // void GetArea(const double *vt,const double *vty, const double *vtz, const unsigned &ig, // double &Weight, double *other_phi) const; - /** DEPRECATED Function pointer for DPhiDXEZ */ + /** @deprecated Function pointer for DPhiDXEZ */ typedef double* (elem_type::*_FunctionPointer)(const unsigned & ig) const; //you need "elem_type::" for some reason std::vector<_FunctionPointer> _DPhiXiEtaZetaPtr; - /** DEPRECATED Evaluate shape functions at all quadrature points */ + /** @deprecated Evaluate shape functions at all quadrature points */ virtual void EvaluateShapeAtQP(const std::string geomel_id_in,const std::string fe_in); - /** DEPRECATED Get shape functions */ + /** @deprecated Get shape functions */ inline const double GetPhi(const uint qp, const uint dof ) const { return _phi_mapGD[qp][dof]; } - /** DEPRECATED Get shape function first derivatives */ + /** @deprecated Get shape function first derivatives */ inline const double GetDPhiDxez(const uint qp, const uint dof ) const { return _dphidxez_mapGD[qp][dof]; } @@ -173,7 +173,7 @@ class elem_type { // Gauss const Gauss _gauss; - /** DEPRECATED */ + /** @deprecated */ double** _phi_mapGD; double** _dphidxez_mapGD; diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 9db94cbc1..e5fa171be 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -20,6 +20,7 @@ #include "MeshGeneration.hpp" #include "MeshMetisPartitioning.hpp" #include "GambitIO.hpp" +#include "SalomeIO.hpp" #include "NumericVector.hpp" // C++ includes @@ -77,6 +78,9 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto { GambitIO(*this).read(name,coords,Lref,type_elem_flag); } + else if(name.rfind(".med") < name.size()) { + SalomeIO(*this).read(name,coords,Lref,type_elem_flag); + } else { std::cerr << " ERROR: Unrecognized file extension: " << name diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index e97257741..de92a17b0 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -38,7 +38,7 @@ class MultiLevelMesh { public: - /** Constructors */ + /** @deprecated, if you instantiate with this without calling other functions later, the destructor at the end gives seg fault clearly */ MultiLevelMesh(); MultiLevelMesh(const unsigned short &igridn,const unsigned short &igridr, diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index 57649c9ce..65e1ba347 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -18,12 +18,22 @@ #include "Mesh.hpp" //C++ include -#include "cstdio" -#include "fstream" +#include +#include +#include namespace femus { + const std::string SalomeIO::group_name_begin = "FAS"; + const std::string SalomeIO::group_name_end = "ELEME"; + const std::string SalomeIO::mesh_ensemble = "ENS_MAA"; + const std::string SalomeIO::aux_zeroone = "-0000000000000000001-0000000000000000001"; + const std::string SalomeIO::connectivity = "MAI"; + const std::string SalomeIO::node_coord = "NOE/COO"; + + + const unsigned SalomeIO::GambitToFemusVertexIndex[6][27]= { { @@ -59,200 +69,289 @@ const unsigned SalomeIO::GambitToFemusFaceIndex[6][6]= void SalomeIO::read(const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag) { - Mesh& mesh = GetMesh(); + //we assume that the mesh file name is the same as the menu. Therefore, we have to use BASENAME much like we do in the shell + // later on we will have to relax this assumption, which implies probably adding one argument either in this function, or better in the constructor + // (in any case, that would remove polymorphism for the children of MeshInput) + +// unsigned found = name.find_last_of("/"); +// unsigned found2 = name.find_last_of("."); +// mesh_menu = name.substr(0,found2); + + +// Mesh& mesh = GetMesh(); +// +// std::ifstream inf; +// std::string str2; +// unsigned ngroup; +// unsigned nbcd; +// unsigned dim; +// double x,y,z; +// unsigned nvt; +// unsigned nel; +// +// mesh.SetGridNumber(0); +// +// +// +// // read control data ******************** A +// inf.open(name.c_str()); +// if (!inf) { +// std::cout<<"Generic-mesh file "<< name << " can not read parameters\n"; +// exit(0); +// } +// str2="0"; +// while (str2.compare("NDFVL") != 0) inf >> str2; +// inf >> nvt >> nel >> ngroup >> nbcd >> dim >> str2 ; +// mesh.SetDimension(dim); +// mesh.SetNumberOfElements(nel); +// mesh.SetNumberOfNodes(nvt); +// inf >> str2; +// if (str2.compare("ENDOFSECTION") != 0) { +// std::cout<<"error control data mesh"<> str2; +// inf >> str2; +// for (unsigned iel=0; ielSetElementGroup(iel,1); +// unsigned nve; +// inf >> str2 >> str2 >> nve; +// if (nve==27) { +// type_elem_flag[0]=type_elem_flag[3]=true; +// mesh.el->AddToElementNumber(1,"Hex"); +// mesh.el->SetElementType(iel,0); +// } else if (nve==10) { +// type_elem_flag[1]=type_elem_flag[4]=true; +// mesh.el->AddToElementNumber(1,"Tet"); +// mesh.el->SetElementType(iel,1); +// } else if (nve==18) { +// type_elem_flag[2]=type_elem_flag[3]=type_elem_flag[4]=true; +// mesh.el->AddToElementNumber(1,"Wedge"); +// mesh.el->SetElementType(iel,2); +// } else if (nve==9) { +// type_elem_flag[3]=true; +// mesh.el->AddToElementNumber(1,"Quad"); +// mesh.el->SetElementType(iel,3); +// } +// else if (nve==6 && mesh.GetDimension()==2) { +// type_elem_flag[4]=true; +// mesh.el->AddToElementNumber(1,"Triangle"); +// mesh.el->SetElementType(iel,4); +// } +// else if (nve==3 && mesh.GetDimension()==1) { +// mesh.el->AddToElementNumber(1,"Line"); +// mesh.el->SetElementType(iel,5); +// } else { +// std::cout<<"Error! Invalid element type in reading Gambit File!"<GetElementType(iel)][i]; +// double value; +// inf>>value; +// mesh.el->SetElementVertexIndex(iel,inode,value); +// } +// } +// inf >> str2; +// if (str2.compare("ENDOFSECTION") != 0) { +// std::cout<<"error element data mesh"<> str2; +// inf >> str2; // 2.0.4 +// coords[0].resize(nvt); +// coords[1].resize(nvt); +// coords[2].resize(nvt); +// +// if (mesh.GetDimension()==3) { +// for (unsigned j=0; j> str2 >> x >> y >> z; +// coords[0][j] = x/Lref; +// coords[1][j] = y/Lref; +// coords[2][j] = z/Lref; +// } +// } +// +// else if (mesh.GetDimension()==2) { +// for (unsigned j=0; j> str2 >> x >> y; +// coords[0][j] = x/Lref; +// coords[1][j] = y/Lref; +// coords[2][j] = 0.; +// } +// } +// +// else if (mesh.GetDimension()==1) { +// for (unsigned j=0; j> str2 >> x; +// coords[0][j] = x/Lref; +// coords[1][j]=0.; +// coords[2][j]=0.; +// } +// } +// inf >> str2; // "ENDOFSECTION" +// if (str2.compare("ENDOFSECTION") != 0) { +// std::cout<<"error node data mesh 1"<SetElementGroupNumber(ngroup); +// for (unsigned k=0; k> str2; +// inf >> str2 >> str2 >> ngel >> str2 >> mat >>str2 >> str2 >>name>> str2; +// for (int i=0; i> iel; +// mesh.el->SetElementGroup(iel-1,name); +// mesh.el->SetElementMaterial(iel-1,mat); +// } +// inf >> str2; +// if (str2.compare("ENDOFSECTION") != 0) { +// std::cout<<"error group data mesh"<> str2; +// inf >> str2; +// int value; +// unsigned nface; +// inf >>value>>str2>>nface>>str2>>str2; +// value=-value-1; +// for (unsigned i=0; i>iel>>str2>>iface; +// iel--; +// iface=SalomeIO::GambitToFemusFaceIndex[mesh.el->GetElementType(iel)][iface-1u]; +// mesh.el->SetFaceElementIndex(iel,iface,value); +// } +// inf >> str2; +// if (str2.compare("ENDOFSECTION") != 0) { +// std::cout<<"error boundary data mesh"<> str2; - inf >> nvt >> nel >> ngroup >> nbcd >> dim >> str2 ; - mesh.SetDimension(dim); - mesh.SetNumberOfElements(nel); - mesh.SetNumberOfNodes(nvt); - inf >> str2; - if (str2.compare("ENDOFSECTION") != 0) { - std::cout<<"error control data mesh"<> str2; - inf >> str2; - for (unsigned iel=0; ielSetElementGroup(iel,1); - unsigned nve; - inf >> str2 >> str2 >> nve; - if (nve==27) { - type_elem_flag[0]=type_elem_flag[3]=true; - mesh.el->AddToElementNumber(1,"Hex"); - mesh.el->SetElementType(iel,0); - } else if (nve==10) { - type_elem_flag[1]=type_elem_flag[4]=true; - mesh.el->AddToElementNumber(1,"Tet"); - mesh.el->SetElementType(iel,1); - } else if (nve==18) { - type_elem_flag[2]=type_elem_flag[3]=type_elem_flag[4]=true; - mesh.el->AddToElementNumber(1,"Wedge"); - mesh.el->SetElementType(iel,2); - } else if (nve==9) { - type_elem_flag[3]=true; - mesh.el->AddToElementNumber(1,"Quad"); - mesh.el->SetElementType(iel,3); - } - else if (nve==6 && mesh.GetDimension()==2) { - type_elem_flag[4]=true; - mesh.el->AddToElementNumber(1,"Triangle"); - mesh.el->SetElementType(iel,4); - } - else if (nve==3 && mesh.GetDimension()==1) { - mesh.el->AddToElementNumber(1,"Line"); - mesh.el->SetElementType(iel,5); - } else { - std::cout<<"Error! Invalid element type in reading Gambit File!"<GetElementType(iel)][i]; - double value; - inf>>value; - mesh.el->SetElementVertexIndex(iel,inode,value); - } - } - inf >> str2; - if (str2.compare("ENDOFSECTION") != 0) { - std::cout<<"error element data mesh"<> str2; - inf >> str2; // 2.0.4 - coords[0].resize(nvt); - coords[1].resize(nvt); - coords[2].resize(nvt); +int SalomeIO::ReadFE( + hid_t file_id, + std::string & el_fem_type_vol, + std::string & el_fem_type_bd +) { - if (mesh.GetDimension()==3) { - for (unsigned j=0; j> str2 >> x >> y >> z; - coords[0][j] = x/Lref; - coords[1][j] = y/Lref; - coords[2][j] = z/Lref; - } - } + Mesh& mesh = GetMesh(); - else if (mesh.GetDimension()==2) { - for (unsigned j=0; j> str2 >> x >> y; - coords[0][j] = x/Lref; - coords[1][j] = y/Lref; - coords[2][j] = 0.; - } - } + +// ************ reading hdf5-med file ************************************ - else if (mesh.GetDimension()==1) { - for (unsigned j=0; j> str2 >> x; - coords[0][j] = x/Lref; - coords[1][j]=0.; - coords[2][j]=0.; - } + // --------- Reading Element type (From salome to LIBMESH (itype_vol))------ + std::map< std::string, int > fem_type_vol;// Salome fem table name (vol) + fem_type_vol["HE8"] = 5; fem_type_vol["H20"] = 20; fem_type_vol["H27"] = 12; + fem_type_vol["TE4"] = 4; fem_type_vol["T10"] = 11; + fem_type_vol["QU4"] = 3; fem_type_vol["QU8"] = 19; fem_type_vol["QU9"] = 10; + fem_type_vol["TR3"] = 2; fem_type_vol["TR6"] = 9; + fem_type_vol["SE2"] = 0; fem_type_vol["SE3"] = 0; // not valid in 3D + if(mesh.GetDimension()==3) { // not valid in 3D as boundary + fem_type_vol["QU4"] = 0; fem_type_vol["QU8"] = 0; fem_type_vol["QU9"] = 0; + fem_type_vol["TR3"] = 0; fem_type_vol["TR6"] = 0; } - inf >> str2; // "ENDOFSECTION" - if (str2.compare("ENDOFSECTION") != 0) { - std::cout<<"error node data mesh 1"< fem_type_bd; // Salome fem table name (surface) + fem_type_bd["HE8"] = 0; fem_type_bd["H20"] = 0; fem_type_bd["H27"] = 0; + fem_type_bd["TE4"] = 0; fem_type_bd["T10"] = 0; // not valid in 2D + fem_type_bd["QU4"] = 3; fem_type_bd["QU8"] = 19; fem_type_bd["QU9"] = 10; + fem_type_bd["TR3"] = 2; fem_type_bd["TR6"] = 9; + fem_type_bd["SE2"] = 1; fem_type_bd["SE3"] = 8; + if(mesh.GetDimension()==3) { // not valid in 3D as boundary + fem_type_bd["SE2"] = 0; fem_type_bd["SE3"] = 0; } - inf.close(); - // end read NODAL COORDINATES ************* C - // read GROUP **************** E - inf.open(name.c_str()); - if (!inf) { - std::cout<<"Generic-mesh file "<< name << " cannot read group\n"; - exit(0); - } - mesh.el->SetElementGroupNumber(ngroup); - for (unsigned k=0; k> str2; - inf >> str2 >> str2 >> ngel >> str2 >> mat >>str2 >> str2 >>name>> str2; - for (int i=0; i> iel; - mesh.el->SetElementGroup(iel-1,name); - mesh.el->SetElementMaterial(iel-1,mat); - } - inf >> str2; - if (str2.compare("ENDOFSECTION") != 0) { - std::cout<<"error group data mesh"<> str2; - inf >> str2; - int value; - unsigned nface; - inf >>value>>str2>>nface>>str2>>str2; - value=-value-1; - for (unsigned i=0; i>iel>>str2>>iface; - iel--; - iface=SalomeIO::GambitToFemusFaceIndex[mesh.el->GetElementType(iel)][iface-1u]; - mesh.el->SetFaceElementIndex(iel,iface,value); - } - inf >> str2; - if (str2.compare("ENDOFSECTION") != 0) { - std::cout<<"error boundary data mesh"< /** Map from Gambit face index to Femus face index */ static const unsigned GambitToFemusFaceIndex[6][6]; - + + /** Read FE type */ + int ReadFE(hid_t file_id, std::string & el_fem_type_vol, std::string & el_fem_type_bd); + + std::string mesh_menu; //Mesh_1; strip from file name by removing .med + static const std::string group_name_begin; //FAS + static const std::string group_name_end; //ELEME + static const std::string mesh_ensemble; // ENS_MAA + static const std::string aux_zeroone; // -0000000000000000001-0000000000000000001 + static const std::string connectivity; // MAI + static const std::string node_coord; //NOE/COO + }; diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 125353e17..4c4e184d0 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -1,3 +1,4 @@ +#include #include "FemusDefault.hpp" #include "FemusInit.hpp" #include "MultiLevelMesh.hpp" @@ -11,15 +12,16 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); -// std::string med_file = "Mesh_1.med"; -// std::string infile = "./" + DEFAULT_CONFIGDIR + med_file; -// -// //Adimensional -// double Lref = 1.; -// -// //MultiLevelMesh ml_msh(nm,nr,infile,"seventh",Lref,SetRefinementFlag); + std::string med_file = "Mesh_1.med"; + std::ostringstream mystream; mystream << "./" << DEFAULT_CONFIGDIR << "/" << med_file; + const std::string infile = mystream.str(); + + //Adimensional + double Lref = 1.; + + //MultiLevelMesh ml_msh(nm,nr,infile,"seventh",Lref,SetRefinementFlag); // MultiLevelMesh ml_msh; -// ml_msh.ReadCoarseMesh(infile,"seventh",Lref); +// ml_msh.ReadCoarseMesh(infile.c_str(),"seventh",Lref); return 0; } From 4f3b746ba16e107a845c60052a1752493fa0caaa Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 2 Mar 2015 18:07:40 -0600 Subject: [PATCH 10/91] Started using @todo and @deprecated for doxygen tracking --- src/equations/BoundaryConditions.cpp | 14 +++++++------- src/equations/SystemTwo.cpp | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/equations/BoundaryConditions.cpp b/src/equations/BoundaryConditions.cpp index 95a832375..c39bc56ab 100644 --- a/src/equations/BoundaryConditions.cpp +++ b/src/equations/BoundaryConditions.cpp @@ -30,10 +30,10 @@ namespace femus { }; -//TODO every processor does ALL because bc is SERIAL +//=== every processor does ALL because bc is SERIAL //Now here we have to think how to impose the boundary conditions for KK //Now, the bc_read function orders the boundary condition flags of a QUADRATIC or LINEAR DOF OBJECT. - //TODO The point is that you already have to know the ORDER in which the UNKNOWNS are settled in your system, + //=== The point is that you already have to know the ORDER in which the UNKNOWNS are settled in your system, // FIRST QUADRATIC, THEN LINEAR, THEN CONSTANT. // as a matter of fact, the bc_field should be ordered like a DOF vector, //so have first quadratic, then linear, then constant variables. @@ -46,7 +46,7 @@ namespace femus { // climbing back from Boundary to Volume (we know how to do that) // In order to pick the boundary element, we pick its MIDDLE POINT. - //TODO why don't we better impose the boundary conditions + //=== why don't we better impose the boundary conditions // based on QUANTITIES and then SCALAR COMPONENTS of QUANTITIES? // Then depending on the type of dof you would have to // loop over the DOF OBJECTS generating those dofs! @@ -79,7 +79,7 @@ namespace femus { // it is obvious that I have to use two separate functions //Then the problem is when you try to switch one Quantity from a NODE BASED FE Family to an ELEM BASED FE FAMILY //You have to change the way you ENFORCE the BOUNDARY CONDITIONS. - //TODO the problem is that here we should write things better. + //=== the problem is that here we should write things better. // We should write things in such a way that if we set an equation WITHOUT VARIABLES the code still runs. // Here this does not happen. // if you allocate bc_flag with zero components, then you pass the pointer to the bc_read function which will set the components. @@ -106,13 +106,13 @@ namespace femus { //Now that routine is done in such a way that you have to order FIRST QQ, THEN LL, THEN KK; //In this way you will read correctly -//TODO one thing that may be optimized here is that there are computations that could be avoided when you DO NOT HAVE QQ variables, or LL variables, or KK variables. +//=== one thing that may be optimized here is that there are computations that could be avoided when you DO NOT HAVE QQ variables, or LL variables, or KK variables. // The good thing here would be to have a unique bc array at EACH LEVEL. // The distinction between level is especially good for the elements, because the elements //only belong to ONE level, it's not like the nodes... -//TODO now i am looping over elements first, and nodes inside each element next. +//=== now i am looping over elements first, and nodes inside each element next. //therefore, if an element puts a zero and a following element puts a one, the one wins. //so we must find a way which is independent of the element order //if you loop over the nodes you involve them only once... @@ -128,7 +128,7 @@ namespace femus { //not to superimpose the ones on the zeros? //just put a check before checking -//TODO ricorda che i bc sono praticamente dei dof fields, +//=== ricorda che i bc sono praticamente dei dof fields, // quindi in principio possono essere fatti in PARALLELO! // anche x_old e' un vettore di dof. Alla fine non sono cose //molto diverse in fondo! diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index f8696adbe..c6ae1b084 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -219,10 +219,10 @@ void SystemTwo::initVectors() { //scalar variables and to each of them give a NUMBER which represents the ORDER. // Of course it can only be up to the user to put the right function at the right place! -//TODO AAA: oh this is very interesting... the initial conditions are set IN PARALLEL, +//TTOODDOO AAA: oh this is very interesting... the initial conditions are set IN PARALLEL, // only by the current processor! -//TODO ok the point is this: we are looping over elements, and then over nodes in the element, +//TTOODDOO ok the point is this: we are looping over elements, and then over nodes in the element, //so when we pick the element values we pick them more than once actually... //but that's ok, we do like this so far, otherwise you would need two separate routines, // one for the NODE dofs and one for the ELEM dofs, and if you want to switch a quantity @@ -256,12 +256,12 @@ void SystemTwo::initVectors() { //Probably if you wanted to do Printing with PARALLEL file system // then you would need to give priority to processors first... -//TODO: so far we have a node_dof that is explored based on the FINEST LEVEL for the NODES, +//TTOODDOO: so far we have a node_dof that is explored based on the FINEST LEVEL for the NODES, // and based on EACH LEVEL for the elements. //So, if we want to make it more general, we just put the offsets to be dependent on LEVEL, // and for the nodes they are simply NOT DEPENDENT! -//TODO this function's goal is basically just to fill +//TTOODDOO this function's goal is basically just to fill // the x vector in parallel, and then put it into x_old. //Of course it does this in a GEOMETRIC WAY. // xold is a vector of DOFS, so what we need are the @@ -366,7 +366,7 @@ void SystemTwo::Initialize() { //they are all like just a single linear solver loop, where convergence has already been reached, // and you do another check after the previous one in the linear solver loop //the big question is: -//TODO why dont you do "res_fine < Eps1" +///@todo why dont you do "res_fine < Eps1" // instead of "res_fine < Eps1*(1.+ bNorm_fine)" ??? //because one is for the absolute error and another one is for the relative error /// This function solves the discrete problem with multigrid solver @@ -588,7 +588,7 @@ double SystemTwo::MGStep(int Level, // Level _res[Level]->close(); return rest.second; //it returns the residual norm of whatever level you are in - //TODO if this is the l2_norm then also the nonlinear solver is computed in the l2 norm + // if this is the l2_norm then also the nonlinear solver is computed in the l2 norm //WHAT NORM is THIS?!? l2, but PRECONDITIONED!!! } @@ -650,7 +650,7 @@ void SystemTwo::ReadMGOps(const std::string output_path) { //correctly. It seems like one processor fills it and the other ones do not, //half of the lines seem to be unfilled. -//TODO the std::cerr is not redirected to file, think of redirecting also it to file. +///@todo the std::cerr is not redirected to file, think of redirecting it also to file. // The idea is that every output to terminal must be redirected to file. // so printf must not be used @@ -852,7 +852,7 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { for (int fe=0; feinit(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); //TODO BACK TO a REASONABLE INIT +// // _A[Level]->init(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); ///@todo BACK TO a REASONABLE INIT Graph graph; graph.resize(mrow_glob_t); @@ -959,7 +959,7 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { graph.print(); //=========================== - _A[Level]->update_sparsity_pattern_old(graph); //TODO see how it works + _A[Level]->update_sparsity_pattern_old(graph); // clean =============== graph.clear(); @@ -1003,7 +1003,7 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { //This function depends on _iproc void SystemTwo::ReadProl(const std::string& name) { - _Prl.resize(GetGridn()); //TODO one place is left empty in practice, we can optimize this!!! + _Prl.resize(GetGridn()); ///@todo one place is left empty in practice, we can optimize this!!! for (uint Level = 1; Level< GetGridn(); Level++) { From a72998b610266f609137dcc871c822412bbc8927 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Mon, 2 Mar 2015 18:26:50 -0600 Subject: [PATCH 11/91] added seminorm error and convergence in ex2 --- .../NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 251 ++++++++++++++---- src/solution/XDMFWriter.cpp | 56 ++-- 2 files changed, 232 insertions(+), 75 deletions(-) diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index e9ed7bfc0..a346861f1 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -25,81 +25,128 @@ bool SetBoundaryCondition(const double &x, const double &y, const double &z,cons void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const unsigned &levelMax, const bool &assembleMatrix); +double GetErrorNorm(MultiLevelSolution *mlSol); int main(int argc, char **args) { // init Petsc-MPI communicator FemusInit mpinit(argc, args, MPI_COMM_WORLD); - - // define multilevel mesh + + + // define multilevel mesh MultiLevelMesh mlMsh; // read coarse level mesh and generate finers level meshes double scalingFactor=1.; mlMsh.ReadCoarseMesh("./input/square.neu","seventh",scalingFactor); /* "seventh" is the order of accuracy that is used in the gauss integration scheme - probably in the furure it is not going to be an argument of this function */ - unsigned numberOfUniformLevels=2; - unsigned numberOfSelectiveLevels=0; - mlMsh.RefineMesh(numberOfUniformLevels , numberOfUniformLevels + numberOfSelectiveLevels, NULL); - - // erase all the coarse mesh levels - mlMsh.EraseCoarseLevels(numberOfUniformLevels-1); + probably in the furure it is not going to be an argument of this function */ - // print mesh info - mlMsh.PrintInfo(); + unsigned maxNumberOfMeshes=5; + vector < vector < double > >semiNorm; + semiNorm.resize(maxNumberOfMeshes); + for(unsigned i = 0; i < maxNumberOfMeshes; i++){ // loop on the mesh level + + unsigned numberOfUniformLevels = i+1; + unsigned numberOfSelectiveLevels = 0; + mlMsh.RefineMesh(numberOfUniformLevels , numberOfUniformLevels + numberOfSelectiveLevels, NULL); - for(unsigned i=0;i<2;i++){ - // define the multilevel solution and attach the mlMsh object to it - MultiLevelSolution *mlSol; - mlSol=new MultiLevelSolution(&mlMsh); + // erase all the coarse mesh levels + mlMsh.EraseCoarseLevels(numberOfUniformLevels-1); - // add variables to mlSol - mlSol->AddSolution("u",LAGRANGE, FIRST); - mlSol->Initialize("All"); + // print mesh info + mlMsh.PrintInfo(); - // attach the boundary condition function and generate boundary data - mlSol->AttachSetBoundaryConditionFunction(SetBoundaryCondition); - mlSol->GenerateBdc("u"); + FEOrder feOrder[3] = {FIRST, SERENDIPITY, SECOND}; + semiNorm[i].resize(3); + + for(unsigned j=0; j<3; j++){ // loop on the FE Order + // define the multilevel solution and attach the mlMsh object to it + MultiLevelSolution mlSol(&mlMsh); + + // add variables to mlSol + mlSol.AddSolution("u",LAGRANGE, feOrder[j]); + mlSol.Initialize("All"); - // define the multilevel problem attach the mlSol object to it - MultiLevelProblem *mlProb; - mlProb = new MultiLevelProblem(mlSol); + // attach the boundary condition function and generate boundary data + mlSol.AttachSetBoundaryConditionFunction(SetBoundaryCondition); + mlSol.GenerateBdc("u"); - // add system Poisson in mlProb as a Linear Implicit System - LinearImplicitSystem & system = mlProb->add_system < LinearImplicitSystem > ("Poisson"); + // define the multilevel problem attach the mlSol object to it + MultiLevelProblem mlProb(&mlSol); + + // add system Poisson in mlProb as a Linear Implicit System + LinearImplicitSystem & system = mlProb.add_system < LinearImplicitSystem > ("Poisson"); - // add solution "u" to system - system.AddSolutionToSystemPDE("u"); + // add solution "u" to system + system.AddSolutionToSystemPDE("u"); - // attach the assembling function to system - system.SetAssembleFunction(AssemblePoissonProblem); + // attach the assembling function to system + system.SetAssembleFunction(AssemblePoissonProblem); - // initilaize and solve the system - system.init(); - system.solve(); + // initilaize and solve the system + system.init(); + system.solve(); - // print solutions - std::vector < std::string > variablesToBePrinted; - variablesToBePrinted.push_back("All"); + semiNorm[i][j] = GetErrorNorm(&mlSol); + // print solutions + std::vector < std::string > variablesToBePrinted; + variablesToBePrinted.push_back("All"); - VTKWriter *vtkIO; - vtkIO = new VTKWriter(*mlSol); - vtkIO->write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + VTKWriter vtkIO(mlSol); + vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(*mlSol); - gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - - delete vtkIO; - delete mlProb; - delete mlSol; + GMVWriter gmvIO(mlSol); + gmvIO.SetDebugOutput(true); + gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + } } + + std::cout< &x){ + double pi=acos(-1.); + return cos(pi*x[0])*cos(pi*x[1]); +}; + + +void GetSolutionGradient(const vector < double > &x, vector < double > &solGrad){ + double pi=acos(-1.); + solGrad[0] = -pi*sin(pi*x[0])*cos(pi*x[1]); + solGrad[1] = -pi*cos(pi*x[0])*sin(pi*x[1]); +}; + + +double GetSolutionLaplace(const vector < double > &x){ + double pi=acos(-1.); + return -pi*pi*cos(pi*x[0])*cos(pi*x[1]) - pi*pi*cos(pi*x[0])*cos(pi*x[1]); +}; + /** * This function assemble the stiffnes matrix KK and the residual vector Res * such that @@ -107,7 +154,6 @@ int main(int argc, char **args) { * and consequently * u = u0 + w satisfies KK u = F **/ - void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const unsigned &levelMax, const bool &assembleMatrix) { // ml_prob is the global object from/to where get/set all the data // level is the level of the PDE system to be assembled @@ -231,7 +277,7 @@ void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const un for(unsigned jdim=0; jdim_ml_msh->GetNumberOfLevels()-1u; + // extract pointers to the several objects that we are going to use + Mesh* msh = mlSol->_ml_msh->GetLevel(level); // pointer to the mesh (level) object + elem* el = msh->el; // pointer to the elem object in msh (level) + Solution* sol = mlSol->GetSolutionLevel(level); // pointer to the solution (level) object + + const unsigned dim = msh->GetDimension(); // get the domain dimension of the problem + unsigned iproc = msh->processor_id(); // get the process_id (for parallel computation) + + //solution variable + unsigned soluIndex; + soluIndex = mlSol->GetIndex("u"); // get the position of "u" in the ml_sol object + unsigned soluType = mlSol->GetSolutionType(soluIndex); // get the finite element type for "u" + + vector < double > solu; // local solution + + vector < vector < double > > x(dim); // local coordinates + unsigned xType = 2; // get the finite element type for "x", it is always 2 (LAGRANGE QUADRATIC) + vector phi; // local test function + vector phi_x; // local test function first order partial derivatives + vector phi_xx; // local test function second order partial derivatives + double weight; // gauss point weight + + // reserve memory for the local standar vectors + const unsigned maxSize = static_cast< unsigned > (ceil(pow(3,dim))); // conservative: based on line3, quad9, hex27 + solu.reserve(maxSize); + for(unsigned i = 0; i < dim; i++) + x[i].reserve(maxSize); + phi.reserve(maxSize); + phi_x.reserve(maxSize*dim); + unsigned dim2=(3*(dim-1)+!(dim-1)); // dim2 is the number of second order partial derivatives (1,3,6 depending on the dimension) + phi_xx.reserve(maxSize*dim2); + + double seminorm = 0.; + // element loop: each process loops only on the elements that owns + for (int iel=msh->IS_Mts2Gmt_elem_offset[iproc]; iel < msh->IS_Mts2Gmt_elem_offset[iproc+1]; iel++) { + + unsigned kel = msh->IS_Mts2Gmt_elem[iel]; // mapping between paralell dof and mesh dof + short unsigned kelGeom = el->GetElementType( kel ); // element geometry type + unsigned nDofs = el->GetElementDofNumber( kel, soluType); // number of solution element dofs + unsigned nDofs2 = el->GetElementDofNumber( kel, xType); // number of coordinate element dofs + + // resize local arrays + solu.resize(nDofs); + for(int i=0; iGetMeshDof(kel, i, soluType); // local to global solution node + unsigned solDof = msh->GetMetisDof(iNode, soluType); // global to global mapping between solution node and solution dof + solu[i] = (*sol->_Sol[soluIndex])(solDof); // global extraction and local storage for the solution + } + + // local storage of coordinates + for( unsigned i=0; iGetMeshDof(kel, i, xType); // local to global coordinates node + unsigned xDof = msh->GetMetisDof(iNode, xType); // global to global mapping between coordinates node and coordinate dof + for(unsigned jdim=0; jdim_coordinate->_Sol[jdim])(xDof); // global extraction and local storage for the element coordinates + } + } + + // *** Gauss point loop *** + for(unsigned ig=0; ig < msh->_finiteElement[kelGeom][soluType]->GetGaussPointNumber(); ig++) { + // *** get gauss point weight, test function and test function partial derivatives *** + msh->_finiteElement[kelGeom][soluType]->Jacobian(x,ig,weight,phi,phi_x,phi_xx); + + // evaluate the solution, the solution derivatives and the coordinates in the gauss point + double soluGauss = 0; + vector < double > soluGauss_x(dim,0.); + vector < double > xGauss(dim,0.); + + for(unsigned i=0; i solGrad(dim); + GetSolutionGradient(xGauss, solGrad); + for (unsigned j=0;j n_processors()) { + seminorm_vec->init(msh->n_processors(), 1, false, SERIAL); + } + else { + seminorm_vec->init(msh->n_processors(), 1 , false, PARALLEL); + } + + seminorm_vec->set(iproc, seminorm); + seminorm_vec->close(); + seminorm=seminorm_vec->l1_norm(); + + delete seminorm_vec; + + return sqrt(seminorm); + +} diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 978f6a2be..7adb756f0 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -68,6 +68,8 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha { #ifdef HAVE_HDF5 + MultiLevelMesh *mlMsh = _ml_sol._ml_msh; + bool test_all=!(vars[0].compare("All")); unsigned index=0; @@ -87,7 +89,7 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha //I assume that the mesh is not mixed std::string type_elem; - unsigned elemtype = _ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementType(0); + unsigned elemtype = mlMsh->GetLevel(_gridn-1u)->el->GetElementType(0); type_elem = XDMFWriter::type_el[index][elemtype]; if (type_elem.compare("Not_implemented") == 0) @@ -98,19 +100,19 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha unsigned nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); + unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); nvt+=nvt_ig; } // Printing connectivity unsigned nel=0; for(unsigned ig=0;ig<_gridn-1u;ig++) { - nel+=( _ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements() - _ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementNumber()); + nel+=( mlMsh->GetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); } - nel+=_ml_sol._ml_msh->GetLevel(_gridn-1u)->GetNumberOfElements(); + nel+=mlMsh->GetLevel(_gridn-1u)->GetNumberOfElements(); unsigned icount; - unsigned el_dof_number = _ml_sol._ml_msh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index); + unsigned el_dof_number = mlMsh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index); int *var_int = new int [nel*el_dof_number]; float *var_el_f = new float [nel]; float *var_nd_f = new float [nvt]; @@ -216,14 +218,14 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { NumericVector* mysol; mysol = NumericVector::build().release(); - //mysol->init(_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol._ml_msh->GetLevel(ig)->_coordinate->_Sol[i],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); + //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); + mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); + unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iimatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)][ig]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)][ig]); for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); iel++) { - if (_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { - for (unsigned j=0; j<_ml_sol._ml_msh->GetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { + for (unsigned iel=0; ielGetLevel(ig)->GetNumberOfElements(); iel++) { + if (mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { + for (unsigned j=0; jGetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { unsigned vtk_loc_conn = map_pr[j]; - unsigned jnode=_ml_sol._ml_msh->GetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; - unsigned jnode_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(jnode,index_nd); + unsigned jnode=mlMsh->GetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; + unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index_nd); var_int[icount] = offset_conn + jnode_Metis; icount++; } } } - offset_conn += _ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); + offset_conn += mlMsh->GetLevel(ig)->GetDofNumber(index_nd); } dimsf[0] = nel*el_dof_number ; dimsf[1] = 1; @@ -276,10 +278,10 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha // print regions icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,3); - var_int[icount] = _ml_sol._ml_msh->GetLevel(ig)->el->GetElementGroup(iel_Metis); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); + var_int[icount] = mlMsh->GetLevel(ig)->el->GetElementGroup(iel_Metis); icount++; } } @@ -300,9 +302,9 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha if (_ml_sol.GetSolutionType(indx)>=3) { icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_sol._ml_msh->GetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==_ml_sol._ml_msh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_sol._ml_msh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); var_el_f[icount]=(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx])(iel_Metis); icount++; } @@ -329,10 +331,10 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { NumericVector* mysol; mysol = NumericVector::build().release(); - //mysol->init(_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(_ml_sol._ml_msh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_sol._ml_msh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],_ml_sol._ml_msh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); - unsigned nvt_ig=_ml_sol._ml_msh->GetLevel(ig)->GetDofNumber(index_nd); + //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); + mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); + unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; ii Date: Mon, 2 Mar 2015 19:06:29 -0600 Subject: [PATCH 12/91] fixed error in projection matrix writer --- applications/FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- src/solution/GMVWriter.cpp | 12 ++++++------ src/solution/VTKWriter.cpp | 6 +++--- src/solution/XDMFWriter.cpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index b7907b402..19ea18324 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -373,7 +373,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(VTK); + ml_sol.SetWriter(GMV); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index cb9bc5fbc..97cae312f 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -102,7 +102,7 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char for (int i=0; i<3; i++) { for (unsigned ig=igridr-1u; igmatrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][2][ig]); + Mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][2]); vector v_local; Mysol[ig]->localize_to_one(v_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; @@ -112,7 +112,7 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char } if (_moving_mesh && mlMsh->GetLevel(0)->GetDimension() > i) { unsigned indDXDYDZ=_ml_sol.GetIndex(_moving_vars[i].c_str()); - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)]); Mysol[ig]->localize_to_one(v_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ @@ -243,16 +243,16 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char fout.write((char *)&one,sizeof(unsigned)); for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); } else if (name==1){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); } else if (name==2){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); } else{ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)][ig]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); } std::vector v_local; Mysol[ig]->localize_to_one(v_local,0); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 7cdcf52dd..b1e9aa187 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -162,7 +162,7 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char std::vector v_local; unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kk<3;kk++) { - mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); + mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2]); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; i v_local; unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kkGetLevel(0)->GetDimension();kk++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indDXDYDZ[kk])][ig]); + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indDXDYDZ[kk])]); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; imatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)]); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index e290719cf..99033c2bb 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -220,12 +220,12 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha mysol = NumericVector::build().release(); //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2][ig]); + mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2]); unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iimatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)][ig]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)]); for (unsigned ii=0; iiinit(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)][ig]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)]); unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; ii Date: Tue, 3 Mar 2015 08:34:04 -0600 Subject: [PATCH 13/91] fixed DZ in FSI --- applications/FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 19ea18324..d24a8b2e2 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -225,7 +225,7 @@ int main(int argc,char **args) { //Start System Variables ml_sol.AddSolution("DX",LAGRANGE,SECOND,1); ml_sol.AddSolution("DY",LAGRANGE,SECOND,1); - //ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); + if (!dimension2D) ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); //if (!dimension2D) ml_sol.AddSolution("DZ",LAGRANGE,SECOND,1); ml_sol.AddSolution("U",LAGRANGE,SECOND,1); ml_sol.AddSolution("V",LAGRANGE,SECOND,1); From 67d9113804551f095b7c8e9074adf4631b6b6457 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Tue, 3 Mar 2015 13:47:00 -0600 Subject: [PATCH 14/91] Improved MultiLevelMesh constructor --- src/mesh/MultiLevelMesh.cpp | 15 +++++++++------ src/mesh/MultiLevelMesh.hpp | 2 +- unittests/testSalomeIO/testSalomeIO.cpp | 3 +-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index fbb7b693d..57e976389 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -35,21 +35,24 @@ using std::cout; using std::endl; MultiLevelMesh::~MultiLevelMesh() { - for (unsigned i=0; i<_gridn0; i++) { + + for (unsigned i=0; i<_level0.size(); i++) { delete _level0[i]; } + for(unsigned i=0;i<6;i++){ - if(i==5 || _finiteElementGeometryFlag[i]) + if( _finiteElementGeometryFlag[i]) for(unsigned j=0;j<5;j++){ delete _finiteElement[i][j]; } } -}; + +} //--------------------------------------------------------------------------------------------------- -MultiLevelMesh::MultiLevelMesh() { +MultiLevelMesh::MultiLevelMesh(): _gridn0(0),_gridr0(0) { - _finiteElementGeometryFlag.resize(5,false); + _finiteElementGeometryFlag.resize(6,false); for(int i=0; i<6; i++) { for(int j=0; j<5; j++) { @@ -96,7 +99,7 @@ MultiLevelMesh::MultiLevelMesh() { _finiteElement[4][3]=new const elem_type_2D("tri","constant",GaussOrder); _finiteElement[4][4]=new const elem_type_2D("tri","disc_linear",GaussOrder); } - + _finiteElementGeometryFlag[5]=1; _finiteElement[5][0]=new const elem_type_1D("line","linear",GaussOrder); _finiteElement[5][1]=new const elem_type_1D("line","quadratic",GaussOrder); _finiteElement[5][2]=new const elem_type_1D("line","biquadratic",GaussOrder); diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index de92a17b0..6cb6645f5 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -38,7 +38,7 @@ class MultiLevelMesh { public: - /** @deprecated, if you instantiate with this without calling other functions later, the destructor at the end gives seg fault clearly */ + /** Constructor */ MultiLevelMesh(); MultiLevelMesh(const unsigned short &igridn,const unsigned short &igridr, diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 4c4e184d0..b0fa03302 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -19,8 +19,7 @@ int main(int argc,char **args) { //Adimensional double Lref = 1.; - //MultiLevelMesh ml_msh(nm,nr,infile,"seventh",Lref,SetRefinementFlag); -// MultiLevelMesh ml_msh; + MultiLevelMesh ml_msh; // ml_msh.ReadCoarseMesh(infile.c_str(),"seventh",Lref); return 0; From 3b8cba297cf450de5321becd12fd4b045aa09f7e Mon Sep 17 00:00:00 2001 From: eaulisa Date: Tue, 3 Mar 2015 14:01:28 -0600 Subject: [PATCH 15/91] moved mesh projection in mesh --- src/equations/LinearImplicitSystem.cpp | 2 +- src/mesh/Mesh.cpp | 12 +++++++++ src/mesh/Mesh.hpp | 7 +++-- src/mesh/MeshRefinement.cpp | 17 ++++++------ src/solution/MultiLevelSolution.cpp | 37 ++++++++++---------------- src/solution/Solution.cpp | 4 --- src/solution/Solution.hpp | 4 --- 7 files changed, 40 insertions(+), 43 deletions(-) diff --git a/src/equations/LinearImplicitSystem.cpp b/src/equations/LinearImplicitSystem.cpp index 50abd59b1..c94a7768e 100644 --- a/src/equations/LinearImplicitSystem.cpp +++ b/src/equations/LinearImplicitSystem.cpp @@ -403,7 +403,7 @@ void LinearImplicitSystem::ProlongatorSol(unsigned gridf) { unsigned SolIndex=_SolSystemPdeIndex[k]; unsigned Typeindex=_ml_sol->GetSolutionType(SolIndex); - _solution[gridf]->_Sol[SolIndex]->matrix_mult(*_solution[gridf-1]->_Sol[SolIndex],*_solution[gridf]->_ProjMat[Typeindex]); + _solution[gridf]->_Sol[SolIndex]->matrix_mult(*_solution[gridf-1]->_Sol[SolIndex],*_msh[gridf]->_ProjMat[Typeindex]); _solution[gridf]->_Sol[SolIndex]->close(); } } diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index f12be285c..873d75306 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -47,6 +47,12 @@ unsigned Mesh::_ref_index=4; // 8*DIM[2]+4*DIM[1]+2*DIM[0]; unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; //------------------------------------------------------------------------------------------------------ +Mesh::Mesh(){ + for(int i=0;i<5;i++){ + _ProjMat[i]=NULL; + } +} + Mesh::~Mesh(){ delete el; @@ -62,6 +68,12 @@ Mesh::~Mesh(){ } } + for (unsigned i=0; i<5; i++) { + if (_ProjMat[i]) { + delete _ProjMat[i]; + } + } + } diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index d6c02fc3d..428dea15f 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -45,7 +45,7 @@ class Mesh : public ParallelObject { /** Constructor */ explicit - Mesh() {}; + Mesh(); /** destructor */ ~Mesh(); @@ -167,7 +167,10 @@ class Mesh : public ParallelObject { SparseMatrix* _ProlQitoQj[3][3]; void BuildLagrangeProlongatorMatrices(); - + + /** one for every type of variable */ + SparseMatrix* _ProjMat[5]; + private: /** To be added */ diff --git a/src/mesh/MeshRefinement.cpp b/src/mesh/MeshRefinement.cpp index b879061b6..25de94c0a 100644 --- a/src/mesh/MeshRefinement.cpp +++ b/src/mesh/MeshRefinement.cpp @@ -302,8 +302,7 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t //build projection Matrix unsigned thisSolType=2; - if(_mesh._coordinate->_ProjMatFlag[thisSolType]==0){ - _mesh._coordinate->_ProjMatFlag[thisSolType]=1; + if (!_mesh._ProjMat[thisSolType]){ int nf = _mesh.MetisOffset[thisSolType][_nprocs]; int nc = mshc->MetisOffset[thisSolType][_nprocs]; @@ -344,8 +343,8 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t delete NNZ_o; //build matrix - _mesh._coordinate->_ProjMat[thisSolType] = SparseMatrix::build().release(); - _mesh._coordinate->_ProjMat[thisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); + _mesh._ProjMat[thisSolType] = SparseMatrix::build().release(); + _mesh._ProjMat[thisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); // loop on the coarse grid for(int isdom=_iproc; isdom<_iproc+1; isdom++) { for (int iel_mts=mshc->IS_Mts2Gmt_elem_offset[isdom]; @@ -353,16 +352,16 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if( mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt= mshc->el->GetElementType(iel); - _mesh._finiteElement[ielt][thisSolType]->BuildProlongation(_mesh,*mshc,iel,_mesh._coordinate->_ProjMat[thisSolType]); + _mesh._finiteElement[ielt][thisSolType]->BuildProlongation(_mesh,*mshc,iel,_mesh._ProjMat[thisSolType]); } } } - _mesh._coordinate->_ProjMat[thisSolType]->close(); + _mesh._ProjMat[thisSolType]->close(); } - _mesh._coordinate->_Sol[0]->matrix_mult(*mshc->_coordinate->_Sol[0],*_mesh._coordinate->_ProjMat[thisSolType]); - _mesh._coordinate->_Sol[1]->matrix_mult(*mshc->_coordinate->_Sol[1],*_mesh._coordinate->_ProjMat[thisSolType]); - _mesh._coordinate->_Sol[2]->matrix_mult(*mshc->_coordinate->_Sol[2],*_mesh._coordinate->_ProjMat[thisSolType]); + _mesh._coordinate->_Sol[0]->matrix_mult(*mshc->_coordinate->_Sol[0],*_mesh._ProjMat[thisSolType]); + _mesh._coordinate->_Sol[1]->matrix_mult(*mshc->_coordinate->_Sol[1],*_mesh._ProjMat[thisSolType]); + _mesh._coordinate->_Sol[2]->matrix_mult(*mshc->_coordinate->_Sol[2],*_mesh._ProjMat[thisSolType]); _mesh._coordinate->_Sol[0]->close(); _mesh._coordinate->_Sol[1]->close(); _mesh._coordinate->_Sol[2]->close(); diff --git a/src/solution/MultiLevelSolution.cpp b/src/solution/MultiLevelSolution.cpp index 52422f34b..f2e47fe2e 100644 --- a/src/solution/MultiLevelSolution.cpp +++ b/src/solution/MultiLevelSolution.cpp @@ -157,15 +157,6 @@ void MultiLevelSolution::PairSolution(const char solution_name[], const char sol // ******************************************************* - - - - - - - - - void MultiLevelSolution::Initialize(const char name[], initfunc func) { unsigned i_start; @@ -286,18 +277,18 @@ void MultiLevelSolution::BuildProlongatorMatrix(unsigned gridf, unsigned SolInde exit(0); } - unsigned ThisSolType=_SolType[SolIndex]; + unsigned thisSolType=_SolType[SolIndex]; + + Mesh* mshf = _ml_msh->GetLevel(gridf); - if(_solution[gridf]->_ProjMatFlag[ThisSolType]==0){ - _solution[gridf]->_ProjMatFlag[ThisSolType]=1; + if( !mshf->_ProjMat[thisSolType] ){ - Mesh* mshf = _ml_msh->GetLevel(gridf); Mesh* mshc = _ml_msh->GetLevel(gridf-1); - int nf = mshf->MetisOffset[ThisSolType][_nprocs]; - int nc = mshc->MetisOffset[ThisSolType][_nprocs]; - int nf_loc = mshf->own_size[ThisSolType][_iproc]; - int nc_loc = mshc->own_size[ThisSolType][_iproc]; + int nf = mshf->MetisOffset[thisSolType][_nprocs]; + int nc = mshc->MetisOffset[thisSolType][_nprocs]; + int nf_loc = mshf->own_size[thisSolType][_iproc]; + int nc_loc = mshc->own_size[thisSolType][_iproc]; //build matrix sparsity pattern size @@ -314,14 +305,14 @@ void MultiLevelSolution::BuildProlongatorMatrix(unsigned gridf, unsigned SolInde unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - _ml_msh->_finiteElement[ielt][ThisSolType]->GetSparsityPatternSize(*mshf, *mshc, iel, NNZ_d, NNZ_o); + _ml_msh->_finiteElement[ielt][thisSolType]->GetSparsityPatternSize(*mshf, *mshc, iel, NNZ_d, NNZ_o); } } } NNZ_d->close(); NNZ_o->close(); - unsigned offset = mshf->MetisOffset[ThisSolType][_iproc]; + unsigned offset = mshf->MetisOffset[thisSolType][_iproc]; vector nnz_d(nf_loc); vector nnz_o(nf_loc); for(int i=0; i_ProjMat[ThisSolType] = SparseMatrix::build().release(); - _solution[gridf]->_ProjMat[ThisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); + mshf->_ProjMat[thisSolType] = SparseMatrix::build().release(); + mshf->_ProjMat[thisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); // loop on the coarse grid for(int isdom=_iproc; isdom<_iproc+1; isdom++) { @@ -344,11 +335,11 @@ void MultiLevelSolution::BuildProlongatorMatrix(unsigned gridf, unsigned SolInde unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - _ml_msh->_finiteElement[ielt][ThisSolType]->BuildProlongation(*mshf,*mshc,iel, _solution[gridf]->_ProjMat[ThisSolType]); + _ml_msh->_finiteElement[ielt][thisSolType]->BuildProlongation(*mshf,*mshc,iel, mshf->_ProjMat[thisSolType]); } } } - _solution[gridf]->_ProjMat[ThisSolType]->close(); + mshf->_ProjMat[thisSolType]->close(); } } diff --git a/src/solution/Solution.cpp b/src/solution/Solution.cpp index 8ce90d81a..a39b03003 100644 --- a/src/solution/Solution.cpp +++ b/src/solution/Solution.cpp @@ -38,7 +38,6 @@ using std::endl; Solution::Solution(Mesh *other_msh){ _msh = other_msh; for(int i=0;i<5;i++){ - _ProjMatFlag[i]=0; _GradMat[i].resize(_msh->GetDimension()); _AMR_flag=0; } @@ -193,9 +192,6 @@ void Solution::FreeSolutionVectors() { delete _AMREps[i]; } for (unsigned i=0; i<5; i++) { - if (_ProjMatFlag[i]) { - delete _ProjMat[i]; - } for(int j=0;j<_msh->GetDimension();j++){ if(_GradMat[i][j]){ delete _GradMat[i][j]; diff --git a/src/solution/Solution.hpp b/src/solution/Solution.hpp index decdb5067..694cd2ea7 100644 --- a/src/solution/Solution.hpp +++ b/src/solution/Solution.hpp @@ -104,10 +104,6 @@ class Solution : public ParallelObject { vector _ResEpsBdcFlag; vector < vector > _GradVec; - - /** one for every type of variable */ - SparseMatrix* _ProjMat[5]; - bool _ProjMatFlag[5]; vector _GradMat[5]; // bool _GradMatFlag[5]; From aa4de74b57c2a24ab2aa3e8281d59d5f44d31ca5 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Tue, 3 Mar 2015 15:11:45 -0600 Subject: [PATCH 16/91] Reading multiple mesh menus in the same MED file --- src/mesh/SalomeIO.cpp | 40 ++++++++++++++++---- src/mesh/SalomeIO.hpp | 4 +- unittests/testSalomeIO/input/two_meshes.med | Bin 0 -> 31415 bytes unittests/testSalomeIO/testSalomeIO.cpp | 4 +- 4 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 unittests/testSalomeIO/input/two_meshes.med diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index 65e1ba347..ea0b7de77 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -73,11 +73,36 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords // later on we will have to relax this assumption, which implies probably adding one argument either in this function, or better in the constructor // (in any case, that would remove polymorphism for the children of MeshInput) -// unsigned found = name.find_last_of("/"); -// unsigned found2 = name.find_last_of("."); -// mesh_menu = name.substr(0,found2); - - + hsize_t dims[2]; + std::string el_fem_type_vol(""); + std::string el_fem_type_bd(""); + + hid_t file_id = H5Fopen(name.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); + + hid_t gid = H5Gopen(file_id,mesh_ensemble.c_str(),H5P_DEFAULT); + + hsize_t n_menus; + hid_t status= H5Gget_num_objs(gid, &n_menus); // number of menus + if(status !=0) { std::cout << "Number of mesh menus not found"; abort(); } + + std::vector itype_vol; + itype_vol.resize(n_menus); + menu_names.resize(n_menus); + uint menu_max_length = 100; ///@todo this length of the menu string is conservative enough... + for (unsigned j=0; j > &coords int SalomeIO::ReadFE( hid_t file_id, std::string & el_fem_type_vol, - std::string & el_fem_type_bd + std::string & el_fem_type_bd, + const std::string menu_name ) { Mesh& mesh = GetMesh(); @@ -324,7 +350,7 @@ int SalomeIO::ReadFE( fem_type_bd["SE2"] = 0; fem_type_bd["SE3"] = 0; } - std::string my_mesh_name_dir = mesh_ensemble + "/" + mesh_menu + "/" + aux_zeroone + "/" + connectivity + "/"; + std::string my_mesh_name_dir = mesh_ensemble + "/" + menu_name + "/" + aux_zeroone + "/" + connectivity + "/"; ///@todo here we have to loop hid_t gid=H5Gopen(file_id,my_mesh_name_dir.c_str(),H5P_DEFAULT); // group identity hsize_t n_fem_type; diff --git a/src/mesh/SalomeIO.hpp b/src/mesh/SalomeIO.hpp index 8961c6200..a6564f4e1 100644 --- a/src/mesh/SalomeIO.hpp +++ b/src/mesh/SalomeIO.hpp @@ -62,9 +62,9 @@ class SalomeIO : public MeshInput static const unsigned GambitToFemusFaceIndex[6][6]; /** Read FE type */ - int ReadFE(hid_t file_id, std::string & el_fem_type_vol, std::string & el_fem_type_bd); + int ReadFE(hid_t file_id, std::string & el_fem_type_vol, std::string & el_fem_type_bd, const std::string menu_name); - std::string mesh_menu; //Mesh_1; strip from file name by removing .med + std::vector menu_names; static const std::string group_name_begin; //FAS static const std::string group_name_end; //ELEME static const std::string mesh_ensemble; // ENS_MAA diff --git a/unittests/testSalomeIO/input/two_meshes.med b/unittests/testSalomeIO/input/two_meshes.med new file mode 100644 index 0000000000000000000000000000000000000000..49bfe7fdca6895d8f7b139775b5ddafbd8dd6daa GIT binary patch literal 31415 zcmeI530zOv|NlRU>`QiIne2wFVKBIrN=BO&`@UrNjSxe2*>@UQqY&BCqHs$^yFQh{ zU^E6_V>gyzX7GQ#&b=R`q_3~}{%7XbeRzIOpL5SS@ArA1bI*C7`#JYoWNl$pve;+E z3KS`#(H*bUBlH_3rkQ%8{cQJD_SP1T1&kW~`-$`0Oes*7X>=KNVX*=lJ&nfTGYx{$ zUF@vvod$Haw6kf3~YzFj~LLrEY-qc@K$7t&s!;xnkH(P=b+!!Y3GGX zHQ#Ps{%xuEVSBpMJ~#>~Hq#iGP}2sDn`Jwi=M!s;IkWHmWV!NHwC`0d*bmb%x@v|H}Oj6r(E%jlrVw5*k$HqLmX;X>|Ij7phvOt~3gB&`g00Ha!ndRg$i8b>U9WqIb=m zZLA>oKGR{4c=bx7+1#ynAx&*&t*JyfTkbER*~b)Wgt`0J8k#TPiuiK4?5J782(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/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index b0fa03302..41edc345e 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -12,7 +12,7 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); - std::string med_file = "Mesh_1.med"; + std::string med_file = "two_meshes.med"; std::ostringstream mystream; mystream << "./" << DEFAULT_CONFIGDIR << "/" << med_file; const std::string infile = mystream.str(); @@ -20,7 +20,7 @@ int main(int argc,char **args) { double Lref = 1.; MultiLevelMesh ml_msh; -// ml_msh.ReadCoarseMesh(infile.c_str(),"seventh",Lref); + ml_msh.ReadCoarseMesh(infile.c_str(),"seventh",Lref); return 0; } From f0124f3341abb4370f17dd5352f4984ffde537e4 Mon Sep 17 00:00:00 2001 From: eaulisa Date: Tue, 3 Mar 2015 16:18:54 -0600 Subject: [PATCH 17/91] cleaning the mesh class --- .../NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 8 ++-- src/mesh/Mesh.cpp | 42 ++++++++----------- src/mesh/Mesh.hpp | 4 +- src/mesh/MeshMetisPartitioning.cpp | 6 +-- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index a346861f1..98ed5fd77 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -41,8 +41,8 @@ int main(int argc, char **args) { /* "seventh" is the order of accuracy that is used in the gauss integration scheme probably in the furure it is not going to be an argument of this function */ - unsigned maxNumberOfMeshes=5; - vector < vector < double > >semiNorm; + unsigned maxNumberOfMeshes = 5; + vector < vector < double > > semiNorm; semiNorm.resize(maxNumberOfMeshes); for(unsigned i = 0; i < maxNumberOfMeshes; i++){ // loop on the mesh level @@ -102,10 +102,10 @@ int main(int argc, char **args) { } } - + // print the seminorm of the error and the order of convergence between different levels std::cout<FreeSolutionVectors(); delete _coordinate; - delete [] epart; - delete [] npart; for (int itype=0; itype<3; itype++) { for (int jtype=0; jtype<3; jtype++) { - delete _ProlQitoQj[itype][jtype]; - _ProlQitoQj[itype][jtype] = NULL; + if(_ProlQitoQj[itype][jtype]){ + delete _ProlQitoQj[itype][jtype]; + _ProlQitoQj[itype][jtype] = NULL; + } } } for (unsigned i=0; i<5; i++) { if (_ProjMat[i]) { delete _ProjMat[i]; + _ProjMat[i]=NULL; } - } - - -} + } + } /// print Mesh info void Mesh::PrintInfo() { @@ -118,7 +123,6 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto MeshMetisPartitioning meshmetispartitioning(*this); meshmetispartitioning.DoPartition(); - //GenerateMetisMeshPartition(); FillISvector(); @@ -140,15 +144,9 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto _coordinate->ResizeSolutionVector("Y"); _coordinate->ResizeSolutionVector("Z"); - //_coordinate->SetCoarseCoordinates(coords); _coordinate->GetSolutionName("X") = coords[0]; _coordinate->GetSolutionName("Y") = coords[1]; _coordinate->GetSolutionName("Z") = coords[2]; -// *ppi = coords[0]; - -// = coords[0]; -// _coordinate->GetSolutionName("Y") = coords[1]; -// _coordinate->GetSolutionName("Z") = coords[2]; _coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); @@ -180,7 +178,6 @@ void Mesh::GenerateCoarseBoxMesh( MeshMetisPartitioning meshmetispartitioning(*this); meshmetispartitioning.DoPartition(); - //GenerateMetisMeshPartition(); FillISvector(); @@ -424,9 +421,6 @@ void Mesh::SetFiniteElementPtr(const elem_type * OtherFiniteElement[6][5]){ - - - void Mesh::FillISvector() { //dof map: piecewise liner 0, quadratic 1, biquadratic 2, piecewise constant 3, picewise discontinous linear 4 diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 428dea15f..9ecafbc4a 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -157,8 +157,8 @@ class Mesh : public ParallelObject { vector< vector > ghost_nd_mts[5]; vector ghost_size[5]; elem *el; //< elements - int *epart; - int *npart; + vector < int > epart; + vector < int > npart; int nsubdom; static bool (* _SetRefinementFlag)(const double &x, const double &y, const double &z, const int &ElemGroupNumber,const int &level); diff --git a/src/mesh/MeshMetisPartitioning.cpp b/src/mesh/MeshMetisPartitioning.cpp index 932bd7799..33efb10b3 100644 --- a/src/mesh/MeshMetisPartitioning.cpp +++ b/src/mesh/MeshMetisPartitioning.cpp @@ -92,13 +92,13 @@ void MeshMetisPartitioning::DoPartition() { int ncommon = _mesh.GetDimension()+1; _mesh.nsubdom = _nprocs; - _mesh.epart = new int [nelem]; - _mesh.npart = new int [nnodes]; + _mesh.epart.resize(nelem); + _mesh.npart.resize(nnodes); if(_mesh.nsubdom!=1) { //I call the Mesh partioning function of Metis library (output is epart(own elem) and npart (own nodes)) - int err = METIS_PartMeshDual(&nelem, &nnodes, eptr, eind, NULL, NULL, &ncommon, &_mesh.nsubdom, NULL, options, &objval, _mesh.epart, _mesh.npart); + int err = METIS_PartMeshDual(&nelem, &nnodes, eptr, eind, NULL, NULL, &ncommon, &_mesh.nsubdom, NULL, options, &objval, &_mesh.epart[0], &_mesh.npart[0]); if(err==METIS_OK) { //std::cout << " METIS PARTITIONING IS OK " << std::endl; From a651c33e505c241c6ead9815f4b16f5d47c251cc Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Tue, 3 Mar 2015 17:31:14 -0600 Subject: [PATCH 18/91] Determine dimension from reading MED mesh file --- src/mesh/SalomeIO.cpp | 98 ++++++++++++++++++++---- src/mesh/SalomeIO.hpp | 1 + unittests/testSalomeIO/input/Cube3d.med | Bin 0 -> 17809 bytes unittests/testSalomeIO/testSalomeIO.cpp | 2 +- 4 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 unittests/testSalomeIO/input/Cube3d.med diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index ea0b7de77..18f1b51e9 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -31,6 +31,7 @@ namespace femus { const std::string SalomeIO::aux_zeroone = "-0000000000000000001-0000000000000000001"; const std::string SalomeIO::connectivity = "MAI"; const std::string SalomeIO::node_coord = "NOE/COO"; + const uint SalomeIO::max_length = 100; ///@todo this length of the menu string is conservative enough... @@ -68,11 +69,10 @@ const unsigned SalomeIO::GambitToFemusFaceIndex[6][6]= void SalomeIO::read(const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag) { - - //we assume that the mesh file name is the same as the menu. Therefore, we have to use BASENAME much like we do in the shell - // later on we will have to relax this assumption, which implies probably adding one argument either in this function, or better in the constructor - // (in any case, that would remove polymorphism for the children of MeshInput) - + + Mesh& mesh = GetMesh(); + mesh.SetGridNumber(0); + hsize_t dims[2]; std::string el_fem_type_vol(""); std::string el_fem_type_bd(""); @@ -88,22 +88,65 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords std::vector itype_vol; itype_vol.resize(n_menus); menu_names.resize(n_menus); - uint menu_max_length = 100; ///@todo this length of the menu string is conservative enough... for (unsigned j=0; j elem_list; elem_list.resize(n_fem_type); + for (unsigned j=0; j < elem_list.size(); j++) { + elem_list[j] = new char[max_length]; + H5Gget_objname_by_idx(gid,j,elem_list[j],max_length); ///@deprecated see the HDF doc to replace this + std::string tempj(elem_list[j]); + + if ( tempj.compare("HE8") == 0 || + tempj.compare("H20") == 0 || + tempj.compare("H27") == 0 || + tempj.compare("TE4") == 0 || + tempj.compare("T10") == 0 ) { mydim = 3; } + else if ( tempj.compare("QU4") == 0 || + tempj.compare("QU8") == 0 || + tempj.compare("QU9") == 0 || + tempj.compare("TR3") == 0 || + tempj.compare("TR6") == 0 ) { mydim = 2; } + + if ( mydim > mesh.GetDimension() ) mesh.SetDimension(mydim); + + } //end for + // --------- Reading Element type (From salome to LIBMESH (itype_vol))------ std::map< std::string, int > fem_type_vol;// Salome fem table name (vol) fem_type_vol["HE8"] = 5; fem_type_vol["H20"] = 20; fem_type_vol["H27"] = 12; @@ -350,12 +422,6 @@ int SalomeIO::ReadFE( fem_type_bd["SE2"] = 0; fem_type_bd["SE3"] = 0; } - std::string my_mesh_name_dir = mesh_ensemble + "/" + menu_name + "/" + aux_zeroone + "/" + connectivity + "/"; ///@todo here we have to loop - - hid_t gid=H5Gopen(file_id,my_mesh_name_dir.c_str(),H5P_DEFAULT); // group identity - hsize_t n_fem_type; - hid_t status= H5Gget_num_objs(gid, &n_fem_type); // number of links - if(status !=0) {std::cout << "SalomeIO::read_fem_type: H5Gget_num_objs not found"; abort();} // Get the element name from MESH_NAME_DIR in the file med (el_name) char **el_fem_type=new char*[n_fem_type]; diff --git a/src/mesh/SalomeIO.hpp b/src/mesh/SalomeIO.hpp index a6564f4e1..223cb6f0e 100644 --- a/src/mesh/SalomeIO.hpp +++ b/src/mesh/SalomeIO.hpp @@ -71,6 +71,7 @@ class SalomeIO : public MeshInput static const std::string aux_zeroone; // -0000000000000000001-0000000000000000001 static const std::string connectivity; // MAI static const std::string node_coord; //NOE/COO + static const uint max_length; }; diff --git a/unittests/testSalomeIO/input/Cube3d.med b/unittests/testSalomeIO/input/Cube3d.med new file mode 100644 index 0000000000000000000000000000000000000000..1dc3ca57130c9e621d4c7ae53d48df8421ad49b5 GIT binary patch literal 17809 zcmeHOYiv}<6`r-@w;eDg5NMLxaR3uTdA~vuy!P(eYwyF}U1RgKdDuJ>62JirfwqcT z(I}6K5=BU9qxMHp(*mjrRcNaesp-F_5j1~js;W(^MoE>ZwwgAfN<_c!-h0gM?7e#z zSXac_k-j~5=AJp{%$eD_-<`FeZuJGK%BPnXl$I(fSFLi)Z???0ZuI=2yE@wHixt%T zpy@w}WDFHdqKA=a-IgA1Wvx<$xKYWQVQ-t7h@9XO zrA8Itvk*vC3P#eDsGgz}^M}%unC!p5@miC8?3vS9&D0c!`vR}ile&DctNA%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?nxmvPqw$U~vZBsYdb_wdVO-bAIMced6+l+y>*-qQkD+eloDgex6l!poj z75*vQQ+TIv&U?|P4j>Vj3Ghov(!huA9AK;q^Tr%9C(H-O$nkP)94GT9W90nEIGIP# z6IafifgHWC5dBe{$k7WH|Fb6?Bu77)XIeOAiX?KhUW_v4q;j&TGUU2Bc6P0}WIYh} z{{GO<+{n~r%f84=58+EoOyxf28^wNXpO1&|hJP$dj2)S}gzTi`!HF+wO7>)G*50oT zxXq)GD3O`waRJ}uQ2LC|&-XlDJ^bFJT;}H3ILeKB_xUc@{Q`fWHpF*-l+M4d`mcGF z|IB9~pMg;xM;^gvs_;1SEk7V#teRQzy!9Gm!|Z}t~Ih zBrjbGkbiQ&t^-yAvw?>J^3X3W^l(QNFP9d^xXmkff>L|fU#4Tu~!3({ceDN0lfGxj+^BR~$# z*cl6BuK^hQbbzr>1B9o`IM~MfG7jdCxs!3wC;iJfm_O!D#v#02#u3B4IFJCkfYm@Z z&;zUi)&lE*^}q&TBhU-<0h@r$z!qRD&<_j%+koxB4q&W{ zd7Fi6nbZ4mEqUQOXRbM~TsIls56*EeQK-hEAD*7$xNE^csP zK8ML!%K&m+@`QFk+W9;rkC1lqYd*vEI{7r8q2$!$AiBK*wABKlN6u0N(D$7HeUr=6 zH#xYp(|1WyJAIQAiJsKyoBW8r`JmA4(RVQ*dR4e?1IV3Q0dk`-K+@9zkoSfFa$oXh z@}^Dz?8e}rx<2`AGa!7u0@vh8Vy7I}%K@=N-{g4oP2Nl2;awtb^?z9n}A+m zKX4G}12zJ>{${jo0ff)5!!>!o*jbC~^?=x6Y^wpr)(tSW9)Pi}0d@hqfk9v&Fa#U| a4g*I3x59P7b Date: Tue, 3 Mar 2015 18:10:45 -0600 Subject: [PATCH 19/91] Coordinates read in MED file --- src/mesh/SalomeIO.cpp | 65 ++++++++++++++++--- unittests/testSalomeIO/input/StudyCube3d.hdf | Bin 0 -> 177002 bytes unittests/testSalomeIO/testSalomeIO.cpp | 2 +- 3 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 unittests/testSalomeIO/input/StudyCube3d.hdf diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index 18f1b51e9..c86e7e41e 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -93,19 +93,67 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords H5Gget_objname_by_idx(gid,j,menu_names[j],max_length); ///@deprecated see the HDF doc to replace this std::string tempj(menu_names[j]); itype_vol[j] = ReadFE(file_id,el_fem_type_vol,el_fem_type_bd,tempj); - } - + // // read control data ******************** A -// mesh.SetDimension(dim); // this is determined in the other routine already +// mesh.SetDimension(dim); // DONE this is determined in the ReadFE routine // mesh.SetNumberOfElements(nel); -// mesh.SetNumberOfNodes(nvt); - - +// mesh.SetNumberOfNodes(nvt); //DONE below // // end read control data **************** A + // // read NODAL COORDINATES **************** C + std::string coord_dataset = mesh_ensemble + "/" + tempj + "/" + aux_zeroone + "/" + node_coord + "/"; ///@todo here we have to loop + + // Getting dataset xyz + hid_t dtset = H5Dopen(file_id,coord_dataset.c_str(),H5P_DEFAULT); + hid_t filespace = H5Dget_space(dtset); /* Get filespace handle first. */ + hid_t status = H5Sget_simple_extent_dims(filespace, dims, NULL); + if(status ==0) std::cerr << "SalomeIO::read dims not found"; + // reading xyz_med + unsigned int n_nodes = dims[0]/mesh.GetDimension(); + double *xyz_med = new double[dims[0]]; + std::cout << " Number of points in med file =" << n_nodes << " " << std::endl; + + mesh.SetNumberOfNodes(n_nodes); + + coords[0].resize(n_nodes); + coords[1].resize(n_nodes); + coords[2].resize(n_nodes); + + status=H5Dread(dtset,H5T_NATIVE_DOUBLE,H5S_ALL,H5S_ALL,H5P_DEFAULT,xyz_med); + H5Dclose(dtset); + + if (mesh.GetDimension()==3) { + for (unsigned j=0; j > &coords - // // read NODAL COORDINATES **************** C - - // // end read NODAL COORDINATES ************* C @@ -401,6 +446,8 @@ int SalomeIO::ReadFE( } //end for + // ************ end determine mesh dimension ************************************ + // --------- Reading Element type (From salome to LIBMESH (itype_vol))------ std::map< std::string, int > fem_type_vol;// Salome fem table name (vol) fem_type_vol["HE8"] = 5; fem_type_vol["H20"] = 20; fem_type_vol["H27"] = 12; diff --git a/unittests/testSalomeIO/input/StudyCube3d.hdf b/unittests/testSalomeIO/input/StudyCube3d.hdf new file mode 100644 index 0000000000000000000000000000000000000000..8e804e29bb782ce2c2076e5b4958c8448bd93ec7 GIT binary patch literal 177002 zcmeIb3w)hdbtifx=i!K?I3|z~9z98Lq6Ej*dFf#i(CgT8uq8#36XyZ4WF6ZIwxsA0 zlmNw~VF-cJ5Hi%0(jlb`4Jqa420BgCPMgxSmtRVIL&|hAp$wUn-kb7c?u5Xdf&A#r z{ja^&|2#gO?;*vq&pA4uy|vEX-&$+$z4qE`t-ZhR?DO%y-tFf!UDyH3L$ zSYC%~Ljrx-u0iSPUh8hB!Ec(LSvJ<&HPY2HuzPTzKifZo!r_rUy*G>wj|}bU8QC+G zjr9+VWV;6j-aUF<*U-+c?p@horKJ9P^~+Cx`_?JlA=Aq+{e9sq#rN{p()!<8mw;D) z9f(FgwtBw&GKM72fT7^G>h? zymo-|`Cii>R=0iUuB^DNY}amAw0qC4k)2l9HIj{W4fpKa2?Y5p7iU}C<(B^O+JR=% zThe*;m{H(E?^IsId&=@Jc4|5G`0<`nydShF#S2!hcdP$zL+lKdwF#ubBHM-rE7)p% zG$@u=?z|33;OUlcY;1G{>p?Fc)-~LH4uD+b;4&M{atqGacKk1dG>n|x?Nk1TdPTo+ z?CRhq(GRt}CK!);b@x@lc(rm@##a_$qdT$#ySL08oQVBjTeNRIy9Z_7H+5%s?Cc-i z*}r{YbU52HvU8xnDcP23N^D6rwWPMe`VVy)HX64D4-# zJ-xd}hjL>R*UwJQ=VnI}P0pTd9~j!*HL@)}+_h_9ch=S4G?d+*9m@9iWJh}j_VkZr zhqlFAnsyKL!UFYlN!5k&L{qlEx3pQ>Qbggq5rgL&+u{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^EtxHe2KMCYhT+}W;XW&+ z9@Jr70(A-0B~X_@T>_OTfw1?)ZuykP=Uk`M_k}8P6j!fJ+!xwwRm2T8{#xm}E&trk zXCJeDnN18^XYuJKVf1yyW46vBr8cb6*A==?){sA6<3^ACmnq&giymh0Zv0H$-mO{X zK*wqCj++qn8GPj5mfAZjK4Bot-tl=YVRU=rhJG_x{`6Nb+w;P;sJrF*9Hv+FHiXgjDsFm3%IeT7%BWWS z)ngCpyx@L9eLsmKyf&cMU(HyzyT24{FJG;6!tBZhtAH@NUAe;S3MrLQb*!&WkMX^d z#xDfRzs2OU@ppppIt}mQF9ze$|2_QqU_9E1JD~9#%U|zfzCymMh`v#`lZw8o#=_ z{yWU?aMec`-Of&!T_L58Po?`|-H(u7>UGbTgXPaS>!q&*<8fX;|9ioB)vd*a)`#iU z*@j9OU9YB0uSltkDqXL_0?l5_fvO45p-7WZUuU}rJ=L?;zc$rZBcg*+q zW9t5UnF6gbboy`l1Nx7bj+fed#*u?3sQ+PhrQhlyjBZzc#q0_xl~J|Z*#VOWVRU(X M%j7}I>X66(54&BmH2?qr literal 0 HcmV?d00001 diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 3ba5268cc..41edc345e 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -12,7 +12,7 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); - std::string med_file = "Cube3d.med"; + std::string med_file = "two_meshes.med"; std::ostringstream mystream; mystream << "./" << DEFAULT_CONFIGDIR << "/" << med_file; const std::string infile = mystream.str(); From 09d70477a5b57a47aab0ee7cc5a28ba0adf202a8 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Tue, 3 Mar 2015 18:45:51 -0600 Subject: [PATCH 20/91] _projQitoQj is now a private member of mesh --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 26 +--- src/mesh/Mesh.cpp | 118 ++++++++++-------- src/mesh/Mesh.hpp | 8 +- src/mesh/MeshRefinement.cpp | 2 - src/mesh/MultiLevelMesh.cpp | 1 - src/solution/GMVWriter.cpp | 18 ++- src/solution/VTKWriter.cpp | 9 +- src/solution/XDMFWriter.cpp | 9 +- 8 files changed, 97 insertions(+), 94 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index d24a8b2e2..6833fe652 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -15,8 +15,6 @@ double scale=1000.; using namespace std; using namespace femus; -void AssembleMatrixResFSI(MultiLevelProblem &ml_prob, unsigned level, const unsigned &gridn, const bool &assemble_matrix); - bool SetBoundaryConditionTurek(const double &x, const double &y, const double &z,const char name[], double &value, const int FaceName, const double = 0.); bool SetBoundaryConditionDrum(const double &x, const double &y, const double &z,const char name[], @@ -281,31 +279,9 @@ int main(int argc,char **args) { system.AddSolutionToSystemPDE("V"); if (!dimension2D) system.AddSolutionToSystemPDE("W"); system.AddSolutionToSystemPDE("P"); - -// if(dimension2D){ -// bool sparsity_pattern_matrix[5][5]={{1, 0, 1, 0, 0}, -// {0, 1, 0, 1, 0}, -// {1, 1, 1, 1, 1}, -// {1, 1, 1, 1, 1}, -// {1, 1, 0, 0, 1}}; -// vector < bool > sparsity_pattern (sparsity_pattern_matrix[0],sparsity_pattern_matrix[0]+25*sizeof(bool)); -// system.SetSparsityPattern(sparsity_pattern); -// } -// else{ -// bool sparsity_pattern_matrix[7][7]={{1, 0, 0, 1, 0, 0, 0}, -// {0, 1, 0, 0, 1, 0, 0}, -// {0, 0, 1, 0, 0, 1, 0}, -// {1, 1, 1, 1, 1, 1, 1}, -// {1, 1, 1, 1, 1, 1, 1}, -// {1, 1, 1, 1, 1, 1, 1}, -// {1, 1, 1, 0, 0, 0, 1}}; -// vector < bool > sparsity_pattern (sparsity_pattern_matrix[0],sparsity_pattern_matrix[0]+49*sizeof(bool)); -// system.SetSparsityPattern(sparsity_pattern); -// } // System Fluid-Structure-Interaction - system.SetAssembleFunction(IncompressibleFSIAssemblyAD_DD); - //system.SetAssembleFunction(AssembleMatrixResFSI); + system.SetAssembleFunction(IncompressibleFSIAssemblyAD_DD); system.SetMgType(F_CYCLE); system.SetAbsoluteConvergenceTolerance(1.e-10); diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 876750c28..7d2299edb 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -54,7 +54,7 @@ unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; for (int itype=0; itype<3; itype++) { for (int jtype=0; jtype<3; jtype++) { - _ProlQitoQj[itype][jtype] = NULL; + _ProjQitoQj[itype][jtype] = NULL; } } } @@ -67,9 +67,9 @@ unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; for (int itype=0; itype<3; itype++) { for (int jtype=0; jtype<3; jtype++) { - if(_ProlQitoQj[itype][jtype]){ - delete _ProlQitoQj[itype][jtype]; - _ProlQitoQj[itype][jtype] = NULL; + if(_ProjQitoQj[itype][jtype]){ + delete _ProjQitoQj[itype][jtype]; + _ProjQitoQj[itype][jtype] = NULL; } } } @@ -659,65 +659,81 @@ void Mesh::FillISvector() { } -void Mesh::BuildLagrangeProlongatorMatrices(){ +SparseMatrix* Mesh::GetQitoQjProjection(const unsigned& itype, const unsigned& jtype) { + if(itype < 3 && jtype < 3){ + if(!_ProjQitoQj[itype][jtype]){ + BuildQitoQjProjection(itype, jtype); + } + } + else{ + std::cout<<"Wrong argument range in function" + <<"Mesh::GetLagrangeProjectionMatrix(const unsigned& itype, const unsigned& jtype)"<init(ni,ni_loc,false,SERIAL); - NNZ_o->init(ni,ni_loc,false,SERIAL); - } - else{ - NNZ_d->init(ni,ni_loc,false,PARALLEL); - NNZ_o->init(ni,ni_loc,false,PARALLEL); - } - NNZ_d->zero(); - NNZ_o->zero(); + NumericVector *NNZ_d = NumericVector::build().release(); + NumericVector *NNZ_o = NumericVector::build().release(); + if(1 == _nprocs) { // IF SERIAL + NNZ_d->init(ni, ni_loc, false, SERIAL); + NNZ_o->init(ni, ni_loc, false, SERIAL); + } + else{ + NNZ_d->init(ni, ni_loc, false, PARALLEL); + NNZ_o->init(ni, ni_loc, false, PARALLEL); + } + NNZ_d->zero(); + NNZ_o->zero(); - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=IS_Mts2Gmt_elem_offset[isdom];iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ - unsigned iel = IS_Mts2Gmt_elem[iel_mts]; - short unsigned ielt= el->GetElementType(iel); - _finiteElement[ielt][jtype]->GetSparsityPatternSize(*this, iel, NNZ_d, NNZ_o, itype); - } - } + for(unsigned isdom = _iproc; isdom < _iproc+1; isdom++) { + for (unsigned iel_mts = IS_Mts2Gmt_elem_offset[isdom]; iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ + unsigned iel = IS_Mts2Gmt_elem[iel_mts]; + short unsigned ielt = el->GetElementType(iel); + _finiteElement[ielt][jtype]->GetSparsityPatternSize(*this, iel, NNZ_d, NNZ_o, itype); + } + } - NNZ_d->close(); - NNZ_o->close(); + NNZ_d->close(); + NNZ_o->close(); - unsigned offset = MetisOffset[itype][_iproc]; + unsigned offset = MetisOffset[itype][_iproc]; - vector nnz_d(ni_loc); - vector nnz_o(ni_loc); - for(int i=0; i ((*NNZ_d)(offset+i)); - nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); - } + vector < int > nnz_d(ni_loc); + vector < int > nnz_o(ni_loc); + for(unsigned i = 0; i < ni_loc; i++){ + nnz_d[i] = static_cast < int > ((*NNZ_d)(offset+i)); + nnz_o[i] = static_cast < int > ((*NNZ_o)(offset+i)); + } - delete NNZ_d; - delete NNZ_o; + delete NNZ_d; + delete NNZ_o; - _ProlQitoQj[itype][jtype] = SparseMatrix::build().release(); - _ProlQitoQj[itype][jtype]->init(ni,nj, own_size[itype][_iproc], own_size[jtype][_iproc],nnz_d,nnz_o); - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=IS_Mts2Gmt_elem_offset[isdom];iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ - unsigned iel = IS_Mts2Gmt_elem[iel_mts]; - short unsigned ielt=el->GetElementType(iel); - _finiteElement[ielt][jtype]->BuildProlongation(*this, iel, _ProlQitoQj[itype][jtype], itype); - } - } - _ProlQitoQj[itype][jtype]->close(); + _ProjQitoQj[itype][jtype] = SparseMatrix::build().release(); + _ProjQitoQj[itype][jtype]->init(ni, nj, own_size[itype][_iproc], own_size[jtype][_iproc], nnz_d, nnz_o); + for(unsigned isdom = _iproc; isdom < _iproc+1; isdom++) { + for (unsigned iel_mts = IS_Mts2Gmt_elem_offset[isdom]; iel_mts < IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++){ + unsigned iel = IS_Mts2Gmt_elem[iel_mts]; + short unsigned ielt = el->GetElementType(iel); + _finiteElement[ielt][jtype]->BuildProlongation(*this, iel, _ProjQitoQj[itype][jtype], itype); } } + _ProjQitoQj[itype][jtype]->close(); } + + + + + } //end namespace femus diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 9ecafbc4a..78591d85c 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -165,14 +165,16 @@ class Mesh : public ParallelObject { static bool _TestSetRefinementFlag; std::map _boundaryinfo; - SparseMatrix* _ProlQitoQj[3][3]; - void BuildLagrangeProlongatorMatrices(); - + SparseMatrix* GetQitoQjProjection(const unsigned& itype, const unsigned& jtype); + void BuildQitoQjProjection(const unsigned& itype, const unsigned& jtype); + /** one for every type of variable */ SparseMatrix* _ProjMat[5]; private: + SparseMatrix* _ProjQitoQj[3][3]; + /** To be added */ void copy_elr(vector &other_vec) const; diff --git a/src/mesh/MeshRefinement.cpp b/src/mesh/MeshRefinement.cpp index 25de94c0a..76db94449 100644 --- a/src/mesh/MeshRefinement.cpp +++ b/src/mesh/MeshRefinement.cpp @@ -297,8 +297,6 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t _mesh._coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); _mesh._coordinate->ResizeSolutionVector("AMR"); - - _mesh.BuildLagrangeProlongatorMatrices(); //build projection Matrix unsigned thisSolType=2; diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index 57e976389..ea8b09010 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -106,7 +106,6 @@ MultiLevelMesh::MultiLevelMesh(): _gridn0(0),_gridr0(0) { _finiteElement[5][3]=new const elem_type_1D("line","constant",GaussOrder); _finiteElement[5][4]=new const elem_type_1D("line","disc_linear",GaussOrder); _level0[0]->SetFiniteElementPtr(_finiteElement); - _level0[0]->BuildLagrangeProlongatorMatrices(); } diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 97cae312f..944908e2a 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -102,7 +102,8 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char for (int i=0; i<3; i++) { for (unsigned ig=igridr-1u; igmatrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][2]); + Mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,2) ); vector v_local; Mysol[ig]->localize_to_one(v_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; @@ -112,7 +113,8 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char } if (_moving_mesh && mlMsh->GetLevel(0)->GetDimension() > i) { unsigned indDXDYDZ=_ml_sol.GetIndex(_moving_vars[i].c_str()); - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(indDXDYDZ)]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(indDXDYDZ)) ); Mysol[ig]->localize_to_one(v_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ @@ -243,16 +245,20 @@ void GMVWriter::write_system_solutions(const std::string output_path, const char fout.write((char *)&one,sizeof(unsigned)); for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); } else if (name==1){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); } else if (name==2){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); } else{ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index][_ml_sol.GetSolutionType(i)]); + Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); } std::vector v_local; Mysol[ig]->localize_to_one(v_local,0); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index b1e9aa187..0f421b780 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -162,7 +162,8 @@ void VTKWriter::write_system_solutions(const std::string output_path, const char std::vector v_local; unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kk<3;kk++) { - mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2]); + mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,2)); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; i v_local; unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kkGetLevel(0)->GetDimension();kk++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indDXDYDZ[kk])]); + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol.GetSolutionType(indDXDYDZ[kk]))); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; imatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)]); + mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol.GetSolutionType(indx)) ); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 99033c2bb..6b19114b5 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -220,12 +220,14 @@ void XDMFWriter::write_system_solutions(const std::string output_path, const cha mysol = NumericVector::build().release(); //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][2]); + mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,2) ); unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iimatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(varind_DXDYDZ)]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol.GetSolutionType(varind_DXDYDZ))); for (unsigned ii=0; iiinit(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx],*mlMsh->GetLevel(ig)->_ProlQitoQj[index_nd][_ml_sol.GetSolutionType(indx)]); + mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(indx)) ); unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; ii Date: Tue, 3 Mar 2015 19:40:31 -0600 Subject: [PATCH 21/91] Read connectivity in MED file --- src/mesh/SalomeIO.cpp | 370 +++++++++++------------- src/mesh/SalomeIO.hpp | 11 +- unittests/testSalomeIO/testSalomeIO.cpp | 2 +- 3 files changed, 180 insertions(+), 203 deletions(-) diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index c86e7e41e..0218a31cf 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -35,7 +35,7 @@ namespace femus { - const unsigned SalomeIO::GambitToFemusVertexIndex[6][27]= + const unsigned SalomeIO::SalomeToFemusVertexIndex[6][27]= { { 4,16,0,15,23,11,7,19,3, @@ -57,7 +57,7 @@ namespace femus { }; -const unsigned SalomeIO::GambitToFemusFaceIndex[6][6]= +const unsigned SalomeIO::SalomeToFemusFaceIndex[6][6]= { {0,4,2,5,3,1}, {0,1,2,3}, @@ -67,15 +67,13 @@ const unsigned SalomeIO::GambitToFemusFaceIndex[6][6]= {0,1} }; - + /// @todo extend to Wegdes (aka Prisms) void SalomeIO::read(const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag) { Mesh& mesh = GetMesh(); mesh.SetGridNumber(0); hsize_t dims[2]; - std::string el_fem_type_vol(""); - std::string el_fem_type_bd(""); hid_t file_id = H5Fopen(name.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); @@ -89,14 +87,19 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords itype_vol.resize(n_menus); menu_names.resize(n_menus); for (unsigned j=0; j > &coords // // read NODAL COORDINATES **************** C std::string coord_dataset = mesh_ensemble + "/" + tempj + "/" + aux_zeroone + "/" + node_coord + "/"; ///@todo here we have to loop - // Getting dataset xyz hid_t dtset = H5Dopen(file_id,coord_dataset.c_str(),H5P_DEFAULT); + + // SET NUMBER OF NODES hid_t filespace = H5Dget_space(dtset); /* Get filespace handle first. */ hid_t status = H5Sget_simple_extent_dims(filespace, dims, NULL); if(status ==0) std::cerr << "SalomeIO::read dims not found"; // reading xyz_med unsigned int n_nodes = dims[0]/mesh.GetDimension(); double *xyz_med = new double[dims[0]]; - std::cout << " Number of points in med file =" << n_nodes << " " << std::endl; + std::cout << " Number of nodes in med file " << n_nodes << " " << std::endl; mesh.SetNumberOfNodes(n_nodes); + // SET NODE COORDINATES coords[0].resize(n_nodes); coords[1].resize(n_nodes); coords[2].resize(n_nodes); @@ -150,25 +155,108 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords delete[] xyz_med; // // end read NODAL COORDINATES ************* C - - } //end menu names ********************************************************** - - - - // // read ELEMENT/cell ******************** B + std::string my_mesh_name_dir = mesh_ensemble + "/" + tempj + "/" + aux_zeroone + "/" + connectivity + "/"; ///@todo here we have to loop + + // Getting connectivity structure from file *.med + std::string node_name_dir = my_mesh_name_dir + el_fem_type_vol_j + "/NOD"; + dtset = H5Dopen(file_id,node_name_dir.c_str(),H5P_DEFAULT); + filespace = H5Dget_space(dtset); /* Get filespace handle first. */ + status = H5Sget_simple_extent_dims(filespace, dims, NULL); + if(status ==0) {std::cerr << "SalomeIO::read dims not found"; abort();} + const int dim_conn = dims[0]; + + // DETERMINE NUMBER OF NODES PER ELEMENT + uint Node_el; + if ( el_fem_type_vol_j.compare("HE8") == 0 ) Node_el = 8; + else if ( el_fem_type_vol_j.compare("H20") == 0 ) Node_el = 20; + else if ( el_fem_type_vol_j.compare("H27") == 0 ) Node_el = 27; + + else if ( el_fem_type_vol_j.compare("TE4") == 0 ) Node_el = 4; + else if ( el_fem_type_vol_j.compare("T10") == 0 ) Node_el = 10; + + else if ( el_fem_type_vol_j.compare("QU4") == 0 ) Node_el = 4; + else if ( el_fem_type_vol_j.compare("QU8") == 0 ) Node_el = 8; + else if ( el_fem_type_vol_j.compare("QU9") == 0 ) Node_el = 9; + + else if ( el_fem_type_vol_j.compare("TR3") == 0 ) Node_el = 3; + else if ( el_fem_type_vol_j.compare("TR6") == 0 ) Node_el = 6; - - // // end read ELEMENT/CELL **************** B + else if ( el_fem_type_vol_j.compare("SE3") == 0 ) Node_el = 3; + else if ( el_fem_type_vol_j.compare("SE2") == 0 ) Node_el = 2; + else { std::cout << "SalomeIO::read: element not supported"; abort(); } + + unsigned int n_elements = dim_conn/Node_el; + + // SET NUMBER OF ELEMENTS + mesh.SetNumberOfElements(n_elements); + + int *conn_map5 = new int[dim_conn]; + std::cout << " Number of elements in med file " << n_elements << std::endl; + status=H5Dread(dtset,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,conn_map5); + if(status !=0) {std::cout << "SalomeIO::read: connectivity not found"; abort();} + H5Dclose(dtset); - - - - + + mesh.el = new elem(n_elements); ///@todo check where this is going to be deleted + + + for (unsigned iel=0; ielSetElementGroup(iel,1); + unsigned nve = Node_el; /// @todo this is only one element type + if (nve==27) { + type_elem_flag[0]=type_elem_flag[3]=true; + mesh.el->AddToElementNumber(1,"Hex"); + mesh.el->SetElementType(iel,0); + } else if (nve==10) { + type_elem_flag[1]=type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Tet"); + mesh.el->SetElementType(iel,1); + } else if (nve==18) { + type_elem_flag[2]=type_elem_flag[3]=type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Wedge"); + mesh.el->SetElementType(iel,2); + } else if (nve==9) { + type_elem_flag[3]=true; + mesh.el->AddToElementNumber(1,"Quad"); + mesh.el->SetElementType(iel,3); + } + else if (nve==6 && mesh.GetDimension()==2) { + type_elem_flag[4]=true; + mesh.el->AddToElementNumber(1,"Triangle"); + mesh.el->SetElementType(iel,4); + } + else if (nve==3 && mesh.GetDimension()==1) { + mesh.el->AddToElementNumber(1,"Line"); + mesh.el->SetElementType(iel,5); + } else { + std::cout<<"Error! Invalid element type in reading File!"<GetElementType(iel)][i]; + mesh.el->SetElementVertexIndex(iel,inode,conn_map5[iel+i*n_elements]); + } + } + +// // // // // // // Adding Connectivity to mesh structure (Libmesh) +// // // // // mesh.reserve_elem(n_elements); +// // // // // // read the elements +// // // // // for(int iel=0; iel<(int)n_elements; ++iel) { +// // // // // // add the elements to the mesh +// // // // // Elem* elem = mesh.add_elem(Elem::build(eletype.type).release()); +// // // // // // add node pointers to the elements +// // // // // for(int i=0; iset_node(eletype.nodes[i])= mesh.node_ptr(conn_map[Node_el*iel+i]); +// // // // // elem->set_node(eletype.nodes[i])= mesh.node_ptr(conn_map5[iel+i*n_elements]-1); +// // // // // } +// // // // // } + + // // end read ELEMENT/CELL **************** B - @@ -177,167 +265,36 @@ void SalomeIO::read(const std::string& name, vector < vector < double> > &coords // // end read GROUP **************** E - - - - // // read boundary **************** D // // end read boundary **************** D + // clean + delete [] conn_map5; + + } + +//end menu names ********************************************************** +//end menu names ********************************************************** +//end menu names ********************************************************** + + for (unsigned j=0; j> str2; -// inf >> nvt >> nel >> ngroup >> nbcd >> dim >> str2 ; -// mesh.SetDimension(dim); -// mesh.SetNumberOfElements(nel); -// mesh.SetNumberOfNodes(nvt); -// inf >> str2; -// if (str2.compare("ENDOFSECTION") != 0) { -// std::cout<<"error control data mesh"<> str2; -// inf >> str2; -// for (unsigned iel=0; ielSetElementGroup(iel,1); -// unsigned nve; -// inf >> str2 >> str2 >> nve; -// if (nve==27) { -// type_elem_flag[0]=type_elem_flag[3]=true; -// mesh.el->AddToElementNumber(1,"Hex"); -// mesh.el->SetElementType(iel,0); -// } else if (nve==10) { -// type_elem_flag[1]=type_elem_flag[4]=true; -// mesh.el->AddToElementNumber(1,"Tet"); -// mesh.el->SetElementType(iel,1); -// } else if (nve==18) { -// type_elem_flag[2]=type_elem_flag[3]=type_elem_flag[4]=true; -// mesh.el->AddToElementNumber(1,"Wedge"); -// mesh.el->SetElementType(iel,2); -// } else if (nve==9) { -// type_elem_flag[3]=true; -// mesh.el->AddToElementNumber(1,"Quad"); -// mesh.el->SetElementType(iel,3); -// } -// else if (nve==6 && mesh.GetDimension()==2) { -// type_elem_flag[4]=true; -// mesh.el->AddToElementNumber(1,"Triangle"); -// mesh.el->SetElementType(iel,4); -// } -// else if (nve==3 && mesh.GetDimension()==1) { -// mesh.el->AddToElementNumber(1,"Line"); -// mesh.el->SetElementType(iel,5); -// } else { -// std::cout<<"Error! Invalid element type in reading Gambit File!"<GetElementType(iel)][i]; -// double value; -// inf>>value; -// mesh.el->SetElementVertexIndex(iel,inode,value); -// } -// } -// inf >> str2; -// if (str2.compare("ENDOFSECTION") != 0) { -// std::cout<<"error element data mesh"<> str2; -// inf >> str2; // 2.0.4 -// coords[0].resize(nvt); -// coords[1].resize(nvt); -// coords[2].resize(nvt); -// -// if (mesh.GetDimension()==3) { -// for (unsigned j=0; j> str2 >> x >> y >> z; -// coords[0][j] = x/Lref; -// coords[1][j] = y/Lref; -// coords[2][j] = z/Lref; -// } -// } -// -// else if (mesh.GetDimension()==2) { -// for (unsigned j=0; j> str2 >> x >> y; -// coords[0][j] = x/Lref; -// coords[1][j] = y/Lref; -// coords[2][j] = 0.; -// } -// } -// -// else if (mesh.GetDimension()==1) { -// for (unsigned j=0; j> str2 >> x; -// coords[0][j] = x/Lref; -// coords[1][j]=0.; -// coords[2][j]=0.; -// } -// } -// inf >> str2; // "ENDOFSECTION" -// if (str2.compare("ENDOFSECTION") != 0) { -// std::cout<<"error node data mesh 1"< elem_list; elem_list.resize(n_fem_type); - for (unsigned j=0; j < elem_list.size(); j++) { - elem_list[j] = new char[max_length]; - H5Gget_objname_by_idx(gid,j,elem_list[j],max_length); ///@deprecated see the HDF doc to replace this - std::string tempj(elem_list[j]); - - if ( tempj.compare("HE8") == 0 || - tempj.compare("H20") == 0 || - tempj.compare("H27") == 0 || - tempj.compare("TE4") == 0 || - tempj.compare("T10") == 0 ) { mydim = 3; } - else if ( tempj.compare("QU4") == 0 || - tempj.compare("QU8") == 0 || - tempj.compare("QU9") == 0 || - tempj.compare("TR3") == 0 || - tempj.compare("TR6") == 0 ) { mydim = 2; } - - if ( mydim > mesh.GetDimension() ) mesh.SetDimension(mydim); - - } //end for - - // ************ end determine mesh dimension ************************************ - + + FindDimension(gid,menu_name,n_fem_type); + + // --------- Reading Element type (From salome to LIBMESH (itype_vol))------ std::map< std::string, int > fem_type_vol;// Salome fem table name (vol) fem_type_vol["HE8"] = 5; fem_type_vol["H20"] = 20; fem_type_vol["H27"] = 12; @@ -471,7 +405,7 @@ int SalomeIO::ReadFE( // Get the element name from MESH_NAME_DIR in the file med (el_name) - char **el_fem_type=new char*[n_fem_type]; + char **el_fem_type = new char*[n_fem_type]; int index_vol=0; int index_bd=0; for(int i=0; i<(int)n_fem_type; i++) { el_fem_type[i]=new char[4]; @@ -486,11 +420,51 @@ int SalomeIO::ReadFE( el_fem_type_bd=el_fem_type[index_bd]; // clean for(int i=0; i<(int)n_fem_type; i++) delete[] el_fem_type[i]; - delete[] el_fem_type; fem_type_vol.clear(); fem_type_bd.clear(); + delete[] el_fem_type; + fem_type_vol.clear(); + fem_type_bd.clear(); + return itype_vol; } +void SalomeIO::FindDimension(hid_t gid, const std::string menu_name, hsize_t n_fem_type) { + + + Mesh& mesh = GetMesh(); + uint mydim = 1; //this is the initial value, then it will be updated below + mesh.SetDimension(mydim); + + + std::vector elem_list; elem_list.resize(n_fem_type); + for (unsigned j=0; j < elem_list.size(); j++) { + elem_list[j] = new char[max_length]; + H5Gget_objname_by_idx(gid,j,elem_list[j],max_length); ///@deprecated see the HDF doc to replace this + std::string tempj(elem_list[j]); + + if ( tempj.compare("HE8") == 0 || + tempj.compare("H20") == 0 || + tempj.compare("H27") == 0 || + tempj.compare("TE4") == 0 || + tempj.compare("T10") == 0 ) { mydim = 3; } + else if ( tempj.compare("QU4") == 0 || + tempj.compare("QU8") == 0 || + tempj.compare("QU9") == 0 || + tempj.compare("TR3") == 0 || + tempj.compare("TR6") == 0 ) { mydim = 2; } + + if ( mydim > mesh.GetDimension() ) mesh.SetDimension(mydim); + + } //end for + + + return; +} + + + + + } //end namespace femus diff --git a/src/mesh/SalomeIO.hpp b/src/mesh/SalomeIO.hpp index 223cb6f0e..97410af89 100644 --- a/src/mesh/SalomeIO.hpp +++ b/src/mesh/SalomeIO.hpp @@ -55,11 +55,14 @@ class SalomeIO : public MeshInput private: - /** Map from Gambit vertex index to Femus vertex index */ - static const unsigned GambitToFemusVertexIndex[6][27]; + /** Map from Salome vertex index to Femus vertex index */ + static const unsigned SalomeToFemusVertexIndex[6][27]; - /** Map from Gambit face index to Femus face index */ - static const unsigned GambitToFemusFaceIndex[6][6]; + /** Map from Salome face index to Femus face index */ + static const unsigned SalomeToFemusFaceIndex[6][6]; + + /** Determine mesh dimension from mesh file */ + void FindDimension(hid_t gid, const std::string menu_name,hsize_t n_fem_type); /** Read FE type */ int ReadFE(hid_t file_id, std::string & el_fem_type_vol, std::string & el_fem_type_bd, const std::string menu_name); diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 41edc345e..2a2fb3a54 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -12,7 +12,7 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); - std::string med_file = "two_meshes.med"; + std::string med_file = "Mesh_1.med"; std::ostringstream mystream; mystream << "./" << DEFAULT_CONFIGDIR << "/" << med_file; const std::string infile = mystream.str(); From 2b72052e4daf7bc32736ecf2bc6682c5ff8d42a6 Mon Sep 17 00:00:00 2001 From: eaulisa Date: Wed, 4 Mar 2015 09:57:30 -0600 Subject: [PATCH 22/91] projection matrices competely moved in mesh and interface completely built --- src/equations/LinearImplicitSystem.cpp | 7 +- src/mesh/Mesh.cpp | 117 +++++++++++++++++++++++-- src/mesh/Mesh.hpp | 32 +++++-- src/mesh/MeshRefinement.cpp | 69 ++------------- src/solution/MultiLevelSolution.cpp | 79 ----------------- src/solution/MultiLevelSolution.hpp | 3 - 6 files changed, 146 insertions(+), 161 deletions(-) diff --git a/src/equations/LinearImplicitSystem.cpp b/src/equations/LinearImplicitSystem.cpp index c94a7768e..6ba4b303f 100644 --- a/src/equations/LinearImplicitSystem.cpp +++ b/src/equations/LinearImplicitSystem.cpp @@ -400,10 +400,11 @@ void LinearImplicitSystem::ProlongatorSol(unsigned gridf) { for (unsigned k=0; k<_SolSystemPdeIndex.size(); k++) { - unsigned SolIndex=_SolSystemPdeIndex[k]; - unsigned Typeindex=_ml_sol->GetSolutionType(SolIndex); + unsigned SolIndex = _SolSystemPdeIndex[k]; + unsigned solType = _ml_sol->GetSolutionType(SolIndex); - _solution[gridf]->_Sol[SolIndex]->matrix_mult(*_solution[gridf-1]->_Sol[SolIndex],*_msh[gridf]->_ProjMat[Typeindex]); + _solution[gridf]->_Sol[SolIndex]->matrix_mult(*_solution[gridf-1]->_Sol[SolIndex], + *_msh[gridf]->GetCoarseToFineProjection(solType)); _solution[gridf]->_Sol[SolIndex]->close(); } } diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 7d2299edb..9d14a4dc9 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -48,8 +48,11 @@ unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; //------------------------------------------------------------------------------------------------------ Mesh::Mesh(){ + + _coarseMsh = NULL; + for(int i=0;i<5;i++){ - _ProjMat[i]=NULL; + _ProjCoarseToFine[i]=NULL; } for (int itype=0; itype<3; itype++) { @@ -75,9 +78,9 @@ unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; } for (unsigned i=0; i<5; i++) { - if (_ProjMat[i]) { - delete _ProjMat[i]; - _ProjMat[i]=NULL; + if (_ProjCoarseToFine[i]) { + delete _ProjCoarseToFine[i]; + _ProjCoarseToFine[i]=NULL; } } } @@ -85,7 +88,7 @@ unsigned Mesh::_face_index=2; // 4*DIM[2]+2*DIM[1]+1*DIM[0]; /// print Mesh info void Mesh::PrintInfo() { - std::cout << " Mesh Level : " << _grid << std::endl; + std::cout << " Mesh Level : " << _level << std::endl; std::cout << " Number of elements: " << _nelem << std::endl; std::cout << " Number of nodes : " << _nnodes << std::endl; @@ -98,7 +101,7 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto vector > coords(3); - _grid=0; + _level=0; if(name.rfind(".neu") < name.size()) { @@ -166,7 +169,7 @@ void Mesh::GenerateCoarseBoxMesh( vector > coords(3); - _grid=0; + _level=0; MeshTools::Generation::BuildBox(*this,coords,nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,type_elem_flag); @@ -731,6 +734,106 @@ void Mesh::BuildQitoQjProjection(const unsigned& itype, const unsigned& jtype){ +SparseMatrix* Mesh::GetCoarseToFineProjection(const unsigned& solType){ + + if( solType > 4 ){ + std::cout<<"Wrong argument range in function \"GetCoarseToFineProjection\": " + <<"solType is greater then 4"<MetisOffset[solType][_nprocs]; + int nf_loc = own_size[solType][_iproc]; + int nc_loc = _coarseMsh->own_size[solType][_iproc]; + + //build matrix sparsity pattern size + NumericVector *NNZ_d = NumericVector::build().release(); + if(n_processors()==1) { // IF SERIAL + NNZ_d->init(nf, nf_loc, false, SERIAL); + } + else { // IF PARALLEL + if(solType<3) { + if(ghost_size[solType][processor_id()]!=0) { + NNZ_d->init(nf, nf_loc, ghost_nd_mts[solType][processor_id()], false, GHOSTED); + } + else { + std::vector < int > fake_ghost(1,nf_loc); + NNZ_d->init(nf, nf_loc, fake_ghost, false, GHOSTED); + } + } + else { //discontinuous pressure has no ghost nodes + NNZ_d->init(nf, nf_loc, false, PARALLEL); + } + } + NNZ_d->zero(); + + NumericVector *NNZ_o = NumericVector::build().release(); + NNZ_o->init(*NNZ_d); + NNZ_o->zero(); + + for(int isdom=_iproc; isdom<_iproc+1; isdom++) { + for (int iel_mts=_coarseMsh->IS_Mts2Gmt_elem_offset[isdom];iel_mts < _coarseMsh->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { + unsigned iel = _coarseMsh->IS_Mts2Gmt_elem[iel_mts]; + if(_coarseMsh->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined + short unsigned ielt=_coarseMsh->el->GetElementType(iel); + _finiteElement[ielt][solType]->GetSparsityPatternSize( *this, *_coarseMsh, iel, NNZ_d, NNZ_o); + } + } + } + NNZ_d->close(); + NNZ_o->close(); + + unsigned offset = MetisOffset[solType][_iproc]; + vector nnz_d(nf_loc); + vector nnz_o(nf_loc); + for(int i=0; i ((*NNZ_d)(offset+i)); + nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); + } + delete NNZ_d; + delete NNZ_o; + + //build matrix + _ProjCoarseToFine[solType] = SparseMatrix::build().release(); + _ProjCoarseToFine[solType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); + + // loop on the coarse grid + for(int isdom=_iproc; isdom<_iproc+1; isdom++) { + for (int iel_mts=_coarseMsh->IS_Mts2Gmt_elem_offset[isdom]; + iel_mts < _coarseMsh->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { + unsigned iel = _coarseMsh->IS_Mts2Gmt_elem[iel_mts]; + if(_coarseMsh->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined + short unsigned ielt=_coarseMsh->el->GetElementType(iel); + _finiteElement[ielt][solType]->BuildProlongation(*this, *_coarseMsh,iel, _ProjCoarseToFine[solType]); + } + } + } + _ProjCoarseToFine[solType]->close(); + } +} + + + + + diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 78591d85c..394fa2366 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -78,12 +78,12 @@ class Mesh : public ParallelObject { /** Set the grid number */ void SetGridNumber(const unsigned i) { - _grid=i; + _level=i; }; /** Get the grid number */ unsigned GetGridNumber() const { - return _grid; + return _level; } /** Set the dimension of the problem (1D, 2D, 3D) */ @@ -165,16 +165,34 @@ class Mesh : public ParallelObject { static bool _TestSetRefinementFlag; std::map _boundaryinfo; + /** Get the projection matrix between Lagrange FEM at the same level mesh*/ SparseMatrix* GetQitoQjProjection(const unsigned& itype, const unsigned& jtype); - void BuildQitoQjProjection(const unsigned& itype, const unsigned& jtype); + + /** Get the coarse to the fine projection matrix*/ + SparseMatrix* GetCoarseToFineProjection(const unsigned& solType); - /** one for every type of variable */ - SparseMatrix* _ProjMat[5]; + /** Set the coarser mesh from which this mesh is generated */ + void SetCoarseMesh( Mesh* otherCoarseMsh ){ + _coarseMsh = otherCoarseMsh; + }; private: - + /** Coarser mesh from which this mesh is generated, it equals NULL if _level = 0 */ + Mesh* _coarseMsh; + + /** The projection matrix between Lagrange FEM at the same level mesh */ SparseMatrix* _ProjQitoQj[3][3]; + /** The coarse to the fine projection matrix */ + SparseMatrix* _ProjCoarseToFine[5]; + + /** Build the projection matrix between Lagrange FEM at the same level mesh*/ + void BuildQitoQjProjection(const unsigned& itype, const unsigned& jtype); + + /** Build the coarse to the fine projection matrix */ + void BuildCoarseToFineProjection(const unsigned& solType); + + /** To be added */ void copy_elr(vector &other_vec) const; @@ -184,7 +202,7 @@ class Mesh : public ParallelObject { //member-data int _nelem; //< number of elements unsigned _nnodes; //< number of nodes - unsigned _grid; //< level of mesh in the multilevel hierarchy + unsigned _level; //< level of mesh in the multilevel hierarchy static unsigned _dimension; //< dimension of the problem static unsigned _ref_index; static unsigned _face_index; diff --git a/src/mesh/MeshRefinement.cpp b/src/mesh/MeshRefinement.cpp index 76db94449..dbaf600bf 100644 --- a/src/mesh/MeshRefinement.cpp +++ b/src/mesh/MeshRefinement.cpp @@ -157,6 +157,8 @@ void MeshRefinement::FlagOnlyEvenElementsToBeRefined() { //--------------------------------------------------------------------------------------------------------------- void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_type *otherFiniteElement[6][5]) { + _mesh.SetCoarseMesh(mshc); + _mesh.SetFiniteElementPtr(otherFiniteElement); elem *elc=mshc->el; @@ -297,69 +299,12 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t _mesh._coordinate->AddSolution("AMR",DISCONTINOUS_POLYNOMIAL,ZERO,1,0); _mesh._coordinate->ResizeSolutionVector("AMR"); + + unsigned solType=2; - //build projection Matrix - unsigned thisSolType=2; - if (!_mesh._ProjMat[thisSolType]){ - - int nf = _mesh.MetisOffset[thisSolType][_nprocs]; - int nc = mshc->MetisOffset[thisSolType][_nprocs]; - int nf_loc = _mesh.own_size[thisSolType][_iproc]; - int nc_loc = mshc->own_size[thisSolType][_iproc]; - - //build matrix sparsity pattern size for efficient storage - - NumericVector *NNZ_d = NumericVector::build().release(); - NNZ_d->init(*_mesh._coordinate->_Sol[0]); - NNZ_d->zero(); - - NumericVector *NNZ_o = NumericVector::build().release(); - NNZ_o->init(*_mesh._coordinate->_Sol[0]); - NNZ_o->zero(); - - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=mshc->IS_Mts2Gmt_elem_offset[isdom];iel_mts < mshc->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { - unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; - if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined - short unsigned ielt=mshc->el->GetElementType(iel); - _mesh._finiteElement[ielt][thisSolType]->GetSparsityPatternSize(_mesh, *mshc, iel, NNZ_d, NNZ_o); - } - } - } - NNZ_d->close(); - NNZ_o->close(); - - unsigned offset = _mesh.MetisOffset[thisSolType][_iproc]; - vector nnz_d(nf_loc); - vector nnz_o(nf_loc); - for(int i=0; i ((*NNZ_d)(offset+i)); - nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); - } - - delete NNZ_d; - delete NNZ_o; - - //build matrix - _mesh._ProjMat[thisSolType] = SparseMatrix::build().release(); - _mesh._ProjMat[thisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); - // loop on the coarse grid - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=mshc->IS_Mts2Gmt_elem_offset[isdom]; - iel_mts < mshc->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { - unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; - if( mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined - short unsigned ielt= mshc->el->GetElementType(iel); - _mesh._finiteElement[ielt][thisSolType]->BuildProlongation(_mesh,*mshc,iel,_mesh._ProjMat[thisSolType]); - } - } - } - _mesh._ProjMat[thisSolType]->close(); - } - - _mesh._coordinate->_Sol[0]->matrix_mult(*mshc->_coordinate->_Sol[0],*_mesh._ProjMat[thisSolType]); - _mesh._coordinate->_Sol[1]->matrix_mult(*mshc->_coordinate->_Sol[1],*_mesh._ProjMat[thisSolType]); - _mesh._coordinate->_Sol[2]->matrix_mult(*mshc->_coordinate->_Sol[2],*_mesh._ProjMat[thisSolType]); + _mesh._coordinate->_Sol[0]->matrix_mult(*mshc->_coordinate->_Sol[0],*_mesh.GetCoarseToFineProjection(solType)); + _mesh._coordinate->_Sol[1]->matrix_mult(*mshc->_coordinate->_Sol[1],*_mesh.GetCoarseToFineProjection(solType)); + _mesh._coordinate->_Sol[2]->matrix_mult(*mshc->_coordinate->_Sol[2],*_mesh.GetCoarseToFineProjection(solType)); _mesh._coordinate->_Sol[0]->close(); _mesh._coordinate->_Sol[1]->close(); _mesh._coordinate->_Sol[2]->close(); diff --git a/src/solution/MultiLevelSolution.cpp b/src/solution/MultiLevelSolution.cpp index f2e47fe2e..e5e52b5b9 100644 --- a/src/solution/MultiLevelSolution.cpp +++ b/src/solution/MultiLevelSolution.cpp @@ -77,7 +77,6 @@ void MultiLevelSolution::AddSolutionLevel(){ } for(unsigned i=0;i<_SolName.size();i++){ _solution[_gridn]->ResizeSolutionVector(_SolName[i]); - BuildProlongatorMatrix(_gridn,i); _solution[_gridn]->_Sol[i]->zero(); if (_SolTmorder[i]==2) { @@ -174,7 +173,6 @@ void MultiLevelSolution::Initialize(const char name[], initfunc func) { for (unsigned ig=0; ig<_gridn; ig++) { unsigned num_el = _ml_msh->GetLevel(ig)->GetNumberOfElements(); _solution[ig]->ResizeSolutionVector(_SolName[i]); - if ( ig > 0 ) BuildProlongatorMatrix(ig,i); _solution[ig]->_Sol[i]->zero(); if(func){ double value; @@ -266,83 +264,6 @@ unsigned MultiLevelSolution::GetSolutionType(const char name[]) { return _SolType[index]; } -//--------------------------------------------------------------------------------------------------- -// This routine generates the matrix for the projection of the solution to finer grids -//--------------------------------------------------------------------------------------------------- - -void MultiLevelSolution::BuildProlongatorMatrix(unsigned gridf, unsigned SolIndex) { - - if (gridf<1) { - cout<<"Error! In function \"BuildProlongatorMatrix\" argument less then 1"<GetLevel(gridf); - - if( !mshf->_ProjMat[thisSolType] ){ - - Mesh* mshc = _ml_msh->GetLevel(gridf-1); - - int nf = mshf->MetisOffset[thisSolType][_nprocs]; - int nc = mshc->MetisOffset[thisSolType][_nprocs]; - int nf_loc = mshf->own_size[thisSolType][_iproc]; - int nc_loc = mshc->own_size[thisSolType][_iproc]; - - //build matrix sparsity pattern size - - NumericVector *NNZ_d = NumericVector::build().release(); - NNZ_d->init(*_solution[gridf]->_Sol[SolIndex]); - NNZ_d->zero(); - - NumericVector *NNZ_o = NumericVector::build().release(); - NNZ_o->init(*_solution[gridf]->_Sol[SolIndex]); - NNZ_o->zero(); - - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=mshc->IS_Mts2Gmt_elem_offset[isdom];iel_mts < mshc->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { - unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; - if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined - short unsigned ielt=mshc->el->GetElementType(iel); - _ml_msh->_finiteElement[ielt][thisSolType]->GetSparsityPatternSize(*mshf, *mshc, iel, NNZ_d, NNZ_o); - } - } - } - NNZ_d->close(); - NNZ_o->close(); - - unsigned offset = mshf->MetisOffset[thisSolType][_iproc]; - vector nnz_d(nf_loc); - vector nnz_o(nf_loc); - for(int i=0; i ((*NNZ_d)(offset+i)); - nnz_o[i]=static_cast ((*NNZ_o)(offset+i)); - } - - delete NNZ_d; - delete NNZ_o; - - //build matrix - - mshf->_ProjMat[thisSolType] = SparseMatrix::build().release(); - mshf->_ProjMat[thisSolType]->init(nf,nc,nf_loc,nc_loc,nnz_d,nnz_o); - - // loop on the coarse grid - for(int isdom=_iproc; isdom<_iproc+1; isdom++) { - for (int iel_mts=mshc->IS_Mts2Gmt_elem_offset[isdom]; - iel_mts < mshc->IS_Mts2Gmt_elem_offset[isdom+1]; iel_mts++) { - unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; - if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined - short unsigned ielt=mshc->el->GetElementType(iel); - _ml_msh->_finiteElement[ielt][thisSolType]->BuildProlongation(*mshf,*mshc,iel, mshf->_ProjMat[thisSolType]); - } - } - } - mshf->_ProjMat[thisSolType]->close(); - } -} - //--------------------------------------------------------------------------------------------------- void MultiLevelSolution::AttachSetBoundaryConditionFunction ( bool (* SetBoundaryConditionFunction) (const double &x, const double &y, const double &z,const char name[], double &value, const int FaceName, const double time) ) { diff --git a/src/solution/MultiLevelSolution.hpp b/src/solution/MultiLevelSolution.hpp index f80c259f1..a32c61214 100644 --- a/src/solution/MultiLevelSolution.hpp +++ b/src/solution/MultiLevelSolution.hpp @@ -91,9 +91,6 @@ class MultiLevelSolution : public ParallelObject { return _SolType; }; - /** To be Added */ - void BuildProlongatorMatrix(unsigned gridf, unsigned SolIndex); - /** To be Added */ void AttachSetBoundaryConditionFunction ( bool (* SetBoundaryConditionFunction) (const double &x, const double &y, const double &z,const char name[], double &value, const int FaceName, const double time) ); From ab8f4048d48231da3af442140f4c1853fff81154 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Wed, 4 Mar 2015 15:08:47 -0600 Subject: [PATCH 23/91] some more formatting in mesh class --- src/mesh/Mesh.cpp | 5 ++--- src/mesh/Mesh.hpp | 17 +++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 9d14a4dc9..483a25415 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -636,8 +636,7 @@ void Mesh::FillISvector() { } } } - - + MetisOffset.resize(5); for(int i=0;i<5;i++) MetisOffset[i].resize(nsubdom+1); @@ -738,7 +737,7 @@ SparseMatrix* Mesh::GetCoarseToFineProjection(const unsigned& solType){ if( solType > 4 ){ std::cout<<"Wrong argument range in function \"GetCoarseToFineProjection\": " - <<"solType is greater then 4"< IS_Mts2Gmt_elem_offset; - vector IS_Mts2Gmt_elem; - vector own_size[5]; - vector > MetisOffset; - vector< vector > ghost_nd[5]; - vector< vector > ghost_nd_mts[5]; - vector ghost_size[5]; - elem *el; //< elements + + vector < unsigned > IS_Mts2Gmt_elem_offset; + vector < unsigned > IS_Mts2Gmt_elem; + vector < unsigned > own_size[5]; + vector > MetisOffset; + vector< vector < unsigned > > ghost_nd[5]; + vector< vector < int > > ghost_nd_mts[5]; + vector < unsigned > ghost_size[5]; + elem *el; // topology object vector < int > epart; vector < int > npart; int nsubdom; From 747e68453e6dfbea7610da9a3d0c803e5430bb83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simone=20Bn=C3=A0?= Date: Wed, 4 Mar 2015 23:09:41 +0100 Subject: [PATCH 24/91] add authors, brief introduction, license and setup instructions --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 68dc8d70e..ab7e85e25 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,60 @@ FEMuS ====== -Multiphysics Finite Element Multigrid Solver with selective mesh refinement. +Welcome to the FEMuS project! FEMuS is an opensource Finite Element C++ library +built on top of Petsc which allows scientists to build and solve multiphysics +problems with multigrid and domain decomposition techniques. -![alt tag](https://github.com/FeMTTU/femus/blob/master/doc/images/logo.jpg?raw=true) -![alt tag](https://github.com/FeMTTU/femus/blob/master/doc/images/FSI.jpg?raw=true) -======= + + + +Setup +===== + + +Clone the FEMuS source code from the github repository: + + + git clone https://github.com/FeMTTU/femus.git + + +Install petsc and libmesh in some common directory "my_external_directory" (please put it outside of the femus repo directory). +If they are not installed already, the script "install_external.sh" in contrib/scripts/ will do it automatically, with the following syntax: + + + ./femus/contrib/scripts/install_external.sh --prefix-external my_external_directory ) + + +Source the "configure_femus.sh" script and execute the function "fm_set_femus" in order to set some environment variables: + + + source femus/contrib/scripts/configure_femus.sh + + fm_set_femus --prefix-external my_external_directory --method-petsc [opt,dbg] --method-libmesh [opt,dbg] + + +Create the build directory, cd to it and run cmake: + + mkdir femus.build + + cd femus.build + + cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE="[Debug Release RelWithDebInfo MinSizeRel None]" -DLIBMESH_DIR=my_libmesh_directory ../femus + + + +Authors +======== + +Eugenio Aulisa +Simone Bnà +Giorgio Bornia + + + +License +======== + +Femus is opensource software distributed under the LGPL license, version 2.1 + From 3d2e8d7744f22debe597a06ccc220616b2e9de6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simone=20Bn=C3=A0?= Date: Wed, 4 Mar 2015 23:12:14 +0100 Subject: [PATCH 25/91] add space to author names --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab7e85e25..7cd178664 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,10 @@ Authors ======== Eugenio Aulisa + Simone Bnà -Giorgio Bornia + +Giorgio Bornia From d6a56fde63e89a14a46ee20a8fc107949f755036 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 11:59:50 -0600 Subject: [PATCH 26/91] Removed constant variable in tempopt --- applications/OptimalControl/tempopt/EqnT.cpp | 21 +------ .../OptimalControl/tempopt/OptLoop.hpp | 3 - .../OptimalControl/tempopt/TempQuantities.cpp | 55 ------------------- .../OptimalControl/tempopt/TempQuantities.hpp | 13 ----- applications/OptimalControl/tempopt/main.cpp | 11 +--- 5 files changed, 3 insertions(+), 100 deletions(-) diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 61fe7fe6b..810a8dca8 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -145,14 +145,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri TAdj._qtyptr = ml_prob.GetQtyMap().GetQuantity("Qty_TempAdj");//_UnknownQuantitiesVector[2]; TAdj.VectWithQtyFillBasic(); TAdj.Allocate(); - -#if FOURTH_ROW==1 - CurrentQuantity Press2(currgp); - Press2._qtyptr = ml_prob.GetQtyMap().GetQuantity("Qty_Pressure_2"); - Press2.VectWithQtyFillBasic(); - Press2.Allocate(); -#endif - + //=========EXTERNAL QUANTITIES (couplings) ===== //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //no quantity @@ -302,12 +295,6 @@ for (uint fe = 0; fe < QL; fe++) { currelem.Mat()(ip2,ip2) += (1-currelem.GetBCDofFlag()[ip2])*detb; -#if FOURTH_ROW==1 - int ip3 = i + 3 * Tempold._ndof; //suppose that T' T_0 T_adj have the same order - - if (i < currelem.GetElemType(Press2._FEord)->GetNDofs()) { currelem.Rhs()(ip3) += currelem.GetBCDofFlag()[ip3]*dtxJxW_g*(currgp._phi_ndsQLVB_g[Press2._FEord][i]) + (1-currelem.GetBCDofFlag()[ip3])*detb*1300.; - currelem.Mat()(ip3,ip3) += ( 1-currelem.GetBCDofFlag()[ip3] )*detb; } -#endif // Matrix Assemblying --------------------------- for (uint j=0; jGetNDofs() ) currelem.Mat()(ip3,ip3) += currelem.GetBCDofFlag()[ip3]*dtxJxW_g*(currgp._phi_ndsQLVB_g[ Press2._FEord ][/*j*/i]*currgp._phi_ndsQLVB_g[ Press2._FEord ][i]); -#endif - } //end j (col) } //end i (row) } // end of the quadrature point qp-loop diff --git a/applications/OptimalControl/tempopt/OptLoop.hpp b/applications/OptimalControl/tempopt/OptLoop.hpp index 6cc1a708a..cac1feb65 100644 --- a/applications/OptimalControl/tempopt/OptLoop.hpp +++ b/applications/OptimalControl/tempopt/OptLoop.hpp @@ -46,8 +46,5 @@ void optimization_loop( MultiLevelProblem & e_map_in ); // #define DIMENSION 3 // ************************************** -#define FOURTH_ROW 1 - - #endif \ No newline at end of file diff --git a/applications/OptimalControl/tempopt/TempQuantities.cpp b/applications/OptimalControl/tempopt/TempQuantities.cpp index 5b76ff3fc..a894e3079 100644 --- a/applications/OptimalControl/tempopt/TempQuantities.cpp +++ b/applications/OptimalControl/tempopt/TempQuantities.cpp @@ -48,14 +48,6 @@ Velocity::Velocity(std::string name_in, QuantityMap& qtymap_in, uint dim_in, uin for (uint i=0;iget("Uref"); } - -//======================== -Pressure2::Pressure2(std::string name_in, QuantityMap& qtymap_in, uint dim_in, uint FEord_in) -: Quantity(name_in,qtymap_in,dim_in,FEord_in) { - - for (uint i=0;iget("pref"); -} - //=================== END CONSTRUCTORS ================================ // ================================================================== // ================================================================== @@ -288,16 +280,7 @@ void Temperature::heatflux_txyz(const double /*t*/, const double* /*xyz*/, doubl return; } -// ================================================= -void Pressure2::Function_txyz(const double/* t*/, const double* xp,double* value) const { - value[0] = 1.; - - return; - - } - - void Velocity::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { @@ -658,37 +641,6 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); } - void Pressure2::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); - - - Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); - - std::vector lb(_qtymap.GetMeshTwo()->get_dim()); - std::vector le(_qtymap.GetMeshTwo()->get_dim()); - lb[0] = box->_lb[0]; //already nondimensionalized - le[0] = box->_le[0]; - lb[1] = box->_lb[1]; - le[1] = box->_le[1]; - if (_qtymap.GetMeshTwo()->get_dim() == 3) { - lb[2] = box->_lb[2]; - le[2] = box->_le[2]; - } - - std::vector x_rotshift(_qtymap.GetMeshTwo()->get_dim()); - _qtymap.GetMeshTwo()->_domain->TransformPointToRef(xp,&x_rotshift[0]); - - - if ( (x_rotshift[0]) > -bdry_toll && ( x_rotshift[0]) < bdry_toll ) { //left of the RefBox - bc_flag[0]=0; - } - - - return; -} - - // ====================== INITIALIZE functions =================================== void Temperature::initialize_xyz(const double* xp, std::vector< double >& value) const { @@ -812,10 +764,3 @@ void Pressure::initialize_xyz(const double* xp, std::vector< double >& value) co return; } - -void Pressure2::initialize_xyz(const double* xp, std::vector< double >& value) const { - - value[0] = 72.*(xp[0]); - - return; -} diff --git a/applications/OptimalControl/tempopt/TempQuantities.hpp b/applications/OptimalControl/tempopt/TempQuantities.hpp index b49353a14..66ce30698 100644 --- a/applications/OptimalControl/tempopt/TempQuantities.hpp +++ b/applications/OptimalControl/tempopt/TempQuantities.hpp @@ -108,17 +108,4 @@ class Velocity : public Quantity { }; -class Pressure2 : public Quantity { - - public: - Pressure2(std::string name_in, QuantityMap& qtymap_in, uint dim_in, uint FEord_in); - ~Pressure2(){}; - - void Function_txyz(const double t, const double* xp,double* temp) const; - void bc_flag_txyz(const double t, const double* xp, std::vector & flag) const; - void initialize_xyz(const double* xp, std::vector & value) const; - -}; - - #endif \ No newline at end of file diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 05f2512bc..b07f43056 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -118,15 +118,11 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr Pressure pressure("Qty_Pressure",qty_map,1,LL); qty_map.AddQuantity(&pressure); Velocity velocity("Qty_Velocity",qty_map,mesh.get_dim(),QQ); qty_map.AddQuantity(&velocity); -#if FOURTH_ROW==1 - Pressure2 pressure_2("Qty_Pressure_2",qty_map,1,KK); qty_map.AddQuantity(&pressure_2); -#endif - // ===== end QuantityMap ========================================= // ====== Start new main ================================= MultiLevelMesh ml_msh; - ml_msh.GenerateCoarseBoxMesh(8,8,0,0,1,0,1,0,0,QUAD9,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"seventh"); + ml_msh.GenerateCoarseBoxMesh(8,8,0,0,1,0,2,0,0,QUAD9,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"fifth"); ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); @@ -155,10 +151,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr eqnT.AddSolutionToSystemPDE("FAKE"); eqnT.AddUnknownToSystemPDE(&temperature); eqnT.AddUnknownToSystemPDE(&templift); - eqnT.AddUnknownToSystemPDE(&tempadj); -#if FOURTH_ROW==1 - eqnT.AddUnknownToSystemPDE(&pressure_2); //the order in which you add defines the order in the matrix as well, so it is in tune with the assemble function -#endif + eqnT.AddUnknownToSystemPDE(&tempadj);//the order in which you add defines the order in the matrix as well, so it is in tune with the assemble function eqnT.SetAssembleFunction(GenMatRhsT); //================================ From 9881111ea0d947a4c9c617d95a8cd784ea0845fc Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 13:24:13 -0600 Subject: [PATCH 27/91] Replaced DEFAULT_CONFIGDIR with DEFAULT_INPUTDIR --- src/meshGencase/GenCase.cpp | 2 +- src/utils/FemusDefault.hpp | 2 +- src/utils/FemusInputParser.hpp | 2 +- src/utils/Files.cpp | 8 ++++---- unittests/testSalomeIO/testSalomeIO.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/meshGencase/GenCase.cpp b/src/meshGencase/GenCase.cpp index cf64849e0..17346ace2 100644 --- a/src/meshGencase/GenCase.cpp +++ b/src/meshGencase/GenCase.cpp @@ -130,7 +130,7 @@ void GenCase::GenerateCoarseMesh() const { std::clock_t start_timeA=std::clock(); #endif - std::string config_dir = DEFAULT_CONFIGDIR; + std::string config_dir = DEFAULT_INPUTDIR; std::string f_mesh_read = _mesh_file; std::ostringstream mesh_infile; diff --git a/src/utils/FemusDefault.hpp b/src/utils/FemusDefault.hpp index 54bed848f..a13e6d9f8 100644 --- a/src/utils/FemusDefault.hpp +++ b/src/utils/FemusDefault.hpp @@ -35,7 +35,7 @@ #define DEFAULT_BASEPATH "./" -#define DEFAULT_CONFIGDIR "input/" +#define DEFAULT_INPUTDIR "input/" #define DEFAULT_OUTPUTDIR "output/" //we have to hardcode it here otherwise we cannot perform restart without logical inconsistencies #define DEFAULT_RUNTIMECONF "femus_conf.in" //********************************************* diff --git a/src/utils/FemusInputParser.hpp b/src/utils/FemusInputParser.hpp index fabedd46f..8fdf02df3 100644 --- a/src/utils/FemusInputParser.hpp +++ b/src/utils/FemusInputParser.hpp @@ -92,7 +92,7 @@ template void FemusInputParser::read() { std::ostringstream filename; - filename << _basepath << "/" << DEFAULT_CONFIGDIR << "/" << DEFAULT_RUNTIMECONF; + filename << _basepath << "/" << DEFAULT_INPUTDIR << "/" << DEFAULT_RUNTIMECONF; std::ifstream fin(filename.str().c_str()); diff --git a/src/utils/Files.cpp b/src/utils/Files.cpp index d289cc0cc..d4cdbf697 100644 --- a/src/utils/Files.cpp +++ b/src/utils/Files.cpp @@ -435,11 +435,11 @@ void Files::CopyFile(std::string f_in,std::string f_out) const { std::cout << "TODO: MUST FIND A WAY TO COPY A WHOLE DIRECTORY AND NOT THE SINGLE FILES" << std::endl; -CheckDirOrMake(_output_path,DEFAULT_CONFIGDIR); +CheckDirOrMake(_output_path,DEFAULT_INPUTDIR); //copy configuration file - std::string op_in = _input_path + "/" + DEFAULT_CONFIGDIR + "/" + DEFAULT_RUNTIMECONF; - std::string op_out = _output_path + "/" + DEFAULT_CONFIGDIR + "/" + DEFAULT_RUNTIMECONF; + std::string op_in = _input_path + "/" + DEFAULT_INPUTDIR + "/" + DEFAULT_RUNTIMECONF; + std::string op_out = _output_path + "/" + DEFAULT_INPUTDIR + "/" + DEFAULT_RUNTIMECONF; /*(iproc==0)*/ CopyFile(op_in,op_out); //TODO here we should also copy the mesh file from the mesh generator... but we need to know the filename... @@ -512,7 +512,7 @@ void Files::CheckIODirectories() { //INPUT std::string abs_app = "./"; -/*all procs*/ CheckDirOrAbort(abs_app,DEFAULT_CONFIGDIR); //it must be there only to be COPIED (and we don't even need the check in restart case) +/*all procs*/ CheckDirOrAbort(abs_app,DEFAULT_INPUTDIR); //it must be there only to be COPIED (and we don't even need the check in restart case) /*all procs*/ CheckDir(abs_app,DEFAULT_OUTPUTDIR); diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 2a2fb3a54..3aafa00e0 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -13,7 +13,7 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); std::string med_file = "Mesh_1.med"; - std::ostringstream mystream; mystream << "./" << DEFAULT_CONFIGDIR << "/" << med_file; + std::ostringstream mystream; mystream << "./" << DEFAULT_INPUTDIR << "/" << med_file; const std::string infile = mystream.str(); //Adimensional From 4cfcaed8e524e72e19d491c7a22845b6da45b35b Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 13:50:11 -0600 Subject: [PATCH 28/91] Renamed write_system_solutions to write --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- .../FSI/FSITimeDependentBenchmarks/main.cpp | 4 ++-- applications/FSI/FSI_TUREK_3/main.cpp | 2 +- .../BackwardEulerNavierStokesParallel/main.cpp | 2 +- .../NavierStokes/NavierStokesTemp_AMR/main.cpp | 2 +- .../SteadyNavierStokesParallel/main.cpp | 10 +++++----- .../NavierStokes/SteadyStokes/main.cpp | 6 +++--- .../main.cpp | 2 +- .../NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp | 4 ++-- .../NumPdeSpring2015/tutorial/Ex1/Ex1.cpp | 4 ++-- .../NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 4 ++-- applications/OptimalControl/tempopt/main.cpp | 3 +++ applications/Poisson/main.cpp | 6 +++--- applications/Poisson_AMR/main.cpp | 6 +++--- src/solution/GMVWriter.cpp | 2 +- src/solution/GMVWriter.hpp | 2 +- src/solution/VTKWriter.cpp | 2 +- src/solution/VTKWriter.hpp | 2 +- src/solution/Writer.hpp | 2 +- src/solution/XDMFWriter.cpp | 18 +++++++++--------- src/solution/XDMFWriter.hpp | 6 +++--- unittests/testNSSteadyDD/main.cpp | 2 +- 35 files changed, 74 insertions(+), 71 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 6833fe652..4ff775254 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -372,7 +372,7 @@ int main(int argc,char **args) { if (!dimension2D) print_vars.push_back("W"); print_vars.push_back("P"); - ml_sol.GetWriter()->write_system_solutions(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + ml_sol.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // Destroy all the new systems ml_prob.clear(); diff --git a/applications/FSI/FSITimeDependentBenchmarks/main.cpp b/applications/FSI/FSITimeDependentBenchmarks/main.cpp index c0c6c317f..724a60ac3 100644 --- a/applications/FSI/FSITimeDependentBenchmarks/main.cpp +++ b/applications/FSI/FSITimeDependentBenchmarks/main.cpp @@ -228,7 +228,7 @@ int main(int argc,char **args) { print_vars.push_back("V"); print_vars.push_back("P"); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); // Destroy all the new systems ml_prob.clear(); @@ -414,7 +414,7 @@ int main(int argc,char **args) { // print_vars.push_back("P"); // // // ml_probl.printsol_vtu_inline("biquadratic",print_vars,time_step); -// vtkio.write_system_solutions("biquadratic",print_vars,time_step); +// vtkio.write("biquadratic",print_vars,time_step); // } // // } //end loop timestep diff --git a/applications/FSI/FSI_TUREK_3/main.cpp b/applications/FSI/FSI_TUREK_3/main.cpp index b236229b1..63eeb7697 100644 --- a/applications/FSI/FSI_TUREK_3/main.cpp +++ b/applications/FSI/FSI_TUREK_3/main.cpp @@ -172,7 +172,7 @@ int main(int argc,char **args) { print_vars.push_back("P"); // ml_prob.printsol_vtu_inline("biquadratic",print_vars,time_step); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars,time_step); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars,time_step); } } //end loop timestep diff --git a/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp b/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp index d77174cd8..7fb67231c 100644 --- a/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp +++ b/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp @@ -128,7 +128,7 @@ int main(int argc,char **args) { // ml_prob.printsol_vtu_inline("biquadratic",print_vars,time_step); VTKWriter vtkio(ml_sol); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars,time_step); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars,time_step); } } //end loop timestep diff --git a/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp b/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp index 7492b8af0..c3b8c5745 100644 --- a/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp +++ b/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp @@ -260,7 +260,7 @@ int main(int argc,char **args) { print_vars.push_back("T"); GMVWriter gmvio(ml_sol); - gmvio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp index 40e545844..798e4ced2 100644 --- a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp +++ b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp @@ -232,15 +232,15 @@ int main(int argc,char **args) { print_vars.push_back("T"); VTKWriter vtkio(ml_sol); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); - //vtkio.write_system_solutions(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); + //vtkio.write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); GMVWriter gmvio(ml_sol); - gmvio.write_system_solutions(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); - // gmvio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + // gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); // XDMFWriter xdmfio(ml_sol); - // xdmfio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + // xdmfio.write(files.GetOutputPath(),"biquadratic",print_vars); //Destroy all the new systems ml_prob.clear(); diff --git a/applications/NavierStokes/SteadyStokes/main.cpp b/applications/NavierStokes/SteadyStokes/main.cpp index 4256aff45..5f3b402d2 100644 --- a/applications/NavierStokes/SteadyStokes/main.cpp +++ b/applications/NavierStokes/SteadyStokes/main.cpp @@ -175,13 +175,13 @@ int main(int argc,char **args) { VTKWriter vtkio(ml_sol); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); // XDMFWriter xdmfio(ml_prob); -// xdmfio.write_system_solutions("biquadratic",print_vars); +// xdmfio.write("biquadratic",print_vars); // GMVWriter gmvio(ml_sol); -// gmvio.write_system_solutions("biquadratic",print_vars); +// gmvio.write("biquadratic",print_vars); //Destroy all the new systems ml_prob.clear(); diff --git a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp index 14ee09e9e..46254653f 100644 --- a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp +++ b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp @@ -150,7 +150,7 @@ int main(int argc,char **args) { print_vars.push_back("AY"); // ml_prob.printsol_vtu_inline("biquadratic",print_vars,time_step); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars,time_step); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars,time_step); } } //end loop timestep diff --git a/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp index ac0b0e406..a1d189634 100644 --- a/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp @@ -80,11 +80,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp index 0c5eaf37d..9bf86e4d2 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp @@ -70,12 +70,12 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("T"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); return 0; } diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index 98ed5fd77..4b2a2d2af 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -94,11 +94,11 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("All"); VTKWriter vtkIO(mlSol); - vtkIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); GMVWriter gmvIO(mlSol); gmvIO.SetDebugOutput(true); - gmvIO.write_system_solutions(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); } } diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index b07f43056..000dd0822 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -129,6 +129,9 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); + ml_sol.SetWriter(VTK); +// ml_sol.GetWriter() + MultiLevelProblem ml_prob(&ml_sol); ml_prob.SetMeshTwo(&mesh); ml_prob.SetQruleAndElemType("fifth"); diff --git a/applications/Poisson/main.cpp b/applications/Poisson/main.cpp index 80b197d0c..41425502b 100644 --- a/applications/Poisson/main.cpp +++ b/applications/Poisson/main.cpp @@ -255,13 +255,13 @@ int main(int argc,char **argv) { print_vars.push_back("Sol"); VTKWriter vtkio(ml_sol); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); GMVWriter gmvio(ml_sol); - gmvio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); // // XDMFWriter xdmfio(ml_sol); - // xdmfio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + // xdmfio.write(files.GetOutputPath(),"biquadratic",print_vars); //Destroy all the new systems ml_prob.clear(); diff --git a/applications/Poisson_AMR/main.cpp b/applications/Poisson_AMR/main.cpp index 32486043b..f1b8422b2 100644 --- a/applications/Poisson_AMR/main.cpp +++ b/applications/Poisson_AMR/main.cpp @@ -422,14 +422,14 @@ int main(int argc,char **argv) { print_vars.push_back("Sol"); VTKWriter vtkio(ml_sol); - vtkio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); GMVWriter gmvio(ml_sol); - gmvio.write_system_solutions(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); // // XDMFWriter xdmfio(ml_sol); - // xdmfio.write_system_solutions("biquadratic",print_vars); + // xdmfio.write("biquadratic",print_vars); int iproc; MPI_Comm_rank(MPI_COMM_WORLD, &iproc); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 944908e2a..446fb4755 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -41,7 +41,7 @@ GMVWriter::~GMVWriter() } -void GMVWriter::write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) +void GMVWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { MultiLevelMesh *mlMsh = _ml_sol._ml_msh; diff --git a/src/solution/GMVWriter.hpp b/src/solution/GMVWriter.hpp index 1edb1ed56..f9e7529c0 100644 --- a/src/solution/GMVWriter.hpp +++ b/src/solution/GMVWriter.hpp @@ -43,7 +43,7 @@ namespace femus { virtual ~GMVWriter(); /** write output function */ - virtual void write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); /** Set if to print or not to prind the debugging variables */ void SetDebugOutput( bool value ){ _debugOutput = value;} diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 0f421b780..0cd8347d1 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -46,7 +46,7 @@ VTKWriter::~VTKWriter() } -void VTKWriter::write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) +void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { bool print_all = 0; for (unsigned ivar=0; ivar < vars.size(); ivar++){ diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index a9e30f9e8..341e7f6f1 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -43,7 +43,7 @@ class VTKWriter : public Writer { virtual ~VTKWriter(); /** write output function */ - virtual void write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); private: diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index 9641ecfd9..fead8ea84 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -49,7 +49,7 @@ namespace femus { virtual ~Writer(); /** write output function */ - virtual void write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) = 0; + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) = 0; /** set moving mesh */ void SetMovingMesh(std::vector& movvars_in); diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 6b19114b5..a95853774 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -64,7 +64,7 @@ XDMFWriter::~XDMFWriter() } -void XDMFWriter::write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) +void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { #ifdef HAVE_HDF5 @@ -753,17 +753,17 @@ void XDMFWriter::PrintXDMFGeometry(std::ofstream& outfstream, // pos_in_mesh_obj gives me the position of the GEomElObject: in fact the quadratic dofs are built on the quadratic GeomEls exactly in this order //here we are picking the NODES per subd and level, so we are sure don't pass MORE TIMES on the SAME NODE -// PRoblem with the linear variables in write_system_solutions and PrintBc. +// PRoblem with the linear variables in write and PrintBc. //There is one line that brings to mistake, but TWO different mistakes. // in PrintBc it seems to be related to HDF5; -// in write_system_solutions it seems to concern PETSC +// in write it seems to concern PETSC //so that is the wrong line, if i comment it everything seems to work for any processor. //with two and three processors it seems to give even different errors... //when there is an error related to HDF5, the stack has the _start thing... // with two procs there is an error related to Petsc, // with three procs there is an error related to HDF5... -//If I only use PrintBc and not write_system_solutions, +//If I only use PrintBc and not write, //both with 2 and 3 processors the errors are related to HDF5... this is so absolutely weird... //Now it seems like I am restricted to that line. That line is responsible for the error. @@ -885,7 +885,7 @@ void XDMFWriter::PrintXDMFGeometry(std::ofstream& outfstream, //except for the fine level where i print the true solution // This prints All Variables of One Equation -void XDMFWriter::write_system_solutions(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn) { +void XDMFWriter::write(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn) { std::vector fe_in(QL); for (int fe=0; fe_geomelem_id[mesh->get_dim()-1-VV].c_str(),fe); @@ -1184,7 +1184,7 @@ void XDMFWriter::read_system_solutions(const std::string namefile, const MultiLe // e' quella FINE, ma noi ora dobbiamo prendere quella DI CIASCUN LIVELLO SEPARATAMENTE! -void XDMFWriter::write_system_solutions_bc(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn, const int* bc, int** bc_fe_kk ) { +void XDMFWriter::write_bc(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn, const int* bc, int** bc_fe_kk ) { std::vector fe_in(QL); for (int fe=0; fe_geomelem_id[mesh->get_dim()-1-VV].c_str(),fe); @@ -2427,7 +2427,7 @@ void XDMFWriter::PrintSolHDF5Linear(const std::string output_path, const uint t_ MultiLevelProblem::const_system_iterator pos_e = ml_prob.end(); for (;pos!=pos_e;pos++) { SystemTwo* eqn = static_cast(pos->second); - XDMFWriter::write_system_solutions(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn); + XDMFWriter::write(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn); } } //end print iproc @@ -2597,8 +2597,8 @@ void XDMFWriter::PrintCaseHDF5Linear(const std::string output_path, const uint t MultiLevelProblem::const_system_iterator pos_e = ml_prob.end(); for (;pos!=pos_e;pos++) { SystemTwo* eqn = static_cast(pos->second); - XDMFWriter::write_system_solutions(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn); // initial solution - XDMFWriter::write_system_solutions_bc(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn,eqn->_bcond._bc,eqn->_bcond._bc_fe_kk); // boundary condition + XDMFWriter::write(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn); // initial solution + XDMFWriter::write_bc(filename.str(),& ml_prob.GetMeshTwo(),&(eqn->_dofmap),eqn,eqn->_bcond._bc,eqn->_bcond._bc_fe_kk); // boundary condition } } //end iproc diff --git a/src/solution/XDMFWriter.hpp b/src/solution/XDMFWriter.hpp index cebbd4671..894f0b81a 100644 --- a/src/solution/XDMFWriter.hpp +++ b/src/solution/XDMFWriter.hpp @@ -42,7 +42,7 @@ class XDMFWriter : public Writer { virtual ~XDMFWriter(); /** write output function */ - virtual void write_system_solutions(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0); /** write a wrapper file for paraview to open all the files of an history together */ void write_solution_wrapper(const std::string output_path, const char type[]) const; @@ -50,8 +50,8 @@ class XDMFWriter : public Writer { //================== static void transient_print_xmf(const std::string output_path, const uint t_idx_in,const uint t_idx_final, const int print_step, const uint nolevels_in); - static void write_system_solutions_bc(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn, const int* bc, int** bc_fe_kk); - static void write_system_solutions(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn); ///prints on a "Quadratic-Linearized" Mesh //TODO this should be PrintNumericVector of the equation //Writer// + static void write_bc(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn, const int* bc, int** bc_fe_kk); + static void write(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn); ///prints on a "Quadratic-Linearized" Mesh //TODO this should be PrintNumericVector of the equation //Writer// static void read_system_solutions(const std::string namefile, const MultiLevelMeshTwo* mesh, const DofMap* dofmap, const SystemTwo* eqn); ///read from a "Quadratic-Linearized" Mesh //Writer/Reader// //hdf5 ------------------------------------ diff --git a/unittests/testNSSteadyDD/main.cpp b/unittests/testNSSteadyDD/main.cpp index 432f98b84..c0790b92d 100644 --- a/unittests/testNSSteadyDD/main.cpp +++ b/unittests/testNSSteadyDD/main.cpp @@ -247,7 +247,7 @@ int main(int argc,char **args) { // print_vars.push_back("T"); // GMVWriter gmvio(ml_sol); -// gmvio.write_system_solutions("biquadratic",print_vars); +// gmvio.write("biquadratic",print_vars); From 62c58024074cfd84a5b2a9b53dd62f134d524c99 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 14:23:20 -0600 Subject: [PATCH 29/91] Converted reference to pointer in Writer --- src/solution/GMVWriter.cpp | 103 +++++++++++++++++----------------- src/solution/GMVWriter.hpp | 5 +- src/solution/VTKWriter.cpp | 59 ++++++++++---------- src/solution/VTKWriter.hpp | 5 +- src/solution/Writer.cpp | 22 +++++--- src/solution/Writer.hpp | 13 ++++- src/solution/XDMFWriter.cpp | 108 +++++++++++++++++------------------- src/solution/XDMFWriter.hpp | 5 +- 8 files changed, 172 insertions(+), 148 deletions(-) diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 446fb4755..df513867c 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -31,7 +31,12 @@ namespace femus { -GMVWriter::GMVWriter(MultiLevelSolution & ml_probl): Writer(ml_probl) +GMVWriter::GMVWriter(MultiLevelSolution * ml_sol): Writer(ml_sol) +{ + _debugOutput = false; +} + +GMVWriter::GMVWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) { _debugOutput = false; } @@ -44,8 +49,6 @@ GMVWriter::~GMVWriter() void GMVWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { - MultiLevelMesh *mlMsh = _ml_sol._ml_msh; - unsigned igridn = _gridn; // aggiunta da me if (igridn==0) igridn=_gridn; @@ -76,7 +79,7 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve unsigned nvt=0; unsigned nvt_max=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; nvt_max=(nvt_max>nvt_ig)?nvt_max:nvt_ig; nvt+=nvt_ig; } @@ -85,7 +88,7 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve vector Mysol(igridn); for(unsigned ig=igridr-1u; ig<_gridn; ig++) { Mysol[ig] = NumericVector::build().release(); - Mysol[ig]->init(mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs],mlMsh->GetLevel(ig)->own_size[index][_iproc],true,AUTOMATIC); + Mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index][_iproc],true,AUTOMATIC); } // ********** Header ********** @@ -102,21 +105,21 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve for (int i=0; i<3; i++) { for (unsigned ig=igridr-1u; igmatrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + Mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); vector v_local; Mysol[ig]->localize_to_one(v_local,0); - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { - unsigned indDXDYDZ=_ml_sol.GetIndex(_moving_vars[i].c_str()); - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(indDXDYDZ)) ); + if (_moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { + unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(indDXDYDZ)) ); Mysol[ig]->localize_to_one(v_local,0); - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; if(_iproc==0){ for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); - nel+=mlMsh->GetLevel(igridn-1u)->GetNumberOfElements(); + nel+=( _ml_mesh->GetLevel(ig)->GetNumberOfElements() - _ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber()); + nel+=_ml_mesh->GetLevel(igridn-1u)->GetNumberOfElements(); fout.write((char *)&nel,sizeof(unsigned)); unsigned topology[27]; unsigned offset=1; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - short unsigned ielt=mlMsh->GetLevel(ig)->el->GetElementType(ii); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(ii); if (ielt==0) sprintf(det,"phex%d",eltp[index][0]); else if (ielt==1) sprintf(det,"ptet%d",eltp[index][1]); else if (ielt==2) sprintf(det,"pprism%d",eltp[index][2]); @@ -162,15 +165,15 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve fout.write((char *)&NVE[ielt][index],sizeof(unsigned)); for(unsigned j=0;jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; - unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index); + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); topology[j]=jnode_Metis+offset; } fout.write((char *)topology,sizeof(unsigned)*NVE[ielt][index]); } } - offset+=mlMsh->GetLevel(ig)->MetisOffset[index][_nprocs]; + offset+=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; } // ********** End printing cell connectivity ********** @@ -189,9 +192,9 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=mlMsh->GetLevel(ig)->el->GetElementGroup(ii); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } } @@ -205,9 +208,9 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=mlMsh->GetLevel(ig)->epart[ii]; + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->epart[ii]; icount++; } } @@ -223,42 +226,42 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve printAll += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } - for (unsigned ivar=0; ivar< !printAll*vars.size() + printAll*_ml_sol.GetSolutionSize(); ivar++) { - unsigned i = ( printAll == 0 ) ? _ml_sol.GetIndex( vars[ivar].c_str()) : ivar; + for (unsigned ivar=0; ivar< !printAll*vars.size() + printAll*_ml_sol->GetSolutionSize(); ivar++) { + unsigned i = ( printAll == 0 ) ? _ml_sol->GetIndex( vars[ivar].c_str()) : ivar; for(int name=0;name<4;name++){ if (name==0){ - sprintf(det,"%s", _ml_sol.GetSolutionName(i)); + sprintf(det,"%s", _ml_sol->GetSolutionName(i)); } else if (name==1){ - sprintf(det,"%s %s","Bdc",_ml_sol.GetSolutionName(i)); + sprintf(det,"%s %s","Bdc",_ml_sol->GetSolutionName(i)); } else if (name==2){ - sprintf(det,"%s %s","Res",_ml_sol.GetSolutionName(i)); + sprintf(det,"%s %s","Res",_ml_sol->GetSolutionName(i)); } else{ - sprintf(det,"%s %s","Eps",_ml_sol.GetSolutionName(i)); + sprintf(det,"%s %s","Eps",_ml_sol->GetSolutionName(i)); } - if(name==0 || ( _debugOutput && _ml_sol.GetSolutionLevel(igridn-1u)->_ResEpsBdcFlag[i])){ - if (_ml_sol.GetSolutionType(i)<3) { // ********** on the nodes ********** + if(name==0 || ( _debugOutput && _ml_sol->GetSolutionLevel(igridn-1u)->_ResEpsBdcFlag[i])){ + if (_ml_sol->GetSolutionType(i)<3) { // ********** on the nodes ********** fout.write((char *)det,sizeof(char)*8); fout.write((char *)&one,sizeof(unsigned)); for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); } else if (name==1){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Bdc[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Bdc[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); } else if (name==2){ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Res[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Res[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); } else{ - Mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Eps[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(i)) ); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Eps[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); } std::vector v_local; Mysol[ig]->localize_to_one(v_local,0); @@ -272,20 +275,20 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve for (unsigned ig=igridr-1u; ig v_local; if (name==0){ - _ml_sol.GetSolutionLevel(ig)->_Sol[i]->localize_to_one(v_local,0); + _ml_sol->GetSolutionLevel(ig)->_Sol[i]->localize_to_one(v_local,0); } else if (name==1){ - _ml_sol.GetSolutionLevel(ig)->_Bdc[i]->localize_to_one(v_local,0); + _ml_sol->GetSolutionLevel(ig)->_Bdc[i]->localize_to_one(v_local,0); } else if (name==2){ - _ml_sol.GetSolutionLevel(ig)->_Res[i]->localize_to_one(v_local,0); + _ml_sol->GetSolutionLevel(ig)->_Res[i]->localize_to_one(v_local,0); } else{ - _ml_sol.GetSolutionLevel(ig)->_Eps[i]->localize_to_one(v_local,0); + _ml_sol->GetSolutionLevel(ig)->_Eps[i]->localize_to_one(v_local,0); } - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==igridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(i)); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(i)); var_el[icount]=v_local[iel_Metis]; icount++; } diff --git a/src/solution/GMVWriter.hpp b/src/solution/GMVWriter.hpp index f9e7529c0..171eb0a09 100644 --- a/src/solution/GMVWriter.hpp +++ b/src/solution/GMVWriter.hpp @@ -37,7 +37,10 @@ namespace femus { public: /** Constructor. */ - GMVWriter(MultiLevelSolution & ml_sol); + GMVWriter(MultiLevelSolution * ml_sol); + + /** Constructor. */ + GMVWriter(MultiLevelMesh * ml_mesh); /** Destructor */ virtual ~GMVWriter(); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 0cd8347d1..f5a729473 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -35,15 +35,11 @@ namespace femus { short unsigned int VTKWriter::femusToVtkCellType[3][6]= {{12,10,13,9,5,3},{25,24,26,23,22,21},{29,24,32,28,22,21}}; -VTKWriter::VTKWriter(MultiLevelSolution & ml_probl): Writer(ml_probl) -{ - -} +VTKWriter::VTKWriter(MultiLevelSolution * ml_sol): Writer(ml_sol) {} -VTKWriter::~VTKWriter() -{ - -} +VTKWriter::VTKWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} + +VTKWriter::~VTKWriter() {} void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) @@ -53,7 +49,7 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } - MultiLevelMesh *mlMsh = _ml_sol._ml_msh; + MultiLevelMesh * mlMsh = _ml_mesh; int icount; unsigned index=0; @@ -174,22 +170,23 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve offset_nvt3+=3*nvt_ig; } - if (_moving_mesh) { + + if (_ml_sol != NULL && _moving_mesh == true) { unsigned offset_nvt3=0; unsigned indDXDYDZ[3]; - indDXDYDZ[0]=_ml_sol.GetIndex(_moving_vars[0].c_str()); - indDXDYDZ[1]=_ml_sol.GetIndex(_moving_vars[1].c_str()); + indDXDYDZ[0]=_ml_sol->GetIndex(_moving_vars[0].c_str()); + indDXDYDZ[1]=_ml_sol->GetIndex(_moving_vars[1].c_str()); if(mlMsh->GetLevel(0)->GetDimension() == 3) { - indDXDYDZ[2]=_ml_sol.GetIndex(_moving_vars[2].c_str()); + indDXDYDZ[2]=_ml_sol->GetIndex(_moving_vars[2].c_str()); } for(unsigned ig=_gridr-1u; ig<_gridn; ig++){ std::vector v_local; unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kkGetLevel(0)->GetDimension();kk++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol.GetSolutionType(indDXDYDZ[kk]))); + mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indDXDYDZ[kk]))); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; i" << std::endl; + //----------------------------------------------------------------------------------------------------- // Print Metis Partitioning fout << " " << std::endl; @@ -405,21 +403,22 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve fout << std::endl; fout << " " << std::endl; + if (_ml_sol != NULL) { //Print Solution (on element) *************************************************************** - for (unsigned i=0; i<(!print_all)*vars.size() + print_all*_ml_sol.GetSolutionSize(); i++) { - unsigned indx=( print_all == 0 ) ? _ml_sol.GetIndex(vars[i].c_str()):i; - if (3 <= _ml_sol.GetSolutionType(indx)) { - fout << " " << std::endl; + for (unsigned i=0; i<(!print_all)*vars.size() + print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=( print_all == 0 ) ? _ml_sol->GetIndex(vars[i].c_str()):i; + if (3 <= _ml_sol->GetSolutionType(indx)) { + fout << " GetSolutionName(indx) <<"\" format=\"binary\">" << std::endl; // point pointer to common memory area buffer of void type; float *var_el = static_cast< float*> (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { vector sol_local; - _ml_sol.GetSolutionLevel(ig)->_Sol[indx]->localize_to_one(sol_local,0); + _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->localize_to_one(sol_local,0); for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); + unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); var_el[icount]=sol_local[iel_Metis]; icount++; } @@ -454,10 +453,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve // point pointer to common memory area buffer of void type; float* var_nd = static_cast(buffer_void); - for (unsigned i=0; i<(!print_all)*vars.size()+ print_all*_ml_sol.GetSolutionSize(); i++) { - unsigned indx=( print_all == 0 )?_ml_sol.GetIndex(vars[i].c_str()):i; - if (_ml_sol.GetSolutionType(indx)<3) { - fout << " " << std::endl; + for (unsigned i=0; i<(!print_all)*vars.size()+ print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=( print_all == 0 )?_ml_sol->GetIndex(vars[i].c_str()):i; + if (_ml_sol->GetSolutionType(indx)<3) { + fout << " GetSolutionName(indx) <<"\" format=\"binary\">" << std::endl; //print solutions on nodes dimension cch = b64::b64_encode(&dim_array_ndvar[0], sizeof(dim_array_ndvar), NULL, 0); b64::b64_encode(&dim_array_ndvar[0], sizeof(dim_array_ndvar), &enc[0], cch); @@ -466,8 +465,8 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { - mysol[ig]->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol.GetSolutionType(indx)) ); + mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], + *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indx)) ); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; @@ -490,6 +489,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve } // end for sol fout << " " << std::endl; + delete [] var_nd; + + } //end _ml_sol != NULL + //------------------------------------------------------------------------------------------------ fout << " " << std::endl; @@ -503,7 +506,7 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve delete mysol[ig]; } - delete [] var_nd; + //-------------------------------------------------------------------------------------------------------- return; diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index 341e7f6f1..34f04f395 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -37,7 +37,10 @@ class VTKWriter : public Writer { public: /** Constructor. */ - VTKWriter(MultiLevelSolution & ml_sol); + VTKWriter(MultiLevelSolution * ml_sol); + + /** Constructor. */ + VTKWriter(MultiLevelMesh * ml_mesh); /** Destructor */ virtual ~VTKWriter(); diff --git a/src/solution/Writer.cpp b/src/solution/Writer.cpp index 03d62caed..1254c7642 100644 --- a/src/solution/Writer.cpp +++ b/src/solution/Writer.cpp @@ -34,14 +34,22 @@ namespace femus { - Writer::Writer(MultiLevelSolution& ml_sol): - _ml_sol(ml_sol) + Writer::Writer( MultiLevelSolution* ml_sol ): + _ml_sol(ml_sol), _ml_mesh(ml_sol->_ml_msh) { - _gridn = ml_sol._ml_msh->GetNumberOfLevels(); - _gridr = ml_sol._ml_msh->GetNumberOfGridTotallyRefined(); + _gridn = _ml_mesh->GetNumberOfLevels(); + _gridr = _ml_mesh->GetNumberOfGridTotallyRefined(); _moving_mesh = 0; } + Writer::Writer( MultiLevelMesh* ml_mesh ): + _ml_sol(NULL), _ml_mesh(ml_mesh) + { + _gridn = _ml_mesh->GetNumberOfLevels(); + _gridr = _ml_mesh->GetNumberOfGridTotallyRefined(); + _moving_mesh = 0; + } + Writer::~Writer() { } @@ -49,13 +57,13 @@ namespace femus { switch (format) { case VTK: { - std::auto_ptr ap(new VTKWriter(*ml_sol)); return ap; + std::auto_ptr ap(new VTKWriter(ml_sol)); return ap; } case GMV: { - std::auto_ptr ap(new GMVWriter(*ml_sol)); return ap; + std::auto_ptr ap(new GMVWriter(ml_sol)); return ap; } case XDMF: { - std::auto_ptr ap(new XDMFWriter(*ml_sol)); return ap; + std::auto_ptr ap(new XDMFWriter(ml_sol)); return ap; } default: { std::cout << "Format not supported" << std::endl; diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index fead8ea84..87818fab7 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -33,6 +33,7 @@ namespace femus { //------------------------------------------------------------------------------ // Forward declarations //------------------------------------------------------------------------------ + class MultiLevelMesh; class MultiLevelSolution; class SparseMatrix; class Vector; @@ -43,7 +44,10 @@ namespace femus { public: /** Constructor. */ - Writer(MultiLevelSolution & ml_probl); + Writer(MultiLevelSolution * ml_sol); + + /** Constructor. */ + Writer(MultiLevelMesh * ml_mesh); /** Destructor */ virtual ~Writer(); @@ -64,8 +68,11 @@ namespace femus { /** the displacement variables for mesh moving */ std::vector _moving_vars; - /** the multilevelsolution reference */ - MultiLevelSolution& _ml_sol; + /** the multilevelsolution pointer */ + MultiLevelSolution* _ml_sol; + + /** the multilevel mesh */ + MultiLevelMesh* _ml_mesh; int _gridn; diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index a95853774..d411f8699 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -54,22 +54,16 @@ namespace femus { // _el_pid_name = "PID"; // _nd_map_FineToLev = "MAP"; -XDMFWriter::XDMFWriter(MultiLevelSolution& ml_probl): Writer(ml_probl) -{ - -} +XDMFWriter::XDMFWriter(MultiLevelSolution * ml_sol): Writer(ml_sol) {} -XDMFWriter::~XDMFWriter() -{ - -} +XDMFWriter::XDMFWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} + +XDMFWriter::~XDMFWriter() {} void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) { #ifdef HAVE_HDF5 - MultiLevelMesh *mlMsh = _ml_sol._ml_msh; - bool test_all=!(vars[0].compare("All")); unsigned index=0; @@ -89,7 +83,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //I assume that the mesh is not mixed std::string type_elem; - unsigned elemtype = mlMsh->GetLevel(_gridn-1u)->el->GetElementType(0); + unsigned elemtype = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementType(0); type_elem = XDMFWriter::type_el[index][elemtype]; if (type_elem.compare("Not_implemented") == 0) @@ -100,19 +94,19 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v unsigned nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); nvt+=nvt_ig; } // Printing connectivity unsigned nel=0; for(unsigned ig=0;ig<_gridn-1u;ig++) { - nel+=( mlMsh->GetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); + nel+=( _ml_mesh->GetLevel(ig)->GetNumberOfElements() - _ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber()); } - nel+=mlMsh->GetLevel(_gridn-1u)->GetNumberOfElements(); + nel+=_ml_mesh->GetLevel(_gridn-1u)->GetNumberOfElements(); unsigned icount; - unsigned el_dof_number = mlMsh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index); + unsigned el_dof_number = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index); int *var_int = new int [nel*el_dof_number]; float *var_el_f = new float [nel]; float *var_nd_f = new float [nvt]; @@ -175,19 +169,19 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v fout << "" << std::endl; // Solution Variables for (unsigned i=0; iGetIndex(vars[i].c_str()); //Printing biquadratic solution on the nodes - if(_ml_sol.GetSolutionType(indx)<3) { - fout << "" << std::endl; + if(_ml_sol->GetSolutionType(indx)<3) { + fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Node\">" << std::endl; fout << "" << std::endl; - fout << filename << ":" << _ml_sol.GetSolutionName(indx) << std::endl; + fout << filename << ":" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } - else if (_ml_sol.GetSolutionType(indx)>=3) { //Printing picewise constant solution on the element - fout << "" << std::endl; + else if (_ml_sol->GetSolutionType(indx)>=3) { //Printing picewise constant solution on the element + fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Cell\">" << std::endl; fout << "" << std::endl; - fout << filename << ":" << _ml_sol.GetSolutionName(indx) << std::endl; + fout << filename << ":" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } @@ -218,16 +212,16 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { NumericVector* mysol; mysol = NumericVector::build().release(); - //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[i], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,2) ); - unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); + //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); + mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iimatrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol.GetSolutionType(varind_DXDYDZ))); + unsigned varind_DXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); + mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(varind_DXDYDZ))); for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); iel++) { - if (mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { - for (unsigned j=0; jGetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { + for (unsigned iel=0; iel<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++) { + if (_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { unsigned vtk_loc_conn = map_pr[j]; - unsigned jnode=mlMsh->GetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; - unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index_nd); + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index_nd); var_int[icount] = offset_conn + jnode_Metis; icount++; } } } - offset_conn += mlMsh->GetLevel(ig)->GetDofNumber(index_nd); + offset_conn += _ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); } dimsf[0] = nel*el_dof_number ; dimsf[1] = 1; @@ -280,10 +274,10 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v // print regions icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); - var_int[icount] = mlMsh->GetLevel(ig)->el->GetElementGroup(iel_Metis); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + var_int[icount] = _ml_mesh->GetLevel(ig)->el->GetElementGroup(iel_Metis); icount++; } } @@ -299,15 +293,15 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //------------------------------------------------------------------------------------------------------- // printing element variables - for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol.GetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol.GetIndex(vars[i].c_str()):i; - if (_ml_sol.GetSolutionType(indx)>=3) { + for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + if (_ml_sol->GetSolutionType(indx)>=3) { icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol.GetSolutionType(indx)); - var_el_f[icount]=(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx])(iel_Metis); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); + var_el_f[icount]=(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx])(iel_Metis); icount++; } } @@ -315,7 +309,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v dimsf[0] = nel; dimsf[1] = 1; dataspace = H5Screate_simple(2,dimsf, NULL); - dataset = H5Dcreate(file_id,_ml_sol.GetSolutionName(indx),H5T_NATIVE_FLOAT, + dataset = H5Dcreate(file_id,_ml_sol->GetSolutionName(indx),H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_el_f[0]); H5Sclose(dataspace); @@ -326,18 +320,18 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //------------------------------------------------------------------------------------------------------- // printing nodes variables - for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol.GetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol.GetIndex(vars[i].c_str()):i; - if (_ml_sol.GetSolutionType(indx) < 3) { + for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + if (_ml_sol->GetSolutionType(indx) < 3) { unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { NumericVector* mysol; mysol = NumericVector::build().release(); - //mysol->init(mlMsh->GetLevel(ig)->GetDofNumber(index_nd),mlMsh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); - mysol->matrix_mult(*_ml_sol.GetSolutionLevel(ig)->_Sol[indx], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol.GetSolutionType(indx)) ); - unsigned nvt_ig=mlMsh->GetLevel(ig)->GetDofNumber(index_nd); + //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); + mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(indx)) ); + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iiGetSolutionName(indx),H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_nd_f[0]); H5Sclose(dataspace); diff --git a/src/solution/XDMFWriter.hpp b/src/solution/XDMFWriter.hpp index 894f0b81a..bbee4d79c 100644 --- a/src/solution/XDMFWriter.hpp +++ b/src/solution/XDMFWriter.hpp @@ -36,7 +36,10 @@ class XDMFWriter : public Writer { public: /** Constructor. */ - XDMFWriter(MultiLevelSolution & ml_sol); + XDMFWriter(MultiLevelSolution * ml_sol); + + /** Constructor. */ + XDMFWriter(MultiLevelMesh * ml_mesh); /** Destructor */ virtual ~XDMFWriter(); From d1f778c19b34827bd4a52e169c3f8a6dde029d64 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 14:48:18 -0600 Subject: [PATCH 30/91] Writer for MLMesh working with GMV --- applications/OptimalControl/tempopt/main.cpp | 7 ++++--- src/mesh/Mesh.hpp | 2 +- src/mesh/MultiLevelMesh.hpp | 14 +++++++++++++- src/solution/GMVWriter.cpp | 9 ++++++--- src/solution/GMVWriter.hpp | 3 ++- src/solution/VTKWriter.cpp | 3 +-- src/solution/VTKWriter.hpp | 2 +- src/solution/Writer.cpp | 20 ++++++++++++++++++++ src/solution/Writer.hpp | 6 +++++- src/solution/XDMFWriter.cpp | 3 +-- src/solution/XDMFWriter.hpp | 2 +- 11 files changed, 55 insertions(+), 16 deletions(-) diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 000dd0822..7b2f5cfa0 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -126,12 +126,13 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); + ml_msh.SetWriter(GMV); + std::vector print_vars; + ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic",print_vars); + MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); - ml_sol.SetWriter(VTK); -// ml_sol.GetWriter() - MultiLevelProblem ml_prob(&ml_sol); ml_prob.SetMeshTwo(&mesh); ml_prob.SetQruleAndElemType("fifth"); diff --git a/src/mesh/Mesh.hpp b/src/mesh/Mesh.hpp index 394fa2366..0b0db0d36 100644 --- a/src/mesh/Mesh.hpp +++ b/src/mesh/Mesh.hpp @@ -176,6 +176,7 @@ class Mesh : public ParallelObject { _coarseMsh = otherCoarseMsh; }; + private: /** Coarser mesh from which this mesh is generated, it equals NULL if _level = 0 */ Mesh* _coarseMsh; @@ -209,7 +210,6 @@ class Mesh : public ParallelObject { vector IS_Gmt2Mts_dof[5]; //< dof map vector IS_Gmt2Mts_dof_offset[5]; //< map offset static const unsigned _END_IND[5]; - }; } //end namespace femus diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index 6cb6645f5..3c79a8cf3 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -17,8 +17,10 @@ PURPOSE. See the above copyright notice for more information. #define __femus_mesh_MultiLevelMesh_hpp__ -#include "ElemTypeEnum.hpp" #include +#include "ElemTypeEnum.hpp" +#include "WriterEnum.hpp" +#include "Writer.hpp" namespace femus { @@ -100,6 +102,13 @@ class MultiLevelMesh { // data const elem_type *_finiteElement[6][5]; + + /** To be Added */ + const Writer* GetWriter() const {return _writer; } + + /** To be Added */ + void SetWriter(const WriterEnum format) { _writer = Writer::build(format,this).release(); } + protected: @@ -114,6 +123,9 @@ class MultiLevelMesh { std::vector _level0; std::vector _level; std::vector _finiteElementGeometryFlag; + + /** MultilevelMesh writer */ + Writer* _writer; }; diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index df513867c..16ea494de 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -46,8 +46,7 @@ GMVWriter::~GMVWriter() } -void GMVWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) -{ +void GMVWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { unsigned igridn = _gridn; // aggiunta da me @@ -114,7 +113,7 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(indDXDYDZ)) ); @@ -221,6 +220,8 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve // ********** End printing Regions ********** // ********** Start printing Solution ********** + if (_ml_sol != NULL) { + bool printAll = 0; for (unsigned ivar=0; ivar < vars.size(); ivar++){ printAll += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); @@ -299,6 +300,8 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve } } } + + } //end _ml_sol // ********** End printing Solution ********** sprintf(det,"%s","endvars"); fout.write((char *)det,sizeof(char)*8); diff --git a/src/solution/GMVWriter.hpp b/src/solution/GMVWriter.hpp index 171eb0a09..88128490d 100644 --- a/src/solution/GMVWriter.hpp +++ b/src/solution/GMVWriter.hpp @@ -46,12 +46,13 @@ namespace femus { virtual ~GMVWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0) const; /** Set if to print or not to prind the debugging variables */ void SetDebugOutput( bool value ){ _debugOutput = value;} private: + bool _debugOutput; }; diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index f5a729473..872f4d394 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -42,8 +42,7 @@ VTKWriter::VTKWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} VTKWriter::~VTKWriter() {} -void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) -{ +void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { bool print_all = 0; for (unsigned ivar=0; ivar < vars.size(); ivar++){ print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index 34f04f395..3a230a488 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -46,7 +46,7 @@ class VTKWriter : public Writer { virtual ~VTKWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0) const; private: diff --git a/src/solution/Writer.cpp b/src/solution/Writer.cpp index 1254c7642..bccccfd99 100644 --- a/src/solution/Writer.cpp +++ b/src/solution/Writer.cpp @@ -70,8 +70,28 @@ namespace femus { abort(); } } //end switch + } + std::auto_ptr Writer::build(const WriterEnum format, MultiLevelMesh * ml_mesh) { + + switch (format) { + case VTK: { + std::auto_ptr ap(new VTKWriter(ml_mesh)); return ap; + } + case GMV: { + std::auto_ptr ap(new GMVWriter(ml_mesh)); return ap; + } + case XDMF: { + std::auto_ptr ap(new XDMFWriter(ml_mesh)); return ap; + } + default: { + std::cout << "Format not supported" << std::endl; + abort(); + } + } //end switch + + } void Writer::SetMovingMesh(std::vector& movvars_in){ _moving_mesh = 1; diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index 87818fab7..68dab1f42 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -53,13 +53,17 @@ namespace femus { virtual ~Writer(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) = 0; + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) const = 0; /** set moving mesh */ void SetMovingMesh(std::vector& movvars_in); + /** runtime selection of writer for MLsol */ static std::auto_ptr build(const WriterEnum format, MultiLevelSolution * ml_sol); + /** runtime selection of writer for MLmesh */ + static std::auto_ptr build(const WriterEnum format, MultiLevelMesh * ml_mesh); + protected: /** a flag to move the output mesh */ diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index d411f8699..dfecd599b 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -60,8 +60,7 @@ XDMFWriter::XDMFWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} XDMFWriter::~XDMFWriter() {} -void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) -{ +void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { #ifdef HAVE_HDF5 bool test_all=!(vars[0].compare("All")); diff --git a/src/solution/XDMFWriter.hpp b/src/solution/XDMFWriter.hpp index bbee4d79c..b2a7dae2a 100644 --- a/src/solution/XDMFWriter.hpp +++ b/src/solution/XDMFWriter.hpp @@ -45,7 +45,7 @@ class XDMFWriter : public Writer { virtual ~XDMFWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0); + virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) const; /** write a wrapper file for paraview to open all the files of an history together */ void write_solution_wrapper(const std::string output_path, const char type[]) const; From bc9df00d30faec43394e931fcd2fc780fadc0a91 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 14:56:19 -0600 Subject: [PATCH 31/91] Writer for MLMesh working with VTK --- applications/OptimalControl/tempopt/main.cpp | 2 +- src/solution/VTKWriter.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 7b2f5cfa0..d545b1cff 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -126,7 +126,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); - ml_msh.SetWriter(GMV); + ml_msh.SetWriter(VTK); std::vector print_vars; ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 872f4d394..d5aa86121 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -195,7 +195,8 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve } //loop over dimension offset_nvt3+=3*nvt_ig; } - } + + } //end moving mesh and ml_sol if(_iproc==0) { //print coordinates dimension @@ -441,10 +442,14 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve } //---------------------------------------------------------------------------------------------------- } + + } //end mlsol + } fout << " " << std::endl; // //------------------------------------------------------------------------------------------------ - // + + if (_ml_sol != NULL) { // //------------------------------------------------------------------------------------------------ // / Print Solution (on nodes) ******************************************************************** fout<< " " << std::endl; From 45b4b3a1bda7e0ded759eaf3c4701c72e38dd2ac Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 15:09:25 -0600 Subject: [PATCH 32/91] Converted to pointers to Writer in all applications --- applications/FSI/FSITimeDependentBenchmarks/main.cpp | 2 +- applications/FSI/FSI_TUREK_3/main.cpp | 2 +- .../NavierStokes/BackwardEulerNavierStokesParallel/main.cpp | 2 +- applications/NavierStokes/NavierStokesTemp_AMR/main.cpp | 2 +- applications/NavierStokes/SteadyNavierStokesParallel/main.cpp | 4 ++-- applications/NavierStokes/SteadyStokes/main.cpp | 2 +- .../TaylorGreenVortexFlowGeneralisedalpha/main.cpp | 2 +- applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp | 4 ++-- applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp | 4 ++-- applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 4 ++-- applications/Poisson/main.cpp | 4 ++-- applications/Poisson_AMR/main.cpp | 4 ++-- unittests/testFSISteady/main.cpp | 2 +- 26 files changed, 45 insertions(+), 45 deletions(-) diff --git a/applications/FSI/FSITimeDependentBenchmarks/main.cpp b/applications/FSI/FSITimeDependentBenchmarks/main.cpp index 724a60ac3..e48032390 100644 --- a/applications/FSI/FSITimeDependentBenchmarks/main.cpp +++ b/applications/FSI/FSITimeDependentBenchmarks/main.cpp @@ -212,7 +212,7 @@ int main(int argc,char **args) { std::vector mov_vars; mov_vars.push_back("DX"); mov_vars.push_back("DY"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.SetMovingMesh(mov_vars); // Solving Fluid-Structure-Interaction system diff --git a/applications/FSI/FSI_TUREK_3/main.cpp b/applications/FSI/FSI_TUREK_3/main.cpp index 63eeb7697..de6b6fdc3 100644 --- a/applications/FSI/FSI_TUREK_3/main.cpp +++ b/applications/FSI/FSI_TUREK_3/main.cpp @@ -144,7 +144,7 @@ int main(int argc,char **args) { std::vector mov_vars; mov_vars.push_back("DX"); mov_vars.push_back("DY"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.SetMovingMesh(mov_vars); for (unsigned time_step = 0; time_step < n_timesteps; time_step++) { diff --git a/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp b/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp index 7fb67231c..515d57455 100644 --- a/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp +++ b/applications/NavierStokes/BackwardEulerNavierStokesParallel/main.cpp @@ -127,7 +127,7 @@ int main(int argc,char **args) { print_vars.push_back("P"); // ml_prob.printsol_vtu_inline("biquadratic",print_vars,time_step); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.write(files.GetOutputPath(),"biquadratic",print_vars,time_step); } diff --git a/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp b/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp index c3b8c5745..63992ad21 100644 --- a/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp +++ b/applications/NavierStokes/NavierStokesTemp_AMR/main.cpp @@ -259,7 +259,7 @@ int main(int argc,char **args) { print_vars.push_back("P"); print_vars.push_back("T"); - GMVWriter gmvio(ml_sol); + GMVWriter gmvio(&ml_sol); gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp index 798e4ced2..9e1196c80 100644 --- a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp +++ b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp @@ -231,11 +231,11 @@ int main(int argc,char **args) { print_vars.push_back("P"); print_vars.push_back("T"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); //vtkio.write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); - GMVWriter gmvio(ml_sol); + GMVWriter gmvio(&ml_sol); gmvio.write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/applications/NavierStokes/SteadyStokes/main.cpp b/applications/NavierStokes/SteadyStokes/main.cpp index 5f3b402d2..b887a94d1 100644 --- a/applications/NavierStokes/SteadyStokes/main.cpp +++ b/applications/NavierStokes/SteadyStokes/main.cpp @@ -174,7 +174,7 @@ int main(int argc,char **args) { print_vars.push_back("P"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); // XDMFWriter xdmfio(ml_prob); diff --git a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp index 46254653f..768c20b32 100644 --- a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp +++ b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp @@ -123,7 +123,7 @@ int main(int argc,char **args) { const unsigned int n_timesteps = 5; const unsigned int write_interval = 1; - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); for (unsigned time_step = 0; time_step < n_timesteps; time_step++) { diff --git a/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Bhagya/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Bhagya/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Eugenio/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Giacomo/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Giacomo/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Guoyi/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Guoyi/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Sara/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Sara/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Thanuja/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Thanuja/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/Thanuka/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp index a1d189634..cc59a3e31 100644 --- a/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Thanuka/Ex2/Ex2.cpp @@ -79,10 +79,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp b/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp index 9bf86e4d2..04b5866c5 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex1/Ex1.cpp @@ -69,10 +69,10 @@ int main(int argc, char **args) { variablesToBePrinted.push_back("P"); variablesToBePrinted.push_back("T"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); variablesToBePrinted.push_back("all"); gmvIO.SetDebugOutput(false); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index 4b2a2d2af..031b121c4 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -93,10 +93,10 @@ int main(int argc, char **args) { std::vector < std::string > variablesToBePrinted; variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(mlSol); + VTKWriter vtkIO(&mlSol); vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(mlSol); + GMVWriter gmvIO(&mlSol); gmvIO.SetDebugOutput(true); gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); } diff --git a/applications/Poisson/main.cpp b/applications/Poisson/main.cpp index 41425502b..c49bb7db3 100644 --- a/applications/Poisson/main.cpp +++ b/applications/Poisson/main.cpp @@ -254,10 +254,10 @@ int main(int argc,char **argv) { std::vector print_vars; print_vars.push_back("Sol"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); - GMVWriter gmvio(ml_sol); + GMVWriter gmvio(&ml_sol); gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); // // XDMFWriter xdmfio(ml_sol); diff --git a/applications/Poisson_AMR/main.cpp b/applications/Poisson_AMR/main.cpp index f1b8422b2..52c71669e 100644 --- a/applications/Poisson_AMR/main.cpp +++ b/applications/Poisson_AMR/main.cpp @@ -421,10 +421,10 @@ int main(int argc,char **argv) { std::vector print_vars; print_vars.push_back("Sol"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); - GMVWriter gmvio(ml_sol); + GMVWriter gmvio(&ml_sol); gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); // diff --git a/unittests/testFSISteady/main.cpp b/unittests/testFSISteady/main.cpp index 9082d51b5..7b4708299 100644 --- a/unittests/testFSISteady/main.cpp +++ b/unittests/testFSISteady/main.cpp @@ -129,7 +129,7 @@ int main(int argc,char **args) { std::vector mov_vars; mov_vars.push_back("DX"); mov_vars.push_back("DY"); - VTKWriter vtkio(ml_sol); + VTKWriter vtkio(&ml_sol); vtkio.SetMovingMesh(mov_vars); // Solving Fluid-Structure-Interaction system From f6924a5f87f311cb0424a65caf5f9eff8dab0acb Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Thu, 5 Mar 2015 18:18:28 -0600 Subject: [PATCH 33/91] XDMF Writer almost working, only one little problem --- applications/OptimalControl/tempopt/main.cpp | 2 +- src/solution/VTKWriter.cpp | 1 + src/solution/XDMFWriter.cpp | 75 +++++++++++--------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index d545b1cff..b55f09cd0 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -126,7 +126,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); - ml_msh.SetWriter(VTK); + ml_msh.SetWriter(XDMF); std::vector print_vars; ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index d5aa86121..3102de117 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -43,6 +43,7 @@ VTKWriter::~VTKWriter() {} void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { + bool print_all = 0; for (unsigned ivar=0; ivar < vars.size(); ivar++){ print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index dfecd599b..295267012 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -63,8 +63,12 @@ XDMFWriter::~XDMFWriter() {} void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { #ifdef HAVE_HDF5 - bool test_all=!(vars[0].compare("All")); - + bool print_all = 0; + for (unsigned ivar=0; ivar < vars.size(); ivar++){ + print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); + } + + unsigned index=0; unsigned index_nd=0; if(!strcmp(order,"linear")) { //linear @@ -80,7 +84,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v index_nd=2; } - //I assume that the mesh is not mixed + /// @todo I assume that the mesh is not mixed std::string type_elem; unsigned elemtype = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementType(0); type_elem = XDMFWriter::type_el[index][elemtype]; @@ -113,26 +117,29 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //-------------------------------------------------------------------------------------------------- // Print The Xdmf wrapper - std::ostringstream filename; - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".xmf"; + std::ostringstream xdmf_filename; + xdmf_filename << output_path << "/" << "sol.level" << _gridn << "." << time_step << "." << order << ".xmf"; std::ofstream fout; if(_iproc!=0) { fout.rdbuf(); //redirect to dev_null } else { - fout.open(filename.str().c_str()); + fout.open(xdmf_filename.str().c_str()); if (fout.is_open()) { - std::cout << std::endl << " The output is printed to file " << filename.str() << " in XDMF-HDF5 format" << std::endl; + std::cout << std::endl << " The output is printed to file " << xdmf_filename.str() << " in XDMF-HDF5 format" << std::endl; } else { - std::cout << std::endl << " The output file "<< filename.str() <<" cannot be opened.\n"; + std::cout << std::endl << " The output file "<< xdmf_filename.str() <<" cannot be opened.\n"; abort(); } } // Print The HDF5 file - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".h5"; + std::ostringstream hdf5_filename; + std::ostringstream hdf5_filename2; + hdf5_filename2 << "sol.level" << _gridn << "." << time_step << "." << order << ".h5"; + hdf5_filename << output_path << "/" << hdf5_filename2.str(); // head ************************************************ fout<<"" << std::endl; fout<<""<< std::endl; @@ -140,32 +147,34 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v fout<<""<"<"<"<"<" << std::endl; - fout << filename << ":CONNECTIVITY" << std::endl; + fout << hdf5_filename2.str() << ":CONNECTIVITY" << std::endl; fout <<"" << std::endl; fout << "" << std::endl; fout << "" << std::endl; //Node_X fout<<"" << std::endl; - fout << filename << ":NODES_X1" << std::endl; + fout << hdf5_filename2.str() << ":NODES_X1" << std::endl; fout <<"" << std::endl; //Node_Y fout<<"" << std::endl; - fout << filename << ":NODES_X2" << std::endl; + fout << hdf5_filename2.str() << ":NODES_X2" << std::endl; fout <<"" << std::endl; //Node_Z fout<<"" << std::endl; - fout << filename << ":NODES_X3" << std::endl; + fout << hdf5_filename2.str() << ":NODES_X3" << std::endl; fout <<"" << std::endl; fout <<"" << std::endl; //Regions fout << "" << std::endl; - fout << "" << std::endl; - fout << filename << ":REGIONS" << std::endl; + fout << "" << std::endl; + fout << hdf5_filename2.str() << ":REGIONS" << std::endl; fout << "" << std::endl; fout << "" << std::endl; + + if (_ml_sol != NULL) { // Solution Variables for (unsigned i=0; iGetIndex(vars[i].c_str()); @@ -173,19 +182,21 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v if(_ml_sol->GetSolutionType(indx)<3) { fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Node\">" << std::endl; fout << "" << std::endl; - fout << filename << ":" << _ml_sol->GetSolutionName(indx) << std::endl; + fout << hdf5_filename2.str() << ":" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } else if (_ml_sol->GetSolutionType(indx)>=3) { //Printing picewise constant solution on the element fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Cell\">" << std::endl; - fout << "" << std::endl; - fout << filename << ":" << _ml_sol->GetSolutionName(indx) << std::endl; + fout << "" << std::endl; + fout << hdf5_filename2.str() << ":" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } } - + + } //end ml_sol + fout <<"" << std::endl; fout <<"" << std::endl; fout <<"" << std::endl; @@ -194,8 +205,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //---------------------------------------------------------------------------------------------------------- hid_t file_id; - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".h5"; - file_id = H5Fcreate(filename.str().c_str(),H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); + file_id = H5Fcreate(hdf5_filename.str().c_str(),H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); hsize_t dimsf[2]; herr_t status; hid_t dataspace; @@ -204,8 +214,6 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //----------------------------------------------------------------------------------------------------------- // Printing nodes coordinates - PetscScalar *MYSOL[1]; //TODO - for (int i=0; i<3; i++) { unsigned offset_nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { @@ -214,13 +222,13 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2) ); unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iiGetIndex(_moving_vars[i].c_str()); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(varind_DXDYDZ))); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(varind_DXDYDZ))); for (unsigned ii=0; iiGetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + for (unsigned i=0; i<(1-print_all)*vars.size()+print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(print_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; if (_ml_sol->GetSolutionType(indx)>=3) { icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { @@ -319,8 +328,8 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //------------------------------------------------------------------------------------------------------- // printing nodes variables - for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol->GetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + for (unsigned i=0; i<(1-print_all)*vars.size()+print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(print_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; if (_ml_sol->GetSolutionType(indx) < 3) { unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { @@ -329,7 +338,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(indx)) ); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd, _ml_sol->GetSolutionType(indx)) ); unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; ii Date: Fri, 6 Mar 2015 06:22:41 -0600 Subject: [PATCH 34/91] grid is now lebel in mesh class --- .../FSI/FSITimeDependentBenchmarks/main.cpp | 4 +- applications/FSI/fsi_porous/main.cpp | 10 +-- applications/FSI/include/FSIassembly.hpp | 2 +- .../FSI/include/IncompressibleFSIAssembly.hpp | 8 +-- .../main.cpp | 2 +- .../NavierStokesTemp_AMR/main.cpp | 4 +- .../SteadyNavierStokesParallel/main.cpp | 4 +- .../NavierStokes/SteadyStokes/main.cpp | 2 +- .../main.cpp | 2 +- applications/Poisson/main.cpp | 2 +- applications/Poisson_AMR/main.cpp | 2 +- src/algebra/AsmPetscLinearEquationSolver.cpp | 6 +- .../GmresPetscLinearEquationSolver.cpp | 6 +- src/algebra/LinearEquation.cpp | 10 +-- .../VankaPetscLinearEquationSolver.cpp | 8 +-- src/equations/LinearImplicitSystem.cpp | 4 +- .../MonolithicFSINonLinearImplicitSystem.cpp | 8 +-- src/mesh/GambitIO.cpp | 2 +- src/mesh/Mesh.cpp | 62 +++++-------------- src/mesh/Mesh.hpp | 20 +++--- src/mesh/MeshRefinement.cpp | 6 +- src/mesh/MultiLevelMesh.cpp | 10 +-- src/mesh/MultiLevelMesh.hpp | 4 +- src/mesh/SalomeIO.cpp | 2 +- unittests/testFSISteady/main.cpp | 2 +- unittests/testNSSteadyDD/main.cpp | 4 +- 26 files changed, 79 insertions(+), 117 deletions(-) diff --git a/applications/FSI/FSITimeDependentBenchmarks/main.cpp b/applications/FSI/FSITimeDependentBenchmarks/main.cpp index c0c6c317f..acbcdc92a 100644 --- a/applications/FSI/FSITimeDependentBenchmarks/main.cpp +++ b/applications/FSI/FSITimeDependentBenchmarks/main.cpp @@ -765,7 +765,7 @@ void AssembleMatrixResFSI(NonLinearMultiLevelProblem &nl_td_ml_prob2, unsigned l // mesh and procs unsigned nel = mymsh->GetElementNumber(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->GetProcID(); unsigned nprocs = mymsh->GetNumProcs(); @@ -1640,7 +1640,7 @@ void AssembleMatrixResFSI(MultiLevelProblem &ml_prob, unsigned level, const unsi // mesh and procs unsigned nel = mymsh->GetElementNumber(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); //---------------------------------------------------------------------------------- diff --git a/applications/FSI/fsi_porous/main.cpp b/applications/FSI/fsi_porous/main.cpp index 97d38951f..335725af1 100644 --- a/applications/FSI/fsi_porous/main.cpp +++ b/applications/FSI/fsi_porous/main.cpp @@ -374,7 +374,7 @@ int AssembleMatrixResP(MultiLevelProblem &mg2, unsigned level, /*const elem_type // // // double geom_el_coords[SPACEDIM][MAX_EL_NODES]; // // // elem* myel = lsyspdemesh_lev->el; // // // unsigned nel = lsyspdemesh_lev->GetElementNumber(); -// // // unsigned igrid = lsyspdemesh_lev->GetGridNumber(); +// // // unsigned igrid = lsyspdemesh_lev->GetLevel(); // // // // // // // variables // // // PetscInt nodeP[MAX_EL_NODES]; @@ -546,7 +546,7 @@ int AssembleMatrixResP(MultiLevelProblem &mg2, unsigned level, /*const elem_type // // // // ***************** END ASSEMBLY ******************* // // // // // // // *** Computational info *** -// // // // cout<<"Grid="<< lsyspdemesh_lev->GetGridNumber()<GetDimension(); unsigned nel= mymsh->GetNumberOfElements(); - unsigned igrid= mymsh->GetGridNumber(); + unsigned igrid= mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double ILambda= 0; double IRe = ml_prob.parameters.get("Fluid").get_IReynolds_number(); @@ -744,7 +744,7 @@ void AssembleMatrixResT(MultiLevelProblem &ml_prob, unsigned level, const unsign //data const unsigned dim = mymsh->GetDimension(); unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double IPe = 1./(ml_prob.parameters.get("Fluid").get_Peclet_number()); diff --git a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp index 40e545844..7e622d30e 100644 --- a/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp +++ b/applications/NavierStokes/SteadyNavierStokesParallel/main.cpp @@ -511,7 +511,7 @@ void AssembleMatrixResNS(MultiLevelProblem &ml_prob, unsigned level, const unsig // mesh and procs unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); //---------------------------------------------------------------------------------- @@ -1304,7 +1304,7 @@ void AssembleMatrixResT(MultiLevelProblem &ml_prob, unsigned level, const unsign //data const unsigned dim = mymsh->GetDimension(); unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double IPe = 1./(ml_prob.parameters.get("Fluid").get_Peclet_number()); diff --git a/applications/NavierStokes/SteadyStokes/main.cpp b/applications/NavierStokes/SteadyStokes/main.cpp index 4256aff45..21b606fd8 100644 --- a/applications/NavierStokes/SteadyStokes/main.cpp +++ b/applications/NavierStokes/SteadyStokes/main.cpp @@ -324,7 +324,7 @@ void AssembleMatrixResSteadyStokes(MultiLevelProblem &ml_prob, unsigned level, c //data const unsigned dim = mymsh->GetDimension(); unsigned nel= mymsh->GetNumberOfElements(); - unsigned igrid= mymsh->GetGridNumber(); + unsigned igrid= mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double ILambda= 0; double IRe = ml_prob.parameters.get("Fluid").get_IReynolds_number(); diff --git a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp index 14ee09e9e..6999e3ced 100644 --- a/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp +++ b/applications/NavierStokes/TaylorGreenVortexFlowGeneralisedalpha/main.cpp @@ -238,7 +238,7 @@ void AssembleMatrixResNS(MultiLevelProblem &ml_prob, unsigned level, const unsig double theta = 0.5; const unsigned dim = mymsh->GetDimension(); unsigned nel= mymsh->GetNumberOfElements(); - unsigned igrid= mymsh->GetGridNumber(); + unsigned igrid= mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double ILambda = 0.; double IRe = ml_prob.parameters.get("Fluid").get_IReynolds_number(); diff --git a/applications/Poisson/main.cpp b/applications/Poisson/main.cpp index 80b197d0c..c3e380b17 100644 --- a/applications/Poisson/main.cpp +++ b/applications/Poisson/main.cpp @@ -288,7 +288,7 @@ void AssemblePoissonMatrixandRhs(MultiLevelProblem &ml_prob, unsigned level, con //data const unsigned dim = mymsh->GetDimension(); unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); //solution variable diff --git a/applications/Poisson_AMR/main.cpp b/applications/Poisson_AMR/main.cpp index 32486043b..db768587f 100644 --- a/applications/Poisson_AMR/main.cpp +++ b/applications/Poisson_AMR/main.cpp @@ -554,7 +554,7 @@ void AssemblePoissonMatrixandRhs(MultiLevelProblem &ml_prob, unsigned level, con //data const unsigned dim = mymsh->GetDimension(); unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); //solution variable diff --git a/src/algebra/AsmPetscLinearEquationSolver.cpp b/src/algebra/AsmPetscLinearEquationSolver.cpp index cb611b5b4..22fd87ac4 100644 --- a/src/algebra/AsmPetscLinearEquationSolver.cpp +++ b/src/algebra/AsmPetscLinearEquationSolver.cpp @@ -448,7 +448,7 @@ namespace femus { // *** Computational info *** #ifndef NDEBUG - cout << "ASM Grid: " << _msh->GetGridNumber()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << + cout << "ASM Grid: " << _msh->GetLevel()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << static_cast( SearchTime + AssemblyTime + SolveTime + UpdateTime)/ CLOCKS_PER_SEC<< " ITS: " << _maxits << "\t ksp_clean = "<< ksp_clean<GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetInitialGuessKnoll(_ksp, PETSC_TRUE); - if(_msh->GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetNormType(_ksp,KSP_NORM_NONE); ierr = KSPSetFromOptions(_ksp); CHKERRABORT(MPI_COMM_WORLD,ierr); diff --git a/src/algebra/GmresPetscLinearEquationSolver.cpp b/src/algebra/GmresPetscLinearEquationSolver.cpp index f275f14a4..ce66ef94c 100644 --- a/src/algebra/GmresPetscLinearEquationSolver.cpp +++ b/src/algebra/GmresPetscLinearEquationSolver.cpp @@ -229,7 +229,7 @@ namespace femus { // *** Computational info *** #ifndef NDEBUG - cout << "GMRES Grid: " << _msh->GetGridNumber()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << + cout << "GMRES Grid: " << _msh->GetLevel()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << static_cast( SearchTime + AssemblyTime + SolveTime + UpdateTime)/ CLOCKS_PER_SEC<< " ITS: " << _maxits << "\t ksp_clean = "<< ksp_clean<GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetInitialGuessKnoll(_ksp, PETSC_TRUE); - if(_msh->GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetNormType(_ksp,KSP_NORM_NONE); // Set the options from user-input diff --git a/src/algebra/LinearEquation.cpp b/src/algebra/LinearEquation.cpp index 4c3f1b7e6..afaface63 100644 --- a/src/algebra/LinearEquation.cpp +++ b/src/algebra/LinearEquation.cpp @@ -176,7 +176,7 @@ void LinearEquation::InitPde(const vector &SolPdeIndex_other, const _KK = SparseMatrix::build().release(); //_KK->init(KK_size,KK_size,KK_local_size,KK_local_size,KK_UNIT_SIZE_*KKIndex.size(),KK_UNIT_SIZE_*KKIndex.size()); _KK->init(KK_size,KK_size,KK_local_size,KK_local_size,d_nnz,o_nnz); - unsigned igrid=_msh->GetGridNumber()+1; + unsigned igrid=_msh->GetLevel()+1; if(igrid>=_gridr && igrid<_gridn){ _CC = SparseMatrix::build().release(); _CC->init(KK_size,KK_size,KK_local_size,KK_local_size,d_nnz,o_nnz); @@ -194,7 +194,7 @@ void LinearEquation::AddLevel(){ int KK_size=KKIndex[KKIndex.size()-1u]; int KK_local_size =KKoffset[KKIndex.size()-1][processor_id()] - KKoffset[0][processor_id()]; - unsigned igrid=_msh->GetGridNumber()+1; + unsigned igrid=_msh->GetLevel()+1; if(igrid>=_gridr && igrid<_gridn){ _CC = SparseMatrix::build().release(); _CC->init(KK_size,KK_size,KK_local_size,KK_local_size,d_nnz,o_nnz); @@ -231,14 +231,14 @@ void LinearEquation::DeletePde() { if(_KK) delete _KK; - unsigned igrid=_msh->GetGridNumber()+1; + unsigned igrid=_msh->GetLevel()+1; if(igrid>=_gridr && igrid<_gridn){ if(_CC) delete _CC; } - if (_msh->GetGridNumber()>0) { + if (_msh->GetLevel()>0) { if(_PP) delete _PP; if(_RR) @@ -288,7 +288,7 @@ void LinearEquation::DeletePde() { // mesh and procs int nel = _msh->GetNumberOfElements(); - int igrid = _msh->GetGridNumber(); + int igrid = _msh->GetLevel(); int this_proc = _msh->processor_id(); int nprocs= _msh->n_processors(); diff --git a/src/algebra/VankaPetscLinearEquationSolver.cpp b/src/algebra/VankaPetscLinearEquationSolver.cpp index 01bdaf2a6..f1ae55db4 100644 --- a/src/algebra/VankaPetscLinearEquationSolver.cpp +++ b/src/algebra/VankaPetscLinearEquationSolver.cpp @@ -381,7 +381,7 @@ namespace femus { #ifndef NDEBUG // *** Computational info *** - cout << "VANKA Grid: "<<_msh->GetGridNumber()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << + cout << "VANKA Grid: "<<_msh->GetLevel()<< " SOLVER TIME: " << std::setw(11) << std::setprecision(6) << std::fixed << static_cast(SearchTime + AssemblyTime + SolveTime + UpdateTime)/ CLOCKS_PER_SEC<< " ITS: " << _maxits << endl; #endif @@ -431,10 +431,10 @@ namespace femus { // tolerance for the relative residual & leave the others at default values. ierr = KSPSetTolerances(ksp,_rtol,_abstol,_dtol,_maxits); CHKERRABORT(MPI_COMM_WORLD,ierr); - if(_msh->GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetInitialGuessKnoll(ksp, PETSC_TRUE); - if(_msh->GetGridNumber()!=0) + if(_msh->GetLevel()!=0) KSPSetNormType(ksp,KSP_NORM_NONE); // Set the options from user-input @@ -529,7 +529,7 @@ namespace femus { // // if (!this->initialized()) { // this->_is_initialized = true; // int ierr=0; -// int grid=_msh->GetGridNumber(); +// int grid=_msh->GetLevel(); // // // Since the matrix is sequential for us, we use as communicator MPI_COMM_WORLD (serial) // // instead of PETSC_COMM_WORLD (parallel) diff --git a/src/equations/LinearImplicitSystem.cpp b/src/equations/LinearImplicitSystem.cpp index 6ba4b303f..ba811f5d0 100644 --- a/src/equations/LinearImplicitSystem.cpp +++ b/src/equations/LinearImplicitSystem.cpp @@ -449,7 +449,7 @@ void LinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf) { unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->GetSparsityPatternSize(*LinSolf,*LinSolc,iel,NNZ_d, NNZ_o,SolIndex,k); + mshc->_finiteElement[ielt][SolType]->GetSparsityPatternSize(*LinSolf,*LinSolc,iel,NNZ_d, NNZ_o,SolIndex,k); } } } @@ -481,7 +481,7 @@ void LinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf) { unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel,LinSolf->_PP,SolIndex,k); + mshc->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel,LinSolf->_PP,SolIndex,k); } } } diff --git a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp index 744f023aa..1472dbb38 100644 --- a/src/equations/MonolithicFSINonLinearImplicitSystem.cpp +++ b/src/equations/MonolithicFSINonLinearImplicitSystem.cpp @@ -125,7 +125,7 @@ void MonolithicFSINonLinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf unsigned iel = mshc->IS_Mts2Gmt_elem[iel_mts]; if(mshc->el->GetRefinedElementIndex(iel)){ //only if the coarse element has been refined short unsigned ielt=mshc->el->GetElementType(iel); - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->GetSparsityPatternSize(*LinSolf,*LinSolc,iel,NNZ_d, NNZ_o,SolIndex,k); + mshc->_finiteElement[ielt][SolType]->GetSparsityPatternSize(*LinSolf,*LinSolc,iel,NNZ_d, NNZ_o,SolIndex,k); } } } @@ -174,12 +174,12 @@ void MonolithicFSINonLinearImplicitSystem::BuildProlongatorMatrix(unsigned gridf short unsigned ielt=mshc->el->GetElementType(iel); if(!testIfPressure){ - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildRestrictionTranspose(*LinSolf,*LinSolc,iel,RRt,SolIndex,k,solPairIndex,solPairPdeIndex); + mshc->_finiteElement[ielt][SolType]->BuildRestrictionTranspose(*LinSolf,*LinSolc,iel,RRt,SolIndex,k,solPairIndex,solPairPdeIndex); } else{ - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel, RRt,SolIndex,k); + mshc->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel, RRt,SolIndex,k); } - _equation_systems._ml_msh->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel, LinSolf->_PP,SolIndex,k); + mshc->_finiteElement[ielt][SolType]->BuildProlongation(*LinSolf,*LinSolc,iel, LinSolf->_PP,SolIndex,k); } } } diff --git a/src/mesh/GambitIO.cpp b/src/mesh/GambitIO.cpp index 5b975f67b..a0a297887 100644 --- a/src/mesh/GambitIO.cpp +++ b/src/mesh/GambitIO.cpp @@ -70,7 +70,7 @@ void GambitIO::read(const std::string& name, vector < vector < double> > &coords unsigned nvt; unsigned nel; - mesh.SetGridNumber(0); + mesh.SetLevel(0); // read control data ******************** A inf.open(name.c_str()); if (!inf) { diff --git a/src/mesh/Mesh.cpp b/src/mesh/Mesh.cpp index 483a25415..c21d65239 100644 --- a/src/mesh/Mesh.cpp +++ b/src/mesh/Mesh.cpp @@ -101,7 +101,7 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto vector > coords(3); - _level=0; + _level = 0; if(name.rfind(".neu") < name.size()) { @@ -118,7 +118,7 @@ void Mesh::ReadCoarseMesh(const std::string& name, const double Lref, std::vecto << std::endl; } - RenumberNodes(coords); + ReorderMeshDofs(coords); BuildAdjVtx(); @@ -167,13 +167,13 @@ void Mesh::GenerateCoarseBoxMesh( const double zmin, const double zmax, const ElemType type, std::vector &type_elem_flag) { - vector > coords(3); + vector > coords(3); - _level=0; + _level = 0; MeshTools::Generation::BuildBox(*this,coords,nx,ny,nz,xmin,xmax,ymin,ymax,zmin,zmax,type,type_elem_flag); - RenumberNodes(coords); + ReorderMeshDofs(coords); BuildAdjVtx(); @@ -214,7 +214,7 @@ void Mesh::GenerateCoarseBoxMesh( //------------------------------------------------------------------------------------------------------ -void Mesh::RenumberNodes(vector < vector < double> > &coords) { +void Mesh::ReorderMeshDofs(vector < vector < double> > &coords) { vector dof_index; dof_index.resize(_nnodes); @@ -309,9 +309,6 @@ void Mesh::BuildAdjVtx() { } } - - - /** * This function stores the element adiacent to the element face (iel,iface) * and stores it in kel[iel][iface] @@ -332,16 +329,13 @@ void Mesh::Buildkel() { unsigned j2=el->GetFaceVertexIndex(jel,jface,1); unsigned j3=el->GetFaceVertexIndex(jel,jface,2); unsigned j4=el->GetFaceVertexIndex(jel,jface,3); -// if((DIM[2]==1 && if ((Mesh::_dimension==3 && (i1==j1 || i1==j2 || i1==j3 || i1==j4 )&& (i2==j1 || i2==j2 || i2==j3 || i2==j4 )&& (i3==j1 || i3==j2 || i3==j3 || i3==j4 ))|| -// (DIM[1]==1 && (Mesh::_dimension==2 && (i1==j1 || i1==j2 )&& (i2==j1 || i2==j2 ))|| -// (DIM[0]==1 && (Mesh::_dimension==1 && (i1==j1)) ) { @@ -384,15 +378,6 @@ unsigned Mesh::GetDofNumber(const unsigned type) const { } -/** - * This function copies the refined element index vector in other_vector - **/ -void Mesh::copy_elr(vector &other_vec) const { - for (unsigned i=0; i<_nelem; i++) - other_vec[i]=el->GetRefinedElementIndex(i); -} - - void Mesh::AllocateAndMarkStructureNode() { el->AllocateNodeRegion(); for (unsigned iel=0; iel<_nelem; iel++) { @@ -407,16 +392,10 @@ void Mesh::AllocateAndMarkStructureNode() { } } } - return; } -/** - * This function generates a finer Mesh level, $l_i$, from a coarser Mesh level $l_{i-1}$, $i>0$ - **/ - void Mesh::SetFiniteElementPtr(const elem_type * OtherFiniteElement[6][5]){ - for(int i=0;i<6;i++) for(int j=0;j<5;j++) _finiteElement[i][j] = OtherFiniteElement[i][j]; @@ -438,10 +417,10 @@ void Mesh::FillISvector() { // I for(unsigned i=0;i<_nnodes;i++) { - npart[i]=nsubdom; + npart[i] = nsubdom; } - IS_Mts2Gmt_elem_offset[0]=0; + IS_Mts2Gmt_elem_offset[0] = 0; vector IS_Gmt2Mts_dof_counter(5,0); for(int k=0;k<5;k++) { @@ -449,7 +428,6 @@ void Mesh::FillISvector() { //TODO for domain decomposition pourposes! the non existing dofs point to the last dof!!!!!! } - IS_Gmt2Mts_dof_counter[3]=0; IS_Gmt2Mts_dof_counter[4]=0; @@ -457,8 +435,8 @@ void Mesh::FillISvector() { for(unsigned iel=0;iel<_nelem;iel++){ if(epart[iel]==isdom){ //filling the piecewise IS_Mts2Gmt_elem metis->gambit - IS_Mts2Gmt_elem[ IS_Gmt2Mts_dof_counter[3] ]=iel; - IS_Gmt2Mts_dof[3][iel]=IS_Gmt2Mts_dof_counter[3]; + IS_Mts2Gmt_elem[ IS_Gmt2Mts_dof_counter[3] ] = iel; + IS_Gmt2Mts_dof[3][iel] = IS_Gmt2Mts_dof_counter[3]; IS_Gmt2Mts_dof_counter[3]++; IS_Mts2Gmt_elem_offset[isdom+1]=IS_Gmt2Mts_dof_counter[3]; // linear+quadratic+biquadratic @@ -538,8 +516,7 @@ void Mesh::FillISvector() { } } - - for (unsigned inode=el->GetElementDofNumber(iel,0); inodeGetElementDofNumber(iel,1); inode++) { + for (unsigned inode=el->GetElementDofNumber(iel,0); inodeGetElementDofNumber(iel,1); inode++) { unsigned ii=el->GetElementVertexIndex(iel,inode)-1; if(node_count[ii] &other_vec) const; - - /** Renumber nodes in the following order: vertices, face, center */ - void RenumberNodes(vector < vector < double> > &coords); + + /** Reorder mesh dofs in the following order: vertices, face, center */ + void ReorderMeshDofs(vector < vector < double> > &coords); //member-data - int _nelem; //< number of elements - unsigned _nnodes; //< number of nodes - unsigned _level; //< level of mesh in the multilevel hierarchy + int _nelem; //< number of elements + unsigned _nnodes; //< number of nodes + unsigned _level; //< level of mesh in the multilevel hierarchy static unsigned _dimension; //< dimension of the problem static unsigned _ref_index; static unsigned _face_index; diff --git a/src/mesh/MeshRefinement.cpp b/src/mesh/MeshRefinement.cpp index dbaf600bf..c6dadd540 100644 --- a/src/mesh/MeshRefinement.cpp +++ b/src/mesh/MeshRefinement.cpp @@ -79,7 +79,7 @@ void MeshRefinement::FlagElementsToBeRefinedByUserDefinedFunction() { vty/=nve; vtz/=nve; if(!_mesh.el->GetRefinedElementIndex(iel)){ - if (_mesh._SetRefinementFlag(vtx,vty,vtz,_mesh.el->GetElementGroup(iel),_mesh.GetGridNumber())) { + if (_mesh._SetRefinementFlag(vtx,vty,vtz,_mesh.el->GetElementGroup(iel),_mesh.GetLevel())) { _mesh.el->SetRefinedElementIndex(iel,1); _mesh.el->AddToRefinedElementNumber(1); short unsigned elt=_mesh.el->GetElementType(iel); @@ -113,7 +113,7 @@ void MeshRefinement::FlagElementsToBeRefinedByAMR() { vty/=nve; vtz/=nve; if( (*_mesh._coordinate->_Sol[3])(iel_metis) < 0.5 && - _mesh._SetRefinementFlag(vtx,vty,vtz,_mesh.el->GetElementGroup(kel),_mesh.GetGridNumber()) ) { + _mesh._SetRefinementFlag(vtx,vty,vtz,_mesh.el->GetElementGroup(kel),_mesh.GetLevel()) ) { _mesh._coordinate->_Sol[3]->set(iel_metis,1.); } } @@ -163,7 +163,7 @@ void MeshRefinement::RefineMesh(const unsigned & igrid, Mesh *mshc, const elem_t elem *elc=mshc->el; - _mesh.SetGridNumber(igrid); + _mesh.SetLevel(igrid); //_grid=igrid; diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index ea8b09010..b0915689b 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -302,12 +302,10 @@ void MultiLevelMesh::AddMeshLevel() MeshRefinement meshcoarser(*_level0[_gridn0-1u]); meshcoarser.FlagElementsToBeRefinedByUserDefinedFunction(); - //_level0[_gridn0-1u]->FlagElementsToBeRefinedByUserDefinedFunction(); _level0[_gridn0] = new Mesh(); MeshRefinement meshfiner(*_level0[_gridn0]); meshfiner.RefineMesh(_gridn0,_level0[_gridn0-1u],_finiteElement); - //_level0[_gridn0]->RefineMesh(_gridn0,_level0[_gridn0-1u],_finiteElement); _level.resize(_gridn+1u); _level[_gridn]=_level0[_gridn0]; @@ -324,12 +322,10 @@ void MultiLevelMesh::AddAMRMeshLevel() MeshRefinement meshcoarser(*_level0[_gridn0-1u]); meshcoarser.FlagElementsToBeRefinedByAMR(); - //_level0[_gridn0-1u]->FlagElementsToBeRefinedByAMR(); _level0[_gridn0] = new Mesh(); MeshRefinement meshfiner(*_level0[_gridn0]); meshfiner.RefineMesh(_gridn0,_level0[_gridn0-1u],_finiteElement); - //_level0[_gridn0]->RefineMesh(_gridn0,_level0[_gridn0-1u],_finiteElement); _level.resize(_gridn+1u); _level[_gridn]=_level0[_gridn0]; @@ -349,8 +345,8 @@ void MultiLevelMesh::EraseCoarseLevels(unsigned levels_to_be_erased) { _gridr -= levels_to_be_erased; _gridn -= levels_to_be_erased; for(int i=0; i<_gridn; i++) { - _level[i]=_level0[i+levels_to_be_erased]; - _level[i]->SetGridNumber(i); + _level[i]=_level0[i+levels_to_be_erased]; + _level[i]->SetLevel(i); } } @@ -366,7 +362,7 @@ void MultiLevelMesh::MarkStructureNode() { void MultiLevelMesh::PrintInfo() { std::cout << " Number of uniform mesh refinement: " << _gridn << std::endl; for(int i=0; i<_gridn; i++) { - _level[i]->PrintInfo(); + _level[i]->PrintInfo(); } } diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index 6cb6645f5..53a0c23ae 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -99,12 +99,12 @@ class MultiLevelMesh { void PrintInfo(); // data - const elem_type *_finiteElement[6][5]; + const elem_type *_finiteElement[6][5]; protected: private: - + void BuildElemType(const char GaussOrder[]); // data diff --git a/src/mesh/SalomeIO.cpp b/src/mesh/SalomeIO.cpp index 0218a31cf..09ad633c1 100644 --- a/src/mesh/SalomeIO.cpp +++ b/src/mesh/SalomeIO.cpp @@ -71,7 +71,7 @@ const unsigned SalomeIO::SalomeToFemusFaceIndex[6][6]= void SalomeIO::read(const std::string& name, vector < vector < double> > &coords, const double Lref, std::vector &type_elem_flag) { Mesh& mesh = GetMesh(); - mesh.SetGridNumber(0); + mesh.SetLevel(0); hsize_t dims[2]; diff --git a/unittests/testFSISteady/main.cpp b/unittests/testFSISteady/main.cpp index 9082d51b5..7cabba86c 100644 --- a/unittests/testFSISteady/main.cpp +++ b/unittests/testFSISteady/main.cpp @@ -479,7 +479,7 @@ void AssembleMatrixResFSI(MultiLevelProblem &ml_prob, unsigned level, const unsi // mesh and procs unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); //---------------------------------------------------------------------------------- diff --git a/unittests/testNSSteadyDD/main.cpp b/unittests/testNSSteadyDD/main.cpp index 432f98b84..2a3ffdec9 100644 --- a/unittests/testNSSteadyDD/main.cpp +++ b/unittests/testNSSteadyDD/main.cpp @@ -410,7 +410,7 @@ void AssembleMatrixResNS(MultiLevelProblem &ml_prob, unsigned level, const unsig //data const unsigned dim = mymsh->GetDimension(); unsigned nel= mymsh->GetNumberOfElements(); - unsigned igrid= mymsh->GetGridNumber(); + unsigned igrid= mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double ILambda= 0; double IRe = ml_prob.parameters.get("Fluid").get_IReynolds_number(); @@ -732,7 +732,7 @@ void AssembleMatrixResT(MultiLevelProblem &ml_prob, unsigned level, const unsign //data const unsigned dim = mymsh->GetDimension(); unsigned nel = mymsh->GetNumberOfElements(); - unsigned igrid = mymsh->GetGridNumber(); + unsigned igrid = mymsh->GetLevel(); unsigned iproc = mymsh->processor_id(); double IPe = 1./(ml_prob.parameters.get("Fluid").get_Peclet_number()); From 39a15e88d6ff9edce79af18ed35f457e76d4c351 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Fri, 6 Mar 2015 06:53:58 -0600 Subject: [PATCH 35/91] added default argumnet in wirte for mesh.write --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- src/solution/GMVWriter.cpp | 7 ++++-- src/solution/GMVWriter.hpp | 2 +- src/solution/VTKWriter.cpp | 7 ++++-- src/solution/VTKWriter.hpp | 2 +- src/solution/Writer.hpp | 2 +- src/solution/XDMFWriter.cpp | 22 ++++++++++++------- src/solution/XDMFWriter.hpp | 2 +- 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 4ff775254..f4e2de9aa 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(GMV); + ml_sol.SetWriter(VTK); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 16ea494de..3a5ee21c4 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -46,7 +46,7 @@ GMVWriter::~GMVWriter() } -void GMVWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { +void GMVWriter::write(const std::string output_path, const char order[], const std::vector& vars, const unsigned time_step) const { unsigned igridn = _gridn; // aggiunta da me @@ -58,7 +58,10 @@ void GMVWriter::write(const std::string output_path, const char order[], std::ve unsigned index=(strcmp(order,"linear"))?1:0; std::ostringstream filename; - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".gmv"; + if( _ml_sol != NULL ) + filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".gmv"; + else + filename << output_path << "/mesh.level" << _gridn << "." << time_step << "." << order << ".gmv"; std::ofstream fout; if(_iproc!=0) { diff --git a/src/solution/GMVWriter.hpp b/src/solution/GMVWriter.hpp index 88128490d..39862473e 100644 --- a/src/solution/GMVWriter.hpp +++ b/src/solution/GMVWriter.hpp @@ -46,7 +46,7 @@ namespace femus { virtual ~GMVWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0) const; + virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; /** Set if to print or not to prind the debugging variables */ void SetDebugOutput( bool value ){ _debugOutput = value;} diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index d5aa86121..644f3b429 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -42,7 +42,7 @@ VTKWriter::VTKWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} VTKWriter::~VTKWriter() {} -void VTKWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { +void VTKWriter::write(const std::string output_path, const char order[], const std::vector < std::string > & vars, const unsigned time_step) const { bool print_all = 0; for (unsigned ivar=0; ivar < vars.size(); ivar++){ print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); @@ -66,7 +66,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve std::ostringstream filename; - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".vtu"; + if( _ml_sol != NULL ) + filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".vtu"; + else + filename << output_path << "/mesh.level" << _gridn << "." << time_step << "." << order << ".vtu"; std::ofstream fout; if(_iproc!=0) { diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index 3a230a488..b625e0818 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -46,7 +46,7 @@ class VTKWriter : public Writer { virtual ~VTKWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step=0) const; + virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; private: diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index 68dab1f42..f58ac05b1 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -53,7 +53,7 @@ namespace femus { virtual ~Writer(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) const = 0; + virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const = 0; /** set moving mesh */ void SetMovingMesh(std::vector& movvars_in); diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index dfecd599b..60cef2b41 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -60,10 +60,13 @@ XDMFWriter::XDMFWriter(MultiLevelMesh * ml_mesh): Writer(ml_mesh) {} XDMFWriter::~XDMFWriter() {} -void XDMFWriter::write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step) const { +void XDMFWriter::write(const std::string output_path, const char order[], const std::vector& vars, const unsigned time_step) const { #ifdef HAVE_HDF5 - bool test_all=!(vars[0].compare("All")); + bool print_all = 0; + for (unsigned ivar=0; ivar < vars.size(); ivar++){ + print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); + } unsigned index=0; unsigned index_nd=0; @@ -114,9 +117,12 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //-------------------------------------------------------------------------------------------------- // Print The Xdmf wrapper std::ostringstream filename; - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".xmf"; + if( _ml_sol != NULL ) + filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".xmf"; + else + filename << output_path << "/mesh.level" << _gridn << "." << time_step << "." << order << ".xmf"; std::ofstream fout; - + if(_iproc!=0) { fout.rdbuf(); //redirect to dev_null } @@ -292,8 +298,8 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //------------------------------------------------------------------------------------------------------- // printing element variables - for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol->GetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + for (unsigned i=0; i<(1-print_all)*vars.size()+print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(print_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; if (_ml_sol->GetSolutionType(indx)>=3) { icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { @@ -319,8 +325,8 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //------------------------------------------------------------------------------------------------------- // printing nodes variables - for (unsigned i=0; i<(1-test_all)*vars.size()+test_all*_ml_sol->GetSolutionSize(); i++) { - unsigned indx=(test_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; + for (unsigned i=0; i<(1-print_all)*vars.size()+print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=(print_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; if (_ml_sol->GetSolutionType(indx) < 3) { unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { diff --git a/src/solution/XDMFWriter.hpp b/src/solution/XDMFWriter.hpp index b2a7dae2a..0917846c7 100644 --- a/src/solution/XDMFWriter.hpp +++ b/src/solution/XDMFWriter.hpp @@ -45,7 +45,7 @@ class XDMFWriter : public Writer { virtual ~XDMFWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], std::vector& vars, const unsigned time_step = 0) const; + virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const; /** write a wrapper file for paraview to open all the files of an history together */ void write_solution_wrapper(const std::string output_path, const char type[]) const; From ccfc650517d1c434072e00ac2005a4046f186536 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Fri, 6 Mar 2015 15:47:53 -0600 Subject: [PATCH 36/91] XDMFWriter working with MLMesh --- applications/OptimalControl/tempopt/main.cpp | 1 + src/solution/VTKWriter.cpp | 104 +++++++++---------- src/solution/XDMFWriter.cpp | 48 ++++----- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index b55f09cd0..ea0839124 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -121,6 +121,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr // ===== end QuantityMap ========================================= // ====== Start new main ================================= + MultiLevelMesh ml_msh; ml_msh.GenerateCoarseBoxMesh(8,8,0,0,1,0,2,0,0,QUAD9,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"fifth"); ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 3102de117..2dacdb184 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -49,8 +49,6 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } - MultiLevelMesh * mlMsh = _ml_mesh; - int icount; unsigned index=0; unsigned index_nd=0; @@ -61,7 +59,7 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve index=1; index_nd=1; } else if (!strcmp(order,"biquadratic")) { //biquadratic - index=2; + index=2; /// @todo why is there a 2 while XDMF has a 3? index_nd=2; } @@ -94,28 +92,28 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; nvt+=nvt_ig; } unsigned nel=0; unsigned counter=0; for (unsigned ig=_gridr-1u; ig<_gridn-1u; ig++) { - nel+=( mlMsh->GetLevel(ig)->GetNumberOfElements() - mlMsh->GetLevel(ig)->el->GetRefinedElementNumber()); - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Hex")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Hex"))*NVE[0][index]; - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Tet")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Tet"))*NVE[1][index]; - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Wedge")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Wedge"))*NVE[2][index]; - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Quad")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Quad"))*NVE[3][index]; - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Triangle")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Triangle"))*NVE[4][index]; - counter+=(mlMsh->GetLevel(ig)->el->GetElementNumber("Line")-mlMsh->GetLevel(ig)->el->GetRefinedElementNumber("Line"))*NVE[5][index]; + nel+=( _ml_mesh->GetLevel(ig)->GetNumberOfElements() - _ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber()); + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Hex")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Hex"))*NVE[0][index]; + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Tet")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Tet"))*NVE[1][index]; + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Wedge")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Wedge"))*NVE[2][index]; + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Quad")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Quad"))*NVE[3][index]; + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Triangle")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Triangle"))*NVE[4][index]; + counter+=(_ml_mesh->GetLevel(ig)->el->GetElementNumber("Line")-_ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber("Line"))*NVE[5][index]; } - nel+=mlMsh->GetLevel(_gridn-1u)->GetNumberOfElements(); - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Hex")*NVE[0][index]; - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Tet")*NVE[1][index]; - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Wedge")*NVE[2][index]; - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Quad")*NVE[3][index]; - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Triangle")*NVE[4][index]; - counter+=mlMsh->GetLevel(_gridn-1u)->el->GetElementNumber("Line")*NVE[5][index]; + nel+=_ml_mesh->GetLevel(_gridn-1u)->GetNumberOfElements(); + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Hex")*NVE[0][index]; + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Tet")*NVE[1][index]; + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Wedge")*NVE[2][index]; + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Quad")*NVE[3][index]; + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Triangle")*NVE[4][index]; + counter+=_ml_mesh->GetLevel(_gridn-1u)->el->GetElementNumber("Line")*NVE[5][index]; const unsigned dim_array_coord [] = { nvt*3*sizeof(float) }; const unsigned dim_array_conn[] = { counter*sizeof(int) }; @@ -147,7 +145,7 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve vector mysol(_gridn); for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { mysol[ig] = NumericVector::build().release(); - mysol[ig]->init(mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],mlMsh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); } // point pointer to common mamory area buffer of void type; @@ -156,10 +154,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned offset_nvt3=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { std::vector v_local; - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for(int kk=0;kk<3;kk++) { - mysol[ig]->matrix_mult(*mlMsh->GetLevel(ig)->_coordinate->_Sol[kk], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,2)); + mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[kk], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2)); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; iGetIndex(_moving_vars[0].c_str()); indDXDYDZ[1]=_ml_sol->GetIndex(_moving_vars[1].c_str()); - if(mlMsh->GetLevel(0)->GetDimension() == 3) { + if(_ml_mesh->GetLevel(0)->GetDimension() == 3) { indDXDYDZ[2]=_ml_sol->GetIndex(_moving_vars[2].c_str()); } for(unsigned ig=_gridr-1u; ig<_gridn; ig++){ std::vector v_local; - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; - for(int kk=0;kkGetLevel(0)->GetDimension();kk++) { + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + for(int kk=0;kk<_ml_mesh->GetLevel(0)->GetDimension();kk++) { mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indDXDYDZ[kk]))); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indDXDYDZ[kk]))); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; iGetLevel(ig)->GetNumberOfElements(); iel++) { - if (ig==_gridn-1u || mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0) { - for (unsigned j=0; jGetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { + for (unsigned iel=0; iel<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++) { + if (ig==_gridn-1u || _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0) { + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { unsigned loc_vtk_conn = map_pr[j]; - unsigned jnode=mlMsh->GetLevel(ig)->el->GetElementVertexIndex(iel,loc_vtk_conn)-1u; - unsigned jnode_Metis = mlMsh->GetLevel(ig)->GetMetisDof(jnode,index_nd); + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(iel,loc_vtk_conn)-1u; + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index_nd); var_conn[icount] = offset_nvt+jnode_Metis; icount++; } } } - offset_nvt+=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + offset_nvt+=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; } //print connectivity dimension @@ -271,10 +269,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve int offset_el=0; //print offset array for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned iel=0; ielGetLevel(ig)->GetNumberOfElements(); iel++) { - if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(iel)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(iel,3); - offset_el += mlMsh->GetLevel(ig)->el->GetElementDofNumber(iel_Metis,index); + for (unsigned iel=0; iel<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++) { + if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(iel,3); + offset_el += _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel_Metis,index); var_off[icount] = offset_el; icount++; } @@ -306,10 +304,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned short *var_type = static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); - short unsigned ielt= mlMsh->GetLevel(ig)->el->GetElementType(iel_Metis); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + short unsigned ielt= _ml_mesh->GetLevel(ig)->el->GetElementType(iel_Metis); var_type[icount] = femusToVtkCellType[index][ielt]; icount++; } @@ -346,10 +344,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned short* var_reg=static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); - var_reg[icount]= mlMsh->GetLevel(ig)->el->GetElementGroup(ii); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + var_reg[icount]= _ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } } @@ -379,10 +377,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned short* var_proc=static_cast (buffer_void); icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if ( ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,3); - var_proc[icount]=(unsigned short)(mlMsh->GetLevel(ig)->epart[ii]); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + var_proc[icount]=(unsigned short)(_ml_mesh->GetLevel(ig)->epart[ii]); icount++; } } @@ -417,9 +415,9 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { vector sol_local; _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->localize_to_one(sol_local,0); - for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); ii++) { - if (ig==_gridn-1u || 0==mlMsh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = mlMsh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); var_el[icount]=sol_local[iel_Metis]; icount++; } @@ -471,10 +469,10 @@ void VTKWriter::write(const std::string output_path, const char order[], std::ve unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], - *mlMsh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indx)) ); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indx)) ); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); - unsigned nvt_ig=mlMsh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; for (unsigned ii=0; iiGetLevel(_gridn-1u)->GetNumberOfElements(); unsigned icount; - unsigned el_dof_number = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index); - int *var_int = new int [nel*el_dof_number]; + unsigned el_dof_number = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index_nd); + int * var_conn = new int [nel*el_dof_number]; float *var_el_f = new float [nel]; float *var_nd_f = new float [nvt]; @@ -147,30 +146,30 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v fout<<""<"<"<"<"<" << std::endl; - fout << hdf5_filename2.str() << ":CONNECTIVITY" << std::endl; + fout<<"" << std::endl; + fout << hdf5_filename2.str() << ":/CONNECTIVITY" << std::endl; fout <<"" << std::endl; fout << "" << std::endl; fout << "" << std::endl; //Node_X - fout<<"" << std::endl; - fout << hdf5_filename2.str() << ":NODES_X1" << std::endl; + fout<<"" << std::endl; + fout << hdf5_filename2.str() << ":/NODES_X1" << std::endl; fout <<"" << std::endl; //Node_Y - fout<<"" << std::endl; - fout << hdf5_filename2.str() << ":NODES_X2" << std::endl; + fout<<"" << std::endl; + fout << hdf5_filename2.str() << ":/NODES_X2" << std::endl; fout <<"" << std::endl; //Node_Z - fout<<"" << std::endl; - fout << hdf5_filename2.str() << ":NODES_X3" << std::endl; + fout<<"" << std::endl; + fout << hdf5_filename2.str() << ":/NODES_X3" << std::endl; fout <<"" << std::endl; fout <<"" << std::endl; //Regions fout << "" << std::endl; fout << "" << std::endl; - fout << hdf5_filename2.str() << ":REGIONS" << std::endl; + fout << hdf5_filename2.str() << ":/REGIONS" << std::endl; fout << "" << std::endl; fout << "" << std::endl; @@ -181,15 +180,15 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v //Printing biquadratic solution on the nodes if(_ml_sol->GetSolutionType(indx)<3) { fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Node\">" << std::endl; - fout << "" << std::endl; - fout << hdf5_filename2.str() << ":" << _ml_sol->GetSolutionName(indx) << std::endl; + fout << "" << std::endl; + fout << hdf5_filename2.str() << ":/" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } else if (_ml_sol->GetSolutionType(indx)>=3) { //Printing picewise constant solution on the element fout << "GetSolutionName(indx)<<"\" AttributeType=\"Scalar\" Center=\"Cell\">" << std::endl; - fout << "" << std::endl; - fout << hdf5_filename2.str() << ":" << _ml_sol->GetSolutionName(indx) << std::endl; + fout << "" << std::endl; + fout << hdf5_filename2.str() << ":/" << _ml_sol->GetSolutionName(indx) << std::endl; fout << "" << std::endl; fout << "" << std::endl; } @@ -255,23 +254,24 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { for (unsigned iel=0; iel<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++) { if (_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { - for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { + int ndofs = _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index_nd); + for (unsigned j=0; jGetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index_nd); - var_int[icount] = offset_conn + jnode_Metis; + var_conn[icount] = offset_conn + jnode_Metis; icount++; } } } - offset_conn += _ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); + offset_conn += _ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//GetLevel(ig)->GetDofNumber(index_nd); } dimsf[0] = nel*el_dof_number ; dimsf[1] = 1; dataspace = H5Screate_simple(2,dimsf, NULL); dataset = H5Dcreate(file_id,"/CONNECTIVITY",H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_int[0]); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_conn[0]); H5Sclose(dataspace); H5Dclose(dataset); //------------------------------------------------------------------------------------------------------ @@ -284,7 +284,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); - var_int[icount] = _ml_mesh->GetLevel(ig)->el->GetElementGroup(iel_Metis); + var_conn[icount] = _ml_mesh->GetLevel(ig)->el->GetElementGroup(iel_Metis); icount++; } } @@ -294,7 +294,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v dataspace = H5Screate_simple(2,dimsf, NULL); dataset = H5Dcreate(file_id,"/REGIONS",H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_int[0]); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_conn[0]); H5Sclose(dataspace); H5Dclose(dataset); @@ -360,7 +360,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], std::v H5Fclose(file_id); //free memory - delete [] var_int; + delete [] var_conn; delete [] var_el_f; delete [] var_nd_f; From c67bc9125a52e0cc2a78aad1bd85e8368eb3c4f0 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Fri, 6 Mar 2015 16:20:01 -0600 Subject: [PATCH 37/91] Simplified sol-mesh switch in all Writers --- src/solution/GMVWriter.cpp | 10 ++++++---- src/solution/VTKWriter.cpp | 10 ++++++---- src/solution/XDMFWriter.cpp | 10 +++++++--- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 3a5ee21c4..6f74e72bc 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -57,11 +57,13 @@ void GMVWriter::write(const std::string output_path, const char order[], const s // ********** linear -> index==0 *** quadratic -> index==1 ********** unsigned index=(strcmp(order,"linear"))?1:0; + std::string filename_prefix; + if( _ml_sol != NULL ) filename_prefix = "sol"; + else filename_prefix = "mesh"; + std::ostringstream filename; - if( _ml_sol != NULL ) - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".gmv"; - else - filename << output_path << "/mesh.level" << _gridn << "." << time_step << "." << order << ".gmv"; + filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." << time_step << "." << order << ".gmv"; + std::ofstream fout; if(_iproc!=0) { diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 10c5a53bd..82976919f 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -64,11 +64,13 @@ void VTKWriter::write(const std::string output_path, const char order[], const s } + std::string filename_prefix; + if( _ml_sol != NULL ) filename_prefix = "sol"; + else filename_prefix = "mesh"; + std::ostringstream filename; - if( _ml_sol != NULL ) - filename << output_path << "/sol.level" << _gridn << "." << time_step << "." << order << ".vtu"; - else - filename << output_path << "/mesh.level" << _gridn << "." << time_step << "." << order << ".vtu"; + filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." << time_step << "." << order << ".vtu"; + std::ofstream fout; if(_iproc!=0) { diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 652bf00c1..00791c6d3 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -117,10 +117,13 @@ void XDMFWriter::write(const std::string output_path, const char order[], const //-------------------------------------------------------------------------------------------------- + std::string filename_prefix; + if( _ml_sol != NULL ) filename_prefix = "sol"; + else filename_prefix = "mesh"; + // Print The Xdmf wrapper std::ostringstream xdmf_filename; - if( _ml_sol != NULL ) xdmf_filename << output_path << "/" << "sol.level" << _gridn << "." << time_step << "." << order << ".xmf"; - else xdmf_filename << output_path << "/" << "mesh.level" << _gridn << "." << time_step << "." << order << ".xmf"; + xdmf_filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." << time_step << "." << order << ".xmf"; std::ofstream fout; @@ -141,7 +144,8 @@ void XDMFWriter::write(const std::string output_path, const char order[], const // Print The HDF5 file std::ostringstream hdf5_filename; std::ostringstream hdf5_filename2; - hdf5_filename2 << "sol.level" << _gridn << "." << time_step << "." << order << ".h5"; + hdf5_filename2 << filename_prefix << ".level" << _gridn << "." << time_step << "." << order << ".h5"; + hdf5_filename << output_path << "/" << hdf5_filename2.str(); // head ************************************************ fout<<"" << std::endl; From 23e2e57c19e8724d3a62f246aa8d59926c60f693 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Fri, 6 Mar 2015 17:22:48 -0600 Subject: [PATCH 38/91] Added all Writers in testSalomeIO --- applications/OptimalControl/tempopt/main.cpp | 3 +-- .../testSalomeIO/input/{Cube3d.med => OneHex27.med} | Bin .../testSalomeIO/input/{Mesh_1.med => OneQuad9.med} | Bin .../input/{StudyCube3d.hdf => StudyHex27.hdf} | Bin unittests/testSalomeIO/testSalomeIO.cpp | 10 +++++++++- 5 files changed, 10 insertions(+), 3 deletions(-) rename unittests/testSalomeIO/input/{Cube3d.med => OneHex27.med} (100%) rename unittests/testSalomeIO/input/{Mesh_1.med => OneQuad9.med} (100%) rename unittests/testSalomeIO/input/{StudyCube3d.hdf => StudyHex27.hdf} (100%) diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index ea0839124..83c3255f8 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -128,8 +128,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ml_msh.PrintInfo(); ml_msh.SetWriter(XDMF); - std::vector print_vars; - ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic",print_vars); + ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic"); MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); diff --git a/unittests/testSalomeIO/input/Cube3d.med b/unittests/testSalomeIO/input/OneHex27.med similarity index 100% rename from unittests/testSalomeIO/input/Cube3d.med rename to unittests/testSalomeIO/input/OneHex27.med diff --git a/unittests/testSalomeIO/input/Mesh_1.med b/unittests/testSalomeIO/input/OneQuad9.med similarity index 100% rename from unittests/testSalomeIO/input/Mesh_1.med rename to unittests/testSalomeIO/input/OneQuad9.med diff --git a/unittests/testSalomeIO/input/StudyCube3d.hdf b/unittests/testSalomeIO/input/StudyHex27.hdf similarity index 100% rename from unittests/testSalomeIO/input/StudyCube3d.hdf rename to unittests/testSalomeIO/input/StudyHex27.hdf diff --git a/unittests/testSalomeIO/testSalomeIO.cpp b/unittests/testSalomeIO/testSalomeIO.cpp index 3aafa00e0..7f348bff8 100644 --- a/unittests/testSalomeIO/testSalomeIO.cpp +++ b/unittests/testSalomeIO/testSalomeIO.cpp @@ -2,6 +2,7 @@ #include "FemusDefault.hpp" #include "FemusInit.hpp" #include "MultiLevelMesh.hpp" +#include "WriterEnum.hpp" using namespace femus; @@ -12,7 +13,7 @@ int main(int argc,char **args) { FemusInit init(argc,args,MPI_COMM_WORLD); - std::string med_file = "Mesh_1.med"; + std::string med_file = "OneQuad9.med"; std::ostringstream mystream; mystream << "./" << DEFAULT_INPUTDIR << "/" << med_file; const std::string infile = mystream.str(); @@ -22,5 +23,12 @@ int main(int argc,char **args) { MultiLevelMesh ml_msh; ml_msh.ReadCoarseMesh(infile.c_str(),"seventh",Lref); + ml_msh.SetWriter(XDMF); + ml_msh.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic"); + ml_msh.SetWriter(VTK); + ml_msh.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic"); + ml_msh.SetWriter(GMV); + ml_msh.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic"); + return 0; } From 2e03586d77eb819f786183a9b51dffb238555d21 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Fri, 6 Mar 2015 19:01:10 -0600 Subject: [PATCH 39/91] Some git instructions --- README.md | 2 +- doc/devel_rules.txt | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cd178664..936fa056e 100644 --- a/README.md +++ b/README.md @@ -58,5 +58,5 @@ Giorgio Bornia License ======== -Femus is opensource software distributed under the LGPL license, version 2.1 +Femus is an open-source software distributed under the LGPL license, version 2.1 diff --git a/doc/devel_rules.txt b/doc/devel_rules.txt index f10481394..83eed58d6 100644 --- a/doc/devel_rules.txt +++ b/doc/devel_rules.txt @@ -86,3 +86,14 @@ git config --global user.email "name.surname@example.com" - Using the manual never hurts... +- To contribute: + Create a personal github account + Create a fork of the femus repository in your github account + Clone your fork in your computer + Work in your computer (do branches, commit changes, ...) + Push your branches back to your fork + Send a pull request to the main femus repository + The maintainers will decide what to do with the pull request and possibly it will be merged to master + Periodically, sync the master in the fork with the master in the main femus repository + + From 05ec398a94c57ecd7d074bf89e5392338069889a Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Sat, 7 Mar 2015 06:59:08 -0600 Subject: [PATCH 40/91] added a check in moving doman in XDMF --- src/solution/XDMFWriter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 00791c6d3..6d9787e7b 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -67,9 +67,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for (unsigned ivar=0; ivar < vars.size(); ivar++){ print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } - - - + unsigned index=0; unsigned index_nd=0; if(!strcmp(order,"linear")) { //linear @@ -232,7 +230,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2) ); unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { unsigned varind_DXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(varind_DXDYDZ))); From bb45469848207f7e38b3e08fc37dd971c3103b95 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sat, 7 Mar 2015 15:08:19 -0600 Subject: [PATCH 41/91] Fixed parallel print mesh in XDMF, now the solution --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- src/solution/VTKWriter.cpp | 4 +- src/solution/XDMFWriter.cpp | 37 +++++++++++++------ 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index f4e2de9aa..63ffad318 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(VTK); + ml_sol.SetWriter(XDMF); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 82976919f..a84dc5198 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -23,8 +23,8 @@ #include #include #include -#include "string.h" -#include "stdio.h" +#include +#include #include #include diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 6d9787e7b..9c611e4fe 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -91,7 +91,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const if (type_elem.compare("Not_implemented") == 0) { std::cerr << "XDMF-Writer error: element type not supported!" << std::endl; - exit(1); + abort(); } unsigned nvt=0; @@ -220,36 +220,51 @@ void XDMFWriter::write(const std::string output_path, const char order[], const // Printing nodes coordinates for (int i=0; i<3; i++) { - unsigned offset_nvt=0; + unsigned offset_nvt = 0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//->GetDofNumber(index_nd); NumericVector* mysol; - mysol = NumericVector::build().release(); + NumericVector* mysol_ser; + mysol = NumericVector::build().release(); + mysol_ser = NumericVector::build().release(); + mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2) ); - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); - for (unsigned ii=0; iilocalize(*mysol_ser); + if(_iproc==0) { + for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { unsigned varind_DXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(varind_DXDYDZ))); - for (unsigned ii=0; iilocalize(*mysol_ser); + if(_iproc==0) { + for (unsigned ii=0; ii Date: Sat, 7 Mar 2015 15:25:02 -0600 Subject: [PATCH 42/91] Fixed print for node-based variables, next element-based --- src/solution/XDMFWriter.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 9c611e4fe..46b8f219b 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -220,7 +220,6 @@ void XDMFWriter::write(const std::string output_path, const char order[], const // Printing nodes coordinates for (int i=0; i<3; i++) { - unsigned offset_nvt = 0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//->GetDofNumber(index_nd); NumericVector* mysol; @@ -247,7 +246,6 @@ void XDMFWriter::write(const std::string output_path, const char order[], const } } - offset_nvt += nvt_ig; delete mysol; delete mysol_ser; } @@ -258,9 +256,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const dataspace = H5Screate_simple(2,dimsf, NULL); dataset = H5Dcreate(file_id,Name.str().c_str(),H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); -// if(_iproc==0) { status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_nd_f); -// } H5Sclose(dataspace); H5Dclose(dataset); @@ -352,25 +348,31 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for (unsigned i=0; i<(1-print_all)*vars.size()+print_all*_ml_sol->GetSolutionSize(); i++) { unsigned indx=(print_all==0)?_ml_sol->GetIndex(vars[i].c_str()):i; if (_ml_sol->GetSolutionType(indx) < 3) { - unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; NumericVector* mysol; + NumericVector* mysol_ser; mysol = NumericVector::build().release(); + mysol_ser = NumericVector::build().release(); //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); - mysol->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); + mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd, _ml_sol->GetSolutionType(indx)) ); - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd); - for (unsigned ii=0; iilocalize(*mysol_ser); + if(_iproc==0) { + for (unsigned ii=0; iiGetSolutionName(indx),H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_nd_f[0]); + status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_nd_f); H5Sclose(dataspace); H5Dclose(dataset); } From 21460dd1844fbaeda3a76613b1908fdf0fe395c8 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sat, 7 Mar 2015 15:50:34 -0600 Subject: [PATCH 43/91] XDMF fixed parallel print for element-based variables --- src/solution/XDMFWriter.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 46b8f219b..2c0e94a93 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -222,12 +222,9 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for (int i=0; i<3; i++) { for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//->GetDofNumber(index_nd); - NumericVector* mysol; - NumericVector* mysol_ser; - mysol = NumericVector::build().release(); - mysol_ser = NumericVector::build().release(); + NumericVector* mysol = NumericVector::build().release(); + NumericVector* mysol_ser = NumericVector::build().release(); mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); - //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2) ); @@ -323,13 +320,20 @@ void XDMFWriter::write(const std::string output_path, const char order[], const if (_ml_sol->GetSolutionType(indx)>=3) { icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + unsigned nel_ig = _ml_mesh->GetLevel(ig)->GetNumberOfElements(); + unsigned sol_size = _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->size(); + NumericVector* mysol_ser = NumericVector::build().release(); + mysol_ser->init(sol_size,sol_size,true,SERIAL); + for (unsigned ii=0; iiGetLevel(ig)->el->GetRefinedElementIndex(ii)) { + _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->localize(*mysol_ser); unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); - var_el_f[icount]=(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx])(iel_Metis); + + var_el_f[icount]=(*mysol_ser)(iel_Metis); icount++; } } + delete mysol_ser; } dimsf[0] = nel; dimsf[1] = 1; @@ -350,11 +354,8 @@ void XDMFWriter::write(const std::string output_path, const char order[], const if (_ml_sol->GetSolutionType(indx) < 3) { for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; - NumericVector* mysol; - NumericVector* mysol_ser; - mysol = NumericVector::build().release(); - mysol_ser = NumericVector::build().release(); - //mysol->init(_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),_ml_mesh->GetLevel(ig)->GetDofNumber(index_nd),true,AUTOMATIC); + NumericVector* mysol = NumericVector::build().release(); + NumericVector* mysol_ser = NumericVector::build().release(); mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], From cf60ebc7ce377d44d3e7966f3d1d7fe86e3c6079 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sat, 7 Mar 2015 16:07:12 -0600 Subject: [PATCH 44/91] XDMF parallel region printing is now correct --- src/solution/XDMFWriter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 2c0e94a93..a28081548 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -293,12 +293,14 @@ void XDMFWriter::write(const std::string output_path, const char order[], const //------------------------------------------------------------------------------------------------------- // print regions + icount=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); - var_conn[icount] = _ml_mesh->GetLevel(ig)->el->GetElementGroup(iel_Metis); + var_conn[icount] = _ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } } @@ -308,10 +310,13 @@ void XDMFWriter::write(const std::string output_path, const char order[], const dataspace = H5Screate_simple(2,dimsf, NULL); dataset = H5Dcreate(file_id,"/REGIONS",H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_conn[0]); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_conn); H5Sclose(dataspace); H5Dclose(dataset); + // end print regions + //------------------------------------------------------------------------------------------------------- + if (_ml_sol != NULL) { //------------------------------------------------------------------------------------------------------- // printing element variables From 771e2cf7f8a39f058e3e9d951b7ff785ca165e23 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sat, 7 Mar 2015 16:32:42 -0600 Subject: [PATCH 45/91] Added domain partitions print in XDMF --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- src/solution/XDMFWriter.cpp | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 63ffad318..f4e2de9aa 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(XDMF); + ml_sol.SetWriter(VTK); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index a28081548..20ead3882 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -110,6 +110,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const unsigned icount; unsigned el_dof_number = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index_nd); int * var_conn = new int [nel*el_dof_number]; + std::vector var_proc(nel); float *var_el_f = new float [nel]; float *var_nd_f = new float [nvt]; @@ -178,6 +179,12 @@ void XDMFWriter::write(const std::string output_path, const char order[], const fout << hdf5_filename2.str() << ":/REGIONS" << std::endl; fout << "" << std::endl; fout << "" << std::endl; + //Metis partitions + fout << "" << std::endl; + fout << "" << std::endl; + fout << hdf5_filename2.str() << ":/DOMAIN_PARTITIONS" << std::endl; + fout << "" << std::endl; + fout << "" << std::endl; if (_ml_sol != NULL) { // Solution Variables @@ -317,6 +324,30 @@ void XDMFWriter::write(const std::string output_path, const char order[], const // end print regions //------------------------------------------------------------------------------------------------------- + //------------------------------------------------------------------------------------------------------- + // print partitioning + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + var_proc[icount] = _ml_mesh->GetLevel(ig)->epart[ii]; + icount++; + } + } + } + + dimsf[0] = nel; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,"/DOMAIN_PARTITIONS",H5T_NATIVE_INT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_proc[0]); + H5Sclose(dataspace); + H5Dclose(dataset); + // end print partitioning + //------------------------------------------------------------------------------------------------------- + if (_ml_sol != NULL) { //------------------------------------------------------------------------------------------------------- // printing element variables From a16efbf5eb33eacdeee5e1c8875fb070a06c2a98 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 00:48:21 -0600 Subject: [PATCH 46/91] Removed GetMeshTwo for xyz_refbox --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- applications/OptimalControl/fe_test/EqnT.cpp | 10 +++++++++- applications/OptimalControl/mhdopt/EqnMHD.cpp | 15 +++++++++++---- applications/OptimalControl/mhdopt/EqnMHDAD.cpp | 12 ++++++++++-- applications/OptimalControl/mhdopt/EqnMHDCONT.cpp | 12 ++++++++++-- applications/OptimalControl/mhdopt/EqnNS.cpp | 11 +++++++++-- applications/OptimalControl/mhdopt/EqnNSAD.cpp | 11 +++++++++-- applications/OptimalControl/tempopt/EqnNS.cpp | 11 +++++++++-- applications/OptimalControl/tempopt/EqnT.cpp | 11 ++++++++--- src/enums/FETypeEnum.hpp | 2 ++ src/enums/GeomElTypeEnum.hpp | 3 +++ src/equations/SystemTwo.hpp | 2 +- src/solution/XDMFWriter.cpp | 2 +- 13 files changed, 83 insertions(+), 21 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index f4e2de9aa..63ffad318 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(VTK); + ml_sol.SetWriter(XDMF); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 9c4baea89..dd049c850 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -13,6 +13,7 @@ #include "FETypeEnum.hpp" #include "NormTangEnum.hpp" #include "VBTypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "QTYnumEnum.hpp" #include "Domain.hpp" #include "TimeLoop.hpp" @@ -46,6 +47,13 @@ my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== + {//BEGIN VOLUME //==== AUXILIARY ============== @@ -98,7 +106,7 @@ CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index 30272e20d..b3a30089d 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -11,6 +11,7 @@ #include "Quantity.hpp" #include "MultiLevelProblem.hpp" #include "FETypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "NormTangEnum.hpp" #include "QTYnumEnum.hpp" #include "TimeLoop.hpp" @@ -58,9 +59,15 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== + {//BEGIN VOLUME -//====================== -//====================== + const uint mesh_vb = VV; const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; @@ -129,7 +136,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); CurrentQuantity Bext(currgp); @@ -417,7 +424,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); CurrentQuantity Bext(currgp); diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index c3e5296ba..b691441eb 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -12,6 +12,7 @@ #include "MultiLevelMeshTwo.hpp" #include "MultiLevelProblem.hpp" #include "FETypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "NormTangEnum.hpp" #include "QTYnumEnum.hpp" #include "TimeLoop.hpp" @@ -54,6 +55,13 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== + {//BEGIN VOLUME const uint mesh_vb = VV; @@ -93,7 +101,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); //========== @@ -346,7 +354,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //========= END EXTERNAL QUANTITIES ================= diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 46ad2dcda..c46861278 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -13,6 +13,7 @@ #include "MultiLevelProblem.hpp" #include "FETypeEnum.hpp" #include "NormTangEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "Quantity.hpp" #include "QTYnumEnum.hpp" #include "TimeLoop.hpp" @@ -65,6 +66,13 @@ using namespace femus; my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== + {//BEGIN VOLUME const uint mesh_vb = VV; @@ -101,7 +109,7 @@ using namespace femus; CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); #if VELOCITY_QTY==1 @@ -397,7 +405,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //=========END EXTERNAL QUANTITIES (couplings) ===== diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 6c5f193c1..14f827c56 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -13,6 +13,7 @@ #include "FETypeEnum.hpp" #include "NormTangEnum.hpp" #include "VBTypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "QTYnumEnum.hpp" #include "Domain.hpp" #include "TimeLoop.hpp" @@ -150,6 +151,12 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== {//BEGIN VOLUME //=============================== @@ -202,7 +209,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); //============================ MAG WORLD ======================================= @@ -590,7 +597,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //======================= diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index 7bfe63c7c..1f739db28 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -10,6 +10,7 @@ #include "Domain.hpp" #include "MultiLevelProblem.hpp" #include "FETypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "NormTangEnum.hpp" #include "Quantity.hpp" #include "QTYnumEnum.hpp" @@ -55,6 +56,12 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== {//BEGIN VOLUME const uint mesh_vb = VV; @@ -94,7 +101,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); CurrentQuantity Vel(currgp); @@ -354,7 +361,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //========= END EXTERNAL QUANTITIES ================= diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index f1c754022..cef5cda23 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -13,6 +13,7 @@ #include "FETypeEnum.hpp" #include "NormTangEnum.hpp" #include "VBTypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "QTYnumEnum.hpp" #include "Domain.hpp" #include "CurrentGaussPoint.hpp" @@ -73,6 +74,12 @@ my_system._A[Level]->zero(); my_system._b[Level]->zero(); +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + +// ========================================== +// ========================================== {//BEGIN VOLUME //======================== @@ -125,7 +132,7 @@ CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); //other Physical constant Quantities @@ -419,7 +426,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //=== auxiliary Operators at the boundary diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 810a8dca8..3501142ee 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -18,6 +18,7 @@ #include "FETypeEnum.hpp" #include "NormTangEnum.hpp" #include "VBTypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "QTYnumEnum.hpp" #include "Domain.hpp" #include "TimeLoop.hpp" @@ -112,7 +113,11 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri my_system._A[Level]->zero(); my_system._b[Level]->zero(); - + +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + // ========================================== // ========================================== {//BEGIN VOLUME @@ -158,7 +163,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); //================== @@ -447,7 +452,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! - xyz_refbox._ndof = NVE[ ml_prob.GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); //===============Tdes===================== diff --git a/src/enums/FETypeEnum.hpp b/src/enums/FETypeEnum.hpp index 8a262ac67..a6f145eb3 100644 --- a/src/enums/FETypeEnum.hpp +++ b/src/enums/FETypeEnum.hpp @@ -14,4 +14,6 @@ enum FEType {QQ=0, LL, KK }; #define NFE_FAMS 5 +#define ZERO_ELEM 0 + #endif \ No newline at end of file diff --git a/src/enums/GeomElTypeEnum.hpp b/src/enums/GeomElTypeEnum.hpp index 4754dbc5a..d39a6da17 100644 --- a/src/enums/GeomElTypeEnum.hpp +++ b/src/enums/GeomElTypeEnum.hpp @@ -15,5 +15,8 @@ enum GeomElType { HEX=0, #define LEV_PICK 0 +#define ZERO_ELEM 0 + +#define ZERO_FACE 0 #endif \ No newline at end of file diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index aec4a9ad0..e07187797 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -55,7 +55,7 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= SystemTwo(MultiLevelProblem & equations_map, const std::string & eq_name_in, const unsigned int number, const MgSmoother & smoother_type); //System// - virtual ~SystemTwo(); //System// + ~SystemTwo(); //System// DofMap _dofmap; //// LinearEquation (each level) diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 20ead3882..e1c2039f9 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -85,7 +85,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const /// @todo I assume that the mesh is not mixed std::string type_elem; - unsigned elemtype = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementType(0); + unsigned elemtype = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementType(ZERO_ELEM); type_elem = XDMFWriter::type_el[index][elemtype]; if (type_elem.compare("Not_implemented") == 0) From 749753a4abe8781473d502799c56e520acb98ad9 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 01:15:16 -0600 Subject: [PATCH 47/91] myproc from Mesh instead of MeshTwo --- applications/OptimalControl/fe_test/EqnT.cpp | 4 +--- applications/OptimalControl/mhdopt/EqnMHD.cpp | 5 +++-- applications/OptimalControl/mhdopt/EqnMHDAD.cpp | 5 +++-- applications/OptimalControl/mhdopt/EqnMHDCONT.cpp | 5 +++-- applications/OptimalControl/mhdopt/EqnNS.cpp | 7 +------ applications/OptimalControl/mhdopt/EqnNSAD.cpp | 13 +++++++------ applications/OptimalControl/tempopt/EqnNS.cpp | 4 +--- applications/OptimalControl/tempopt/EqnT.cpp | 4 +--- src/mesh/MultiLevelMesh.cpp | 2 +- src/mesh/MultiLevelMesh.hpp | 2 +- 10 files changed, 22 insertions(+), 29 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index dd049c850..2506d877d 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -33,9 +33,6 @@ const double time = 0.; -//========== PROCESSOR INDEX - const uint myproc = ml_prob.GetMeshTwo()._iproc; - //========= BCHandling ========= const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); @@ -50,6 +47,7 @@ // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index b3a30089d..2ebfb64bf 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -62,6 +62,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== @@ -70,8 +71,8 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr const uint mesh_vb = VV; - const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; - const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0; iel < (nel_e - nel_b); iel++) { diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index b691441eb..e44ffb76c 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -58,6 +58,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== @@ -66,8 +67,8 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); const uint mesh_vb = VV; - const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; - const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0; iel < (nel_e - nel_b); iel++) { diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index c46861278..478c5fb13 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -69,6 +69,7 @@ using namespace femus; // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== @@ -77,8 +78,8 @@ using namespace femus; const uint mesh_vb = VV; - const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; - const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0; iel < (nel_e - nel_b); iel++) { diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 14f827c56..1dc2c2145 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -75,12 +75,6 @@ Viscosity* viscosity_ptr = static_cast(ml_prob.GetQtyMap().GetQuanti const double time = 0.; //ml_prob._timeloop._curr_time; -//========== PROCESSOR INDEX -//every routine we use here should depend directly on this one and not implicitly -//through the class _iproc. This should be a sort of "function argument", -//like the Level - const uint myproc = ml_prob.GetMeshTwo()._iproc; - //==========FLAG FOR STATIONARITY OR NOT //FLAG for the TIME DISCRETIZATION //every Equation may have a TimeDiscretization @@ -154,6 +148,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index 1f739db28..5d66d56aa 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -59,6 +59,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== @@ -66,8 +67,8 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); const uint mesh_vb = VV; - const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; - const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0; iel < (nel_e - nel_b); iel++) { @@ -143,7 +144,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); currelem.Mat().zero(); currelem.Rhs().zero(); - currelem.SetDofobjConnCoords(ml_prob.GetMeshTwo()._iproc,iel); + currelem.SetDofobjConnCoords(myproc,iel); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); @@ -325,8 +326,8 @@ for (uint fe = 0; fe < QL; fe++) { const uint mesh_vb = BB; - const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level+1]; - const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*ml_prob.GetMeshTwo()._iproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0;iel < (nel_e - nel_b) ; iel++) { @@ -370,7 +371,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.Mat().zero(); currelem.Rhs().zero(); - currelem.SetDofobjConnCoords(ml_prob.GetMeshTwo()._iproc,iel); + currelem.SetDofobjConnCoords(myproc,iel); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index cef5cda23..87e414a01 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -39,9 +39,6 @@ const double time = 0.;//ml_prob._timeloop._curr_time; -//========== PROCESSOR INDEX - const uint myproc = ml_prob.GetMeshTwo()._iproc; - //==========FLAG FOR STATIONARITY OR NOT const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); const double dt = 1.; @@ -77,6 +74,7 @@ // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 3501142ee..36ee23ddf 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -81,9 +81,6 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri const double time = 0.; // ml_prob._timeloop._curr_time; -//========== PROCESSOR INDEX - const uint myproc = ml_prob.GetMeshTwo()._iproc; - //==========FLAG FOR STATIONARITY OR NOT const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); const uint Nonstat = ml_prob.GetInputParser().get("NonStatTEMP"); @@ -117,6 +114,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); // ========================================== // ========================================== diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index b0915689b..5cd707dbe 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -2,7 +2,7 @@ Program: FEMUS Module: MultiLevelMesh - Authors: Simone Bnà, Eugenio Aulisa + Authors: Simone Bnà, Eugenio Aulisa, Giorgio Bornia Copyright (c) FEMTTU All rights reserved. diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index 559ecc33a..9d91cf0a8 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -2,7 +2,7 @@ Program: FEMUS Module: MultiLevelMesh -Authors: Eugenio Aulisa, Simone Bnà +Authors: Eugenio Aulisa, Simone Bnà, Giorgio Bornia Copyright (c) FEMUS All rights reserved. From ac763fc0554b2c6bc9e851423016cecc2b2e9256 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 01:38:25 -0600 Subject: [PATCH 48/91] GetDimension in MLMesh, and removed penalty_val --- applications/OptimalControl/fe_test/EqnT.cpp | 5 +---- .../OptimalControl/fe_test/input/femus_conf.in | 4 ---- applications/OptimalControl/mhdopt/EqnMHD.cpp | 7 ++----- applications/OptimalControl/mhdopt/EqnMHDAD.cpp | 6 ++---- .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 6 +----- applications/OptimalControl/mhdopt/EqnNS.cpp | 5 +---- applications/OptimalControl/mhdopt/EqnNSAD.cpp | 5 +---- .../OptimalControl/mhdopt/input/femus_conf.in | 4 ---- applications/OptimalControl/tempopt/EqnNS.cpp | 5 +---- applications/OptimalControl/tempopt/EqnT.cpp | 16 ++++++---------- .../OptimalControl/tempopt/input/femus_conf.in | 4 ---- src/mesh/MultiLevelMesh.cpp | 7 ++++++- src/mesh/MultiLevelMesh.hpp | 6 +++++- 13 files changed, 26 insertions(+), 54 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 2506d877d..730588fdd 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -33,11 +33,8 @@ const double time = 0.; -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - //======== ELEMENT MAPPING ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); diff --git a/applications/OptimalControl/fe_test/input/femus_conf.in b/applications/OptimalControl/fe_test/input/femus_conf.in index addb94e79..4ce703fe7 100644 --- a/applications/OptimalControl/fe_test/input/femus_conf.in +++ b/applications/OptimalControl/fe_test/input/femus_conf.in @@ -9,10 +9,6 @@ geomel_type 3 # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh sh dimension 2 bdry_toll 0.0000001 # ==== not in library routines, but library-type - -# --------------------- -penalty_val 1.e10 # ==== not in library routines, but library-type - diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index 2ebfb64bf..78fcf0324 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -48,11 +48,8 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr const int NonStatMHD = (int) ml_prob.GetInputParser().get("NonStatMHD"); const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - //======== GEOMETRICAL ELEMENT ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= @@ -160,7 +157,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr currelem.Mat().zero(); currelem.Rhs().zero(); - currelem.SetDofobjConnCoords(ml_prob.GetMeshTwo()._iproc,iel); + currelem.SetDofobjConnCoords(myproc,iel); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index e44ffb76c..038784af5 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -45,13 +45,11 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); //======== GEOMETRICAL ELEMENT ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - + my_system._A[Level]->zero(); my_system._b[Level]->zero(); diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 478c5fb13..7fa355688 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -38,14 +38,10 @@ using namespace femus; const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); //======== GEOMETRICAL ELEMENT ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - //========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - //========= reference values ========= - //====== Physics double IRem = 1./ml_prob.GetInputParser().get("Rem"); double S = ml_prob.GetInputParser().get("S"); diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 1dc2c2145..01e202737 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -135,13 +135,10 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); //========== GEOMETRIC ELEMENT ======== - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - my_system._A[Level]->zero(); my_system._b[Level]->zero(); diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index 5d66d56aa..10e0bb5a1 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -45,13 +45,10 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); // //======== GEOMETRICAL ELEMENT ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); my_system._A[Level]->zero(); my_system._b[Level]->zero(); diff --git a/applications/OptimalControl/mhdopt/input/femus_conf.in b/applications/OptimalControl/mhdopt/input/femus_conf.in index 998b5de99..da37634c8 100644 --- a/applications/OptimalControl/mhdopt/input/femus_conf.in +++ b/applications/OptimalControl/mhdopt/input/femus_conf.in @@ -9,10 +9,6 @@ geomel_type 0 # =MESH CONSISTENCY=== # the mesh file should provi dimension 3 # =MESH CONSISTENCY=== bdry_toll 0.0000001 # ==== -# --------------------- -penalty_val 1.e10 # ==== not in library routines, but library-type - - diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 87e414a01..9ff033d21 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -43,11 +43,8 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); const double dt = 1.; -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - //========== GEOMETRIC ELEMENT ======== - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 36ee23ddf..24de1156c 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -77,7 +77,11 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri //if we are just a function not inside a class, we have to retrieve ourselves... SystemTwo & my_system = ml_prob.get_system("Eqn_T"); - +// ========================================== + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + elem *myel = mymsh->el; + const unsigned myproc = mymsh->processor_id(); + const double time = 0.; // ml_prob._timeloop._curr_time; @@ -85,11 +89,8 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri const double dt = 1.; //ml_prob._timeloop._timemap.get("dt"); const uint Nonstat = ml_prob.GetInputParser().get("NonStatTEMP"); -//========= BCHandling ========= - const double penalty_val = ml_prob.GetMeshTwo().GetRuntimeMap().get("penalty_val"); - //======== ELEMENT MAPPING ======= - const uint space_dim = ml_prob.GetMeshTwo().get_dim(); + const uint space_dim = ml_prob._ml_msh->GetDimension(); const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); @@ -111,11 +112,6 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri my_system._A[Level]->zero(); my_system._b[Level]->zero(); -// ========================================== - Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); - elem *myel = mymsh->el; - const unsigned myproc = mymsh->processor_id(); - // ========================================== // ========================================== {//BEGIN VOLUME diff --git a/applications/OptimalControl/tempopt/input/femus_conf.in b/applications/OptimalControl/tempopt/input/femus_conf.in index 45b3de3bb..ee0b86acf 100644 --- a/applications/OptimalControl/tempopt/input/femus_conf.in +++ b/applications/OptimalControl/tempopt/input/femus_conf.in @@ -9,10 +9,6 @@ geomel_type 3 # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh sh dimension 2 bdry_toll 0.0000001 # ==== not in library routines, but library-type - -# --------------------- -penalty_val 1.e10 # ==== not in library routines, but library-type - diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index 5cd707dbe..305d7222e 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -366,7 +366,12 @@ void MultiLevelMesh::PrintInfo() { } } - + /** Get the dimension of the problem (1D, 2D, 3D) from one Mesh (level 0 always exists, after initialization) */ + const unsigned MultiLevelMesh::GetDimension() const { + return _level0[LEV_PICK]->GetDimension(); + } + + } //end namespace femus diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index 9d91cf0a8..58fa1e480 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -19,6 +19,7 @@ PURPOSE. See the above copyright notice for more information. #include #include "ElemTypeEnum.hpp" +#include "GeomElTypeEnum.hpp" #include "WriterEnum.hpp" #include "Writer.hpp" @@ -108,7 +109,10 @@ class MultiLevelMesh { /** To be Added */ void SetWriter(const WriterEnum format) { _writer = Writer::build(format,this).release(); } - + + /** Get the dimension of the problem (1D, 2D, 3D) */ + const unsigned GetDimension() const; + protected: private: From 7fce8044fb792bc4ae2327c5163ef14daeb831ca Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 03:02:38 -0500 Subject: [PATCH 49/91] Domain pointer in MLMesh --- applications/OptimalControl/fe_test/EqnT.cpp | 2 +- applications/OptimalControl/fe_test/main.cpp | 2 ++ applications/OptimalControl/mhdopt/EqnMHD.cpp | 4 ++-- applications/OptimalControl/mhdopt/EqnMHDAD.cpp | 4 ++-- .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 4 ++-- applications/OptimalControl/mhdopt/EqnNS.cpp | 4 ++-- applications/OptimalControl/mhdopt/EqnNSAD.cpp | 4 ++-- applications/OptimalControl/mhdopt/main.cpp | 2 ++ applications/OptimalControl/tempopt/EqnNS.cpp | 4 ++-- applications/OptimalControl/tempopt/EqnT.cpp | 4 ++-- applications/OptimalControl/tempopt/main.cpp | 2 ++ src/mesh/MultiLevelMesh.cpp | 15 +++++++++++++++ src/mesh/MultiLevelMesh.hpp | 16 +++++++++++++--- src/meshGencase/MultiLevelMeshTwo.hpp | 2 +- 14 files changed, 50 insertions(+), 19 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 730588fdd..4528d6a7b 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -112,7 +112,7 @@ currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); //MY EQUATION diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 313a313de..410245793 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -100,6 +100,8 @@ ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); + ml_msh.SetDomain(&mybox); + MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index 78fcf0324..3d4951542 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -161,7 +161,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); @@ -455,7 +455,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index 038784af5..81666bd3f 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -146,7 +146,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); @@ -369,7 +369,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 7fa355688..1025af9b5 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -143,7 +143,7 @@ using namespace femus; currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); @@ -415,7 +415,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 01e202737..4ee10265c 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -256,7 +256,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); //=======RETRIEVE the DOFS of the UNKNOWN QUANTITIES,i.e. MY EQUATION currelem.SetElDofsBc(); @@ -607,7 +607,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index 10e0bb5a1..eab209397 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -145,7 +145,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); @@ -372,7 +372,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/mhdopt/main.cpp b/applications/OptimalControl/mhdopt/main.cpp index d190e29e6..ae456be36 100644 --- a/applications/OptimalControl/mhdopt/main.cpp +++ b/applications/OptimalControl/mhdopt/main.cpp @@ -154,6 +154,8 @@ int main(int argc, char** argv) { ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); ml_msh.PrintInfo(); + ml_msh.SetDomain(&mybox); + MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 9ff033d21..7ba483c63 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -150,7 +150,7 @@ currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); //=======RETRIEVE the DOFS of the UNKNOWN QUANTITIES,i.e. MY EQUATION currelem.SetElDofsBc(); @@ -435,7 +435,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 24de1156c..312627607 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -183,7 +183,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); //MY EQUATION //the elements are, for every level: @@ -465,7 +465,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.SetMidpoint(); currelem.ConvertElemCoordsToMappingOrd(xyz); - currelem.TransformElemNodesToRef(ml_prob.GetMeshTwo().GetDomain(),&xyz_refbox._val_dofs[0]); + currelem.TransformElemNodesToRef(ml_prob._ml_msh->GetDomain(),&xyz_refbox._val_dofs[0]); currelem.SetElDofsBc(); diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 83c3255f8..137ce8e3a 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -130,6 +130,8 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ml_msh.SetWriter(XDMF); ml_msh.GetWriter()->write(files.GetOutputPath(),"biquadratic"); + ml_msh.SetDomain(&mybox); + MultiLevelSolution ml_sol(&ml_msh); ml_sol.AddSolution("FAKE",LAGRANGE,SECOND,0); diff --git a/src/mesh/MultiLevelMesh.cpp b/src/mesh/MultiLevelMesh.cpp index 305d7222e..0b0722090 100644 --- a/src/mesh/MultiLevelMesh.cpp +++ b/src/mesh/MultiLevelMesh.cpp @@ -23,6 +23,7 @@ #include "NumericVector.hpp" #include "FemusConfig.hpp" #include "MeshRefinement.hpp" +#include "Domain.hpp" //C++ include @@ -371,7 +372,21 @@ void MultiLevelMesh::PrintInfo() { return _level0[LEV_PICK]->GetDimension(); } +// ======================================================== + void MultiLevelMesh::SetDomain(Domain* domain_in) { + _domain = domain_in; + + return; + } + + // ======================================================== + Domain* MultiLevelMesh::GetDomain() const { + + return _domain; + + } + } //end namespace femus diff --git a/src/mesh/MultiLevelMesh.hpp b/src/mesh/MultiLevelMesh.hpp index 58fa1e480..553c33311 100644 --- a/src/mesh/MultiLevelMesh.hpp +++ b/src/mesh/MultiLevelMesh.hpp @@ -31,7 +31,7 @@ namespace femus { //------------------------------------------------------------------------------ class elem_type; class Mesh; - +class Domain; /** * This class is a black box container to handle multilevel mesh. @@ -112,6 +112,12 @@ class MultiLevelMesh { /** Get the dimension of the problem (1D, 2D, 3D) */ const unsigned GetDimension() const; + + /** Domain (optional) */ + Domain* GetDomain() const; + + /** Domain (optional) */ + void SetDomain(Domain* ); protected: @@ -119,17 +125,21 @@ class MultiLevelMesh { void BuildElemType(const char GaussOrder[]); - // data + /** */ unsigned short _gridn0, _gridr0; unsigned short _gridn, _gridr; + /** Array of mesh */ std::vector _level0; std::vector _level; + std::vector _finiteElementGeometryFlag; /** MultilevelMesh writer */ Writer* _writer; - + + /** Domain (optional) */ + Domain* _domain; }; diff --git a/src/meshGencase/MultiLevelMeshTwo.hpp b/src/meshGencase/MultiLevelMeshTwo.hpp index 7154dc278..4cc048375 100644 --- a/src/meshGencase/MultiLevelMeshTwo.hpp +++ b/src/meshGencase/MultiLevelMeshTwo.hpp @@ -106,7 +106,7 @@ class MultiLevelMeshTwo { public: // ====== DOMAIN SHAPE ( optional => pointer) - Domain* _domain; //TODO You must remember to ALLOCATE this POINTER BEFORE USING IT! + Domain* _domain; Domain* GetDomain() const; void SetDomain(Domain* ); From e7abaa6446e874c4fa770e835996a4202749f12a Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Sun, 8 Mar 2015 20:19:16 -0500 Subject: [PATCH 50/91] hdf5 parallel print fixed --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 2 +- src/solution/XDMFWriter.cpp | 168 +++++++++--------- 2 files changed, 84 insertions(+), 86 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index f4e2de9aa..63ffad318 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(VTK); + ml_sol.SetWriter(XDMF); std::vector mov_vars; mov_vars.push_back("DX"); diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 20ead3882..da4814ee4 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -102,7 +102,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const // Printing connectivity unsigned nel=0; - for(unsigned ig=0;ig<_gridn-1u;ig++) { + for(unsigned ig=0; ig<_gridn-1u; ig++) { nel+=( _ml_mesh->GetLevel(ig)->GetNumberOfElements() - _ml_mesh->GetLevel(ig)->el->GetRefinedElementNumber()); } nel+=_ml_mesh->GetLevel(_gridn-1u)->GetNumberOfElements(); @@ -110,7 +110,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const unsigned icount; unsigned el_dof_number = _ml_mesh->GetLevel(_gridn-1u)->el->GetElementDofNumber(0,index_nd); int * var_conn = new int [nel*el_dof_number]; - std::vector var_proc(nel); + std::vector< int > var_proc(nel); float *var_el_f = new float [nel]; float *var_nd_f = new float [nvt]; @@ -126,7 +126,7 @@ void XDMFWriter::write(const std::string output_path, const char order[], const std::ofstream fout; - if(_iproc!=0) { + if(_iproc != 0){ fout.rdbuf(); //redirect to dev_null } else { @@ -230,40 +230,40 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//->GetDofNumber(index_nd); NumericVector* mysol = NumericVector::build().release(); - NumericVector* mysol_ser = NumericVector::build().release(); - mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); + mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2) ); - mysol->localize(*mysol_ser); - if(_iproc==0) { - for (unsigned ii=0; ii mysol_ser; + mysol->localize_to_one(mysol_ser, 0); + + if(_iproc == 0){ + for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { unsigned varind_DXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[varind_DXDYDZ], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(varind_DXDYDZ))); - mysol->localize(*mysol_ser); - if(_iproc==0) { - for (unsigned ii=0; iilocalize_to_one(mysol_ser, 0); + if(_iproc == 0){ + for (unsigned ii=0; iiGetLevel(ig)->GetNumberOfElements(); iel++) { - if (_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)==0 || ig==_gridn-1u) { + for ( unsigned ig=_gridr-1u; ig<_gridn; ig++ ) { + for ( unsigned iel = 0; iel < _ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++ ) { + if ( ig == _gridn-1u || _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel) == 0) { int ndofs = _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index_nd); - for (unsigned j=0; jGetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; + unsigned jnode = _ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(iel,vtk_loc_conn)-1u; unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index_nd); var_conn[icount] = offset_conn + jnode_Metis; icount++; @@ -287,14 +287,15 @@ void XDMFWriter::write(const std::string output_path, const char order[], const } offset_conn += _ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs];//GetLevel(ig)->GetDofNumber(index_nd); } - - dimsf[0] = nel*el_dof_number ; dimsf[1] = 1; - dataspace = H5Screate_simple(2,dimsf, NULL); - dataset = H5Dcreate(file_id,"/CONNECTIVITY",H5T_NATIVE_INT, - dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_conn[0]); - H5Sclose(dataspace); - H5Dclose(dataset); + if(_iproc == 0){ + dimsf[0] = nel*el_dof_number ; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,"/CONNECTIVITY",H5T_NATIVE_INT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_conn[0]); + H5Sclose(dataspace); + H5Dclose(dataset); + } //------------------------------------------------------------------------------------------------------ @@ -312,14 +313,15 @@ void XDMFWriter::write(const std::string output_path, const char order[], const } } } - - dimsf[0] = nel; dimsf[1] = 1; - dataspace = H5Screate_simple(2,dimsf, NULL); - dataset = H5Dcreate(file_id,"/REGIONS",H5T_NATIVE_INT, - dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_conn); - H5Sclose(dataspace); - H5Dclose(dataset); + if(_iproc == 0){ + dimsf[0] = nel; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,"/REGIONS",H5T_NATIVE_INT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_conn); + H5Sclose(dataspace); + H5Dclose(dataset); + } // end print regions //------------------------------------------------------------------------------------------------------- @@ -337,14 +339,15 @@ void XDMFWriter::write(const std::string output_path, const char order[], const } } } - - dimsf[0] = nel; dimsf[1] = 1; - dataspace = H5Screate_simple(2,dimsf, NULL); - dataset = H5Dcreate(file_id,"/DOMAIN_PARTITIONS",H5T_NATIVE_INT, - dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_proc[0]); - H5Sclose(dataspace); - H5Dclose(dataset); + if(_iproc == 0){ + dimsf[0] = nel; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,"/DOMAIN_PARTITIONS",H5T_NATIVE_INT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_proc[0]); + H5Sclose(dataspace); + H5Dclose(dataset); + } // end print partitioning //------------------------------------------------------------------------------------------------------- @@ -358,28 +361,25 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nel_ig = _ml_mesh->GetLevel(ig)->GetNumberOfElements(); unsigned sol_size = _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->size(); - NumericVector* mysol_ser = NumericVector::build().release(); - mysol_ser->init(sol_size,sol_size,true,SERIAL); + vector < double > mysol_ser; for (unsigned ii=0; iiGetLevel(ig)->el->GetRefinedElementIndex(ii)) { - _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->localize(*mysol_ser); + _ml_sol->GetSolutionLevel(ig)->_Sol[indx]->localize_to_one(mysol_ser, 0); unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(indx)); - - var_el_f[icount]=(*mysol_ser)(iel_Metis); + var_el_f[icount]=mysol_ser[iel_Metis]; icount++; } } - delete mysol_ser; } - - dimsf[0] = nel; dimsf[1] = 1; - dataspace = H5Screate_simple(2,dimsf, NULL); - dataset = H5Dcreate(file_id,_ml_sol->GetSolutionName(indx),H5T_NATIVE_FLOAT, - dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_el_f[0]); - H5Sclose(dataspace); - H5Dclose(dataset); - + if(_iproc == 0){ + dimsf[0] = nel; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,_ml_sol->GetSolutionName(indx),H5T_NATIVE_FLOAT, + dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,&var_el_f[0]); + H5Sclose(dataspace); + H5Dclose(dataset); + } } } @@ -391,27 +391,25 @@ void XDMFWriter::write(const std::string output_path, const char order[], const for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; NumericVector* mysol = NumericVector::build().release(); - NumericVector* mysol_ser = NumericVector::build().release(); - mysol_ser->init(nvt_ig,nvt_ig,true,SERIAL); mysol->init(nvt_ig,_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); mysol->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd, _ml_sol->GetSolutionType(indx)) ); - mysol->localize(*mysol_ser); - if(_iproc==0) { - for (unsigned ii=0; ii mysol_ser; + mysol->localize_to_one(mysol_ser, 0); + if(_iproc == 0){ + for (unsigned ii=0; iiGetSolutionName(indx),H5T_NATIVE_FLOAT, + if(_iproc == 0){ + dimsf[0] = nvt; dimsf[1] = 1; + dataspace = H5Screate_simple(2,dimsf, NULL); + dataset = H5Dcreate(file_id,_ml_sol->GetSolutionName(indx),H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_nd_f); - H5Sclose(dataspace); - H5Dclose(dataset); + status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL,H5P_DEFAULT,var_nd_f); + H5Sclose(dataspace); + H5Dclose(dataset); + } } } //------------------------------------------------------------------------------------------------------- @@ -1153,8 +1151,8 @@ void XDMFWriter::read_system_solutions(const std::string namefile, const MultiLe double Irefval = 1./eqn->_refvalue[ivar]; // units // storing ivar variables (in parallell) - for (int iel=0;iel < mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels] - -mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels-1]; iel++) { + for (int iel=0; iel < mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels] + -mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels-1]; iel++) { uint elem_gidx=(iel+mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels-1])*NVE[ mesh->_geomelem_flag[mesh->get_dim()-1] ][BIQUADR_FE]; for (uint i=0; i_el_map[VV][elem_gidx+i]; // the global node From 28162120bb12166c0d03cee5f5be92108544da24 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 21:44:51 -0500 Subject: [PATCH 51/91] Removed Mesh tag in config files --- applications/OptimalControl/fe_test/EqnT.cpp | 6 ++-- .../OptimalControl/fe_test/TempQuantities.cpp | 2 +- .../fe_test/input/femus_conf.in | 13 ------- applications/OptimalControl/fe_test/main.cpp | 8 +++-- applications/OptimalControl/mhdopt/EqnMHD.cpp | 10 +++--- .../OptimalControl/mhdopt/EqnMHDAD.cpp | 11 +++--- .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 10 +++--- applications/OptimalControl/mhdopt/EqnNS.cpp | 10 +++--- .../OptimalControl/mhdopt/EqnNSAD.cpp | 16 ++++----- .../OptimalControl/mhdopt/OptLoop.cpp | 21 +++++------- .../OptimalControl/mhdopt/OptLoop.hpp | 2 +- .../OptimalControl/mhdopt/OptQuantities.cpp | 22 ++++++------ .../OptimalControl/mhdopt/input/femus_conf.in | 13 ------- applications/OptimalControl/mhdopt/main.cpp | 8 +++-- applications/OptimalControl/tempopt/EqnNS.cpp | 11 +++--- applications/OptimalControl/tempopt/EqnT.cpp | 12 +++---- .../OptimalControl/tempopt/OptLoop.cpp | 34 ++++++++----------- .../OptimalControl/tempopt/OptLoop.hpp | 4 +-- .../OptimalControl/tempopt/TempQuantities.cpp | 14 ++++---- .../tempopt/input/femus_conf.in | 12 ------- applications/OptimalControl/tempopt/main.cpp | 8 +++-- src/enums/FETypeEnum.hpp | 3 +- src/equations/BoundaryConditions.cpp | 2 +- src/equations/DofMap.cpp | 4 +-- src/meshGencase/GenCase.cpp | 4 +-- src/meshGencase/GenCase.hpp | 2 +- src/meshGencase/MultiLevelMeshTwo.cpp | 19 +++++------ src/meshGencase/MultiLevelMeshTwo.hpp | 7 ++-- src/solution/XDMFWriter.cpp | 4 +-- src/utils/FemusDefault.hpp | 4 +-- src/utils/Math.hpp | 5 +-- 31 files changed, 117 insertions(+), 184 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 4528d6a7b..507bd8be3 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -35,8 +35,6 @@ //======== ELEMENT MAPPING ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); my_system._A[Level]->zero(); my_system._b[Level]->zero(); @@ -93,14 +91,14 @@ //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //no quantity xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER;; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/fe_test/TempQuantities.cpp b/applications/OptimalControl/fe_test/TempQuantities.cpp index 730e33973..5417eb89b 100644 --- a/applications/OptimalControl/fe_test/TempQuantities.cpp +++ b/applications/OptimalControl/fe_test/TempQuantities.cpp @@ -66,7 +66,7 @@ void Temperature::heatflux_txyz(const double /*t*/, const double* /*xyz*/, doubl // T' and its adjoint must be Dirichlet homogeneous everywhere on the boundary, by definition. - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); diff --git a/applications/OptimalControl/fe_test/input/femus_conf.in b/applications/OptimalControl/fe_test/input/femus_conf.in index 4ce703fe7..e7a648d38 100644 --- a/applications/OptimalControl/fe_test/input/femus_conf.in +++ b/applications/OptimalControl/fe_test/input/femus_conf.in @@ -1,17 +1,4 @@ - -# double # mesh file consistency - -nolevels 3 -meshql 1 # ------------- # for THE APP # =MESH CONSISTENCY=== # ==== in library routines # depends on the kind of Mesh that is used# depends basically on the Boundary Mesh# 0=QUADRATIC Mapping 1=LINEAR Mapping -mesh_ord 0 # ==== both for the App and for Gencase ====== # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh should provide this info# 0=QUADRATIC GeomElements (Quad8,Quad9,Hex27,...)# 1=LINEAR GeomElements (Quad4,Hex8,...) -geomel_type 3 # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh should provide this info -dimension 2 -bdry_toll 0.0000001 # ==== not in library routines, but library-type - - - - # double # mesh file consistency diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 410245793..427fb288f 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -58,9 +58,11 @@ const double Lref = physics_map.get("Lref"); // reference L // ======= Mesh ===== - FemusInputParser mesh_map("Mesh",files.GetOutputPath()); + const unsigned NoLevels = 3; + const unsigned dim = 2; + const GeomElType geomel_type = QUAD; - GenCase mesh(mesh_map,""); + GenCase mesh(NoLevels,dim,geomel_type,""); mesh.SetLref(1.); // ======= MyDomainShape (optional, implemented as child of Domain) ==================== @@ -97,7 +99,7 @@ // ====== Start new main ================================= MultiLevelMesh ml_msh; ml_msh.GenerateCoarseBoxMesh(8,8,0,0,1,0,1,0,1,QUAD9,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"seventh"); - ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); + ml_msh.RefineMesh(NoLevels,NoLevels,NULL); ml_msh.PrintInfo(); ml_msh.SetDomain(&mybox); diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index 3d4951542..fb0cd73ee 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -50,8 +50,6 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= my_system._A[Level]->zero(); my_system._b[Level]->zero(); @@ -126,14 +124,14 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //================== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -414,14 +412,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //================== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index 81666bd3f..d0b08c9d1 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -46,9 +46,6 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - my_system._A[Level]->zero(); my_system._b[Level]->zero(); @@ -92,14 +89,14 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -345,14 +342,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 1025af9b5..09f5805b2 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -39,8 +39,6 @@ using namespace femus; //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= //====== Physics double IRem = 1./ml_prob.GetInputParser().get("Rem"); @@ -98,14 +96,14 @@ using namespace femus; //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -394,14 +392,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= //DOMAIN MAPPING7 CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 4ee10265c..10f039b58 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -136,8 +136,6 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); //========== GEOMETRIC ELEMENT ======== const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= my_system._A[Level]->zero(); my_system._b[Level]->zero(); @@ -193,14 +191,14 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -581,14 +579,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index eab209397..aaa817a70 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -46,9 +46,6 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); // //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - my_system._A[Level]->zero(); my_system._b[Level]->zero(); @@ -91,14 +88,14 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -178,7 +175,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); //======= ///optimal control xyz_refbox.SetElemAverage(); - int el_flagdom = ElFlagControl(xyz_refbox._el_average,&ml_prob.GetMeshTwo()); + int el_flagdom = ElFlagControl(xyz_refbox._el_average,ml_prob._ml_msh); //======= @@ -188,7 +185,8 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); //=======here starts the "COMMON SHAPE PART"================== for (uint fe = 0; fe < QL; fe++) { currgp.SetPhiElDofsFEVB_g (fe,qp); - currgp.SetDPhiDxezetaElDofsFEVB_g (fe,qp); } + currgp.SetDPhiDxezetaElDofsFEVB_g (fe,qp); +} const double det = dt*currgp.JacVectVV_g(xyz); //InvJac: is the same for both QQ and LL! const double dtxJxW_g = det*ml_prob.GetQrule(currelem.GetDim()).GetGaussWeight(qp); @@ -351,14 +349,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 8152bdc64..7eafa5c24 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -521,22 +521,19 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S const uint myproc = mesh->_iproc; // geometry ----- const uint space_dim = mesh->get_dim(); - const uint mesh_ord = (int) mesh->GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) mesh->GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - -//======Functions in the integrand ============ + //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = DIMENSION; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; xyz_refbox.Allocate(); @@ -570,7 +567,7 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S //======= xyz_refbox.SetElemAverage(); - int el_flagdom = ElFlagControl(xyz_refbox._el_average,mesh); + int el_flagdom = ElFlagControl(xyz_refbox._el_average,eqn->GetMLProb()._ml_msh); //======= if ( Vel._eqnptr != NULL ) Vel.GetElemDofs(); @@ -616,22 +613,22 @@ for (uint j=0; j el_xm, const MultiLevelMeshTwo* mesh) { + int ElFlagControl(const std::vector el_xm, const MultiLevelMesh* mesh) { Box* box= static_cast(mesh->GetDomain()); int el_flagdom=0; -///optimal control - #if DIMENSION==2 + if (mesh->GetDimension() == 2) { //flag on the controlled region 2D if ( el_xm[0] > 0.25*(box->_le[0] - box->_lb[0]) && el_xm[0] < 0.75*(box->_le[0] - box->_lb[0]) && el_xm[1] > 0.75*(box->_le[1] - box->_lb[1]) ) { el_flagdom=1; } - #else + } + else if (mesh->GetDimension() == 3) { //flag on the controlled region 3D if ( el_xm[0] > 0.25*(box->_le[0] - box->_lb[0]) && el_xm[0] < 0.75*(box->_le[0] - box->_lb[0]) @@ -640,7 +637,7 @@ for (uint j=0; j_le[2] - box->_lb[2]) ) { el_flagdom=1; } - #endif + } return el_flagdom; } diff --git a/applications/OptimalControl/mhdopt/OptLoop.hpp b/applications/OptimalControl/mhdopt/OptLoop.hpp index 1f0d954c0..4ead0870c 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.hpp +++ b/applications/OptimalControl/mhdopt/OptLoop.hpp @@ -37,7 +37,7 @@ class OptLoop : public TimeLoop { //prototypes that can even stay outside of a class double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const SystemTwo* eqn); - int ElFlagControl(const std::vector el_xm, const MultiLevelMeshTwo* mesh); + int ElFlagControl(const std::vector el_xm, const MultiLevelMesh* mesh); diff --git a/applications/OptimalControl/mhdopt/OptQuantities.cpp b/applications/OptimalControl/mhdopt/OptQuantities.cpp index dd185d91c..fc6d81aa9 100644 --- a/applications/OptimalControl/mhdopt/OptQuantities.cpp +++ b/applications/OptimalControl/mhdopt/OptQuantities.cpp @@ -636,7 +636,7 @@ void MagnFieldHomAdj::Function_txyz(const double t, const double* xp,double* fun void Velocity::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -729,7 +729,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void Pressure::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -807,7 +807,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void MagnFieldHom::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -900,7 +900,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void MagnFieldHomAdj::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -992,7 +992,7 @@ if ( x_rotshift[2] > -bdry_toll && x_rotshift[2] < bdry_toll ) { //current void MagnFieldHomLagMult::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1066,7 +1066,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void MagnFieldHomLagMultAdj::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1140,7 +1140,7 @@ if ( x_rotshift[2] > -bdry_toll && x_rotshift[2] < bdry_toll ) { //current void VelocityAdj::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1231,7 +1231,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void PressureAdj::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1307,7 +1307,7 @@ if (( x_rotshift[1]) > -bdry_toll && ( x_rotshift[1]) < bdry_toll) { //bottom void MagnFieldExt::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1407,7 +1407,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void MagnFieldExtLagMult::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -1487,7 +1487,7 @@ void Velocity::initialize_xyz(const double* xp, std::vector< double >& value) co const double pref = _qtymap.GetInputParser()->get("pref"); const double udes = _qtymap.GetInputParser()->get("udes"); - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); diff --git a/applications/OptimalControl/mhdopt/input/femus_conf.in b/applications/OptimalControl/mhdopt/input/femus_conf.in index da37634c8..a16338c19 100644 --- a/applications/OptimalControl/mhdopt/input/femus_conf.in +++ b/applications/OptimalControl/mhdopt/input/femus_conf.in @@ -1,17 +1,4 @@ - -# double - -nolevels 1 -meshql 1 # ------------- # for THE APP # =MESH CONSISTENCY=== # ==== in library routines # USER must provide this info explicitly # depends on the kind of Mesh that is used# depends basically on the Boundary Mesh# 0=QUADRATIC Mapping 1=LINEAR Mapping -mesh_ord 0 # =MESH CONSISTENCY=== # ==== in library routines # the mesh file should provide this info# 0=BIQUADRATIC # 1=LINEAR -geomel_type 0 # =MESH CONSISTENCY=== # the mesh file should provide this info -dimension 3 # =MESH CONSISTENCY=== -bdry_toll 0.0000001 # ==== - - - - # double diff --git a/applications/OptimalControl/mhdopt/main.cpp b/applications/OptimalControl/mhdopt/main.cpp index ae456be36..6fb9a7b7b 100644 --- a/applications/OptimalControl/mhdopt/main.cpp +++ b/applications/OptimalControl/mhdopt/main.cpp @@ -84,8 +84,10 @@ int main(int argc, char** argv) { const double _We = (Uref*Uref*Lref*rhof)/sigma; physics_map.set("We",_We); // ======= Mesh ===== - FemusInputParser mesh_map("Mesh",files.GetOutputPath()); - GenCase mesh(mesh_map,"straightQ3D2x2x2ZERO.gam"); + const unsigned NoLevels = 1; + const unsigned dim = 3; + const GeomElType geomel_type = HEX; + GenCase mesh(NoLevels,dim,geomel_type,"straightQ3D2x2x2ZERO.gam"); mesh.SetLref(1.); // ======= MyDomainShape (optional, implemented as child of Domain) ==================== @@ -151,7 +153,7 @@ int main(int argc, char** argv) { MultiLevelMesh ml_msh; ml_msh.GenerateCoarseBoxMesh(8,8,8,0,1,0,1,0,1,HEX27,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"seventh"); - ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); + ml_msh.RefineMesh(NoLevels,NoLevels,NULL); ml_msh.PrintInfo(); ml_msh.SetDomain(&mybox); diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 7ba483c63..4f3c0371e 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -45,9 +45,6 @@ //========== GEOMETRIC ELEMENT ======== const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= - //=======density and viscosity=================== const double rhof = ml_prob.GetInputParser().get("rho0"); @@ -119,14 +116,14 @@ //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //domain xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -413,14 +410,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //domain xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 312627607..d033f16f1 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -91,8 +91,6 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri //======== ELEMENT MAPPING ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - const uint meshql = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("meshql"); - const uint mesh_ord = (int) ml_prob.GetMeshTwo().GetRuntimeMap().get("mesh_ord"); //====== reference values ======================== const double IRe = 1./ml_prob.GetInputParser().get("Re"); @@ -149,14 +147,14 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //no quantity xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -209,7 +207,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri xyz_refbox.SetElemAverage(); -int domain_flag = ElFlagControl(xyz_refbox._el_average,&ml_prob.GetMeshTwo()); +int domain_flag = ElFlagControl(xyz_refbox._el_average,ml_prob._ml_msh); //==================== //===== FILL the DOFS of the EXTERNAL QUANTITIES: you must assure that for every Vect the quantity is set correctly @@ -438,14 +436,14 @@ for (uint fe = 0; fe < QL; fe++) { //========= //DOMAIN MAPPING CurrentQuantity xyz(currgp); //no quantity xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //==================Quadratic domain, auxiliary, must be QUADRATIC!!! ========== CurrentQuantity xyz_refbox(currgp); //no quantity xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = myel->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/applications/OptimalControl/tempopt/OptLoop.cpp b/applications/OptimalControl/tempopt/OptLoop.cpp index bf82cf514..7bd2dc4bd 100644 --- a/applications/OptimalControl/tempopt/OptLoop.cpp +++ b/applications/OptimalControl/tempopt/OptLoop.cpp @@ -18,7 +18,7 @@ namespace femus { OptLoop::OptLoop(Files& files_in, const FemusInputParser & map_in): TimeLoop(files_in, map_in) { } //================= - void OptLoop::optimization_loop(MultiLevelProblem & eqmap_in) { + void OptLoop::optimization_loop(MultiLevelProblem & ml_prob) { // parameters int print_step = _timemap.get("printstep"); @@ -43,14 +43,14 @@ namespace femus { const uint delta_t_step = curr_step - _t_idx_in; // time step for each system, without printing (good) - OneTimestepEqnLoop(delta_t_step,eqmap_in); + OneTimestepEqnLoop(delta_t_step,ml_prob); #if DEFAULT_PRINT_TIME==1 std::clock_t end_time=std::clock(); #endif // print solution - if (delta_t_step%print_step == 0) XDMFWriter::PrintSolLinear(_files.GetOutputPath(),curr_step,curr_time,eqmap_in); //print sol.N.h5 and sol.N.xmf + if (delta_t_step%print_step == 0) XDMFWriter::PrintSolLinear(_files.GetOutputPath(),curr_step,curr_time,ml_prob); //print sol.N.h5 and sol.N.xmf #if DEFAULT_PRINT_TIME==1 @@ -61,13 +61,13 @@ namespace femus { #endif //=====functional evaluations======= - SystemTwo & eqnT = eqmap_in.get_system("Eqn_T"); + SystemTwo & eqnT = ml_prob.get_system("Eqn_T"); double J = 0.; -J = ComputeIntegral ( eqmap_in.GetMeshTwo()._NoLevels - 1,&eqmap_in.GetMeshTwo(),&eqnT,_files.GetOutputTime()); -J = ComputeNormControl ( eqmap_in.GetMeshTwo()._NoLevels - 1,&eqmap_in.GetMeshTwo(),&eqnT,0 ); -J = ComputeNormControl ( eqmap_in.GetMeshTwo()._NoLevels - 1,&eqmap_in.GetMeshTwo(),&eqnT,1 ); +J = ComputeIntegral ( ml_prob.GetMeshTwo()._NoLevels - 1,&ml_prob.GetMeshTwo(),&eqnT,_files.GetOutputTime()); +J = ComputeNormControl ( ml_prob.GetMeshTwo()._NoLevels - 1,&ml_prob.GetMeshTwo(),&eqnT,0 ); +J = ComputeNormControl ( ml_prob.GetMeshTwo()._NoLevels - 1,&ml_prob.GetMeshTwo(),&eqnT,1 ); //=====functional evaluations ======= @@ -85,8 +85,6 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S //====== processor index const uint myproc = mesh->_iproc; const uint space_dim = mesh->get_dim(); - const uint mesh_ord = (int) mesh->GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) mesh->GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= const uint mesh_vb = VV; @@ -114,14 +112,14 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; xyz_refbox.Allocate(); @@ -144,7 +142,7 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S // =============== xyz_refbox.SetElemAverage(); - int el_flagdom = ElFlagControl(xyz_refbox._el_average,mesh); + int el_flagdom = ElFlagControl(xyz_refbox._el_average,eqn->GetMLProb()._ml_msh); //==================== if ( Tempold._eqnptr != NULL ) Tempold.GetElemDofs(); @@ -223,8 +221,6 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons // processor index const uint myproc = mesh->_iproc; const uint space_dim = mesh->get_dim(); - const uint mesh_ord = (int) mesh->GetRuntimeMap().get("mesh_ord"); - const uint meshql = (int) mesh->GetRuntimeMap().get("meshql"); //======== ELEMENT MAPPING ======= const uint mesh_vb = VV; @@ -242,14 +238,14 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = space_dim; - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); //========== Quadratic domain, auxiliary CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; - xyz_refbox._FEord = mesh_ord; //this must be QUADRATIC!!! + xyz_refbox._FEord = MESH_ORDER; xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; xyz_refbox.Allocate(); @@ -320,13 +316,13 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons ///AAA questa funzione NON lavora se tu fai solo DUE SUDDIVISIONI PER LATO e nolevels=1 !!! - int ElFlagControl(const std::vector el_xm, const MultiLevelMeshTwo* mesh) { + int ElFlagControl(const std::vector el_xm, const MultiLevelMesh* mesh) { Box* box= static_cast(mesh->GetDomain()); int el_flagdom=0; - if (mesh->get_dim() == 2) { + if (mesh->GetDimension() == 2) { //============== OUTFLOW // if ( el_xm[0] > 0.25*(box->_le[0] - box->_lb[0]) // && el_xm[0] < 0.75*(box->_le[0] - box->_lb[0]) @@ -356,7 +352,7 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons // } } - else if (mesh->get_dim() == 3) { + else if (mesh->GetDimension() == 3) { if ( el_xm[0] > 0.25*(box->_le[0] - box->_lb[0]) && el_xm[0] < 0.75*(box->_le[0] - box->_lb[0]) diff --git a/applications/OptimalControl/tempopt/OptLoop.hpp b/applications/OptimalControl/tempopt/OptLoop.hpp index cac1feb65..368b9dfa9 100644 --- a/applications/OptimalControl/tempopt/OptLoop.hpp +++ b/applications/OptimalControl/tempopt/OptLoop.hpp @@ -30,11 +30,11 @@ void optimization_loop( MultiLevelProblem & e_map_in ); }; - double ComputeIntegral (const uint Level,const MultiLevelMeshTwo* mesh, const SystemTwo* eqn, const std::string output_time); + double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const SystemTwo* eqn, const std::string output_time); double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, const SystemTwo* eqn, const uint reg_ord ); - int ElFlagControl(const std::vector el_xm, const MultiLevelMeshTwo* mesh); + int ElFlagControl(const std::vector el_xm, const MultiLevelMesh* mesh); } //end namespace femus diff --git a/applications/OptimalControl/tempopt/TempQuantities.cpp b/applications/OptimalControl/tempopt/TempQuantities.cpp index a894e3079..7b88164c5 100644 --- a/applications/OptimalControl/tempopt/TempQuantities.cpp +++ b/applications/OptimalControl/tempopt/TempQuantities.cpp @@ -284,7 +284,7 @@ void Temperature::heatflux_txyz(const double /*t*/, const double* /*xyz*/, doubl void Velocity::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -383,7 +383,7 @@ if (_qtymap.GetMeshTwo()->get_dim() == 2) { void Pressure::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -449,7 +449,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); // T' and its adjoint must be Dirichlet homogeneous everywhere on the boundary, by definition. - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -506,7 +506,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); // T' and its adjoint must be Dirichlet homogeneous everywhere on the boundary, by definition. - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -571,7 +571,7 @@ Box* box = static_cast(_qtymap.GetMeshTwo()->GetDomain()); void TempAdj::bc_flag_txyz(const double t, const double* xp, std::vector & bc_flag) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -660,7 +660,7 @@ void TempAdj::initialize_xyz(const double* xp, std::vector< double >& value) con void TempLift::initialize_xyz(const double* xp, std::vector< double >& value) const { - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); @@ -680,7 +680,7 @@ void Velocity::initialize_xyz(const double* xp, std::vector< double >& value) co //====== Physics const double Uref = _qtymap.GetInputParser()->get("Uref"); - const double bdry_toll = _qtymap.GetMeshTwo()->GetRuntimeMap().get("bdry_toll"); + const double bdry_toll = DEFAULT_BDRY_TOLL; Box* box= static_cast(_qtymap.GetMeshTwo()->GetDomain()); diff --git a/applications/OptimalControl/tempopt/input/femus_conf.in b/applications/OptimalControl/tempopt/input/femus_conf.in index ee0b86acf..bd5b66a6e 100644 --- a/applications/OptimalControl/tempopt/input/femus_conf.in +++ b/applications/OptimalControl/tempopt/input/femus_conf.in @@ -1,16 +1,4 @@ - -# double # mesh file consistency - -nolevels 3 -meshql 1 # ------------- # for THE APP # =MESH CONSISTENCY=== # ==== in library routines # depends on the kind of Mesh that is used# depends basically on the Boundary Mesh# 0=QUADRATIC Mapping 1=LINEAR Mapping -mesh_ord 0 # ==== both for the App and for Gencase ====== # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh should provide this info# 0=QUADRATIC GeomElements (Quad8,Quad9,Hex27,...)# 1=LINEAR GeomElements (Quad4,Hex8,...) -geomel_type 3 # ==== DO IT ONLY FOR Gencase ====== # GAMBIT mesh should provide this info -dimension 2 -bdry_toll 0.0000001 # ==== not in library routines, but library-type - - - # double # mesh file consistency diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 137ce8e3a..1505c356e 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -71,8 +71,10 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr const double _Pr = muf/rhof; physics_map.set("Pr",_Pr); // ======= Mesh ===== - FemusInputParser mesh_map("Mesh",files.GetOutputPath()); - GenCase mesh(mesh_map,"inclQ2D2x2.gam"); + const unsigned NoLevels = 3; + const unsigned dim = 2; + const GeomElType geomel_type = QUAD; + GenCase mesh(NoLevels,dim,geomel_type,"inclQ2D2x2.gam"); mesh.SetLref(1.); // ======= MyDomainShape (optional, implemented as child of Domain) ==================== @@ -124,7 +126,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr MultiLevelMesh ml_msh; ml_msh.GenerateCoarseBoxMesh(8,8,0,0,1,0,2,0,0,QUAD9,"fifth"); // ml_msh.GenerateCoarseBoxMesh(numelemx,numelemy,numelemz,xa,xb,ya,yb,za,zb,elemtype,"fifth"); - ml_msh.RefineMesh(mesh_map.get("nolevels"),mesh_map.get("nolevels"),NULL); + ml_msh.RefineMesh(NoLevels,NoLevels,NULL); ml_msh.PrintInfo(); ml_msh.SetWriter(XDMF); diff --git a/src/enums/FETypeEnum.hpp b/src/enums/FETypeEnum.hpp index a6f145eb3..e95386c7e 100644 --- a/src/enums/FETypeEnum.hpp +++ b/src/enums/FETypeEnum.hpp @@ -14,6 +14,7 @@ enum FEType {QQ=0, LL, KK }; #define NFE_FAMS 5 -#define ZERO_ELEM 0 +#define MESH_MAPPING_FE 1 //linear +#define MESH_ORDER 0 //biq #endif \ No newline at end of file diff --git a/src/equations/BoundaryConditions.cpp b/src/equations/BoundaryConditions.cpp index c39bc56ab..d94e970cb 100644 --- a/src/equations/BoundaryConditions.cpp +++ b/src/equations/BoundaryConditions.cpp @@ -859,7 +859,7 @@ return; // // // // // void BoundaryConditions::elem_bc_read(const double el_xm[],int& surf_id, double value[],int el_flag[]) const { // // // // // //el_xm[] is the NON-DIMENSIONAL node coordinate // lb,le are NONDIMENSIONALIZED // // // // // -// // // // // const double bdry_toll = _dofmap->_mesh.GetRuntimeMap().get("bdry_toll"); +// // // // // const double bdry_toll = DEFAULT_BDRY_TOLL; // // // // // // // // // // // // // // // diff --git a/src/equations/DofMap.cpp b/src/equations/DofMap.cpp index 1911a150d..fac532a9f 100644 --- a/src/equations/DofMap.cpp +++ b/src/equations/DofMap.cpp @@ -43,9 +43,7 @@ void DofMap::initNVars() { } -//CHECK LINEAR MESH WITH QUADRATIC SHAPES - const uint mesh_ord = (int) _mesh.GetRuntimeMap().get("mesh_ord"); - if (mesh_ord == 1 && _nvars[QQ]>0) { + if (MESH_ORDER == 1 && _nvars[QQ]>0) { std::cout << "Can't handle linear mesh with quadratic variables, do a quadratic mesh" << std::endl; abort(); } diff --git a/src/meshGencase/GenCase.cpp b/src/meshGencase/GenCase.cpp index 17346ace2..6e993ae0a 100644 --- a/src/meshGencase/GenCase.cpp +++ b/src/meshGencase/GenCase.cpp @@ -34,8 +34,8 @@ using namespace libMesh; namespace femus { // ======================================================== -GenCase::GenCase(const FemusInputParser & map_in, const std::string mesh_file_in) - : MultiLevelMeshTwo(map_in,mesh_file_in) +GenCase::GenCase(const unsigned nolevels, const unsigned dim, const GeomElType geomel_type, const std::string mesh_file_in) + : MultiLevelMeshTwo(nolevels,dim,geomel_type,mesh_file_in) { _feelems.resize(QL); diff --git a/src/meshGencase/GenCase.hpp b/src/meshGencase/GenCase.hpp index f9b463756..140ed3d68 100644 --- a/src/meshGencase/GenCase.hpp +++ b/src/meshGencase/GenCase.hpp @@ -32,7 +32,7 @@ class GenCase : public MultiLevelMeshTwo { public: - GenCase(const FemusInputParser & map_in, const std::string mesh_file); + GenCase(const unsigned nolevels, const unsigned dim, const GeomElType geomel_type, const std::string mesh_file); ~GenCase(); void ElemChildToFather(); diff --git a/src/meshGencase/MultiLevelMeshTwo.cpp b/src/meshGencase/MultiLevelMeshTwo.cpp index b962a1be5..c6fb981d2 100644 --- a/src/meshGencase/MultiLevelMeshTwo.cpp +++ b/src/meshGencase/MultiLevelMeshTwo.cpp @@ -36,12 +36,10 @@ namespace femus { // ======================================================== -MultiLevelMeshTwo::MultiLevelMeshTwo (const FemusInputParser& map_in, const std::string mesh_file_in) : - _mesh_rtmap(map_in), - _dim(map_in.get("dimension")), - _mesh_order(map_in.get("mesh_ord")) { +MultiLevelMeshTwo::MultiLevelMeshTwo (const unsigned nolevels, const unsigned dim, const GeomElType geomel_type, const std::string mesh_file_in) : + _dim(dim) { - _eltype_flag[VV]= map_in.get("geomel_type"); + _eltype_flag[VV]= geomel_type; _mesh_file.assign(mesh_file_in); @@ -90,22 +88,21 @@ MultiLevelMeshTwo::MultiLevelMeshTwo (const FemusInputParser& map_in, co } else { std::cout << "Geom Elem not supported" << std::endl; abort(); } -if ( _dim == 3 && (map_in.get("geomel_type") != HEX && map_in.get("geomel_type") != TET && map_in.get("geomel_type") != WEDGE) ) +if ( _dim == 3 && (geomel_type != HEX && geomel_type != TET && geomel_type != WEDGE) ) { std::cout << "Inconsistent input file" << std::endl; abort(); } -if ( _dim == 2 && (map_in.get("geomel_type") != QUAD && map_in.get("geomel_type") != TRI ) ) +if ( _dim == 2 && (geomel_type != QUAD && geomel_type != TRI ) ) { std::cout << "Inconsistent input file" << std::endl; abort(); } -if ( _dim == 1 && (map_in.get("geomel_type") != LINE ) ) +if ( _dim == 1 && (geomel_type != LINE ) ) { std::cout << "Inconsistent input file" << std::endl; abort(); } _iproc = paral::get_rank(); _NoSubdom = paral::get_size(); - _NoLevels = GetRuntimeMap().get("nolevels"); + _NoLevels = nolevels; - const uint mesh_ord = (uint) map_in.get("mesh_ord"); - if (mesh_ord != 0) { + if (MESH_ORDER != QQ) { std::cout << "Linear mesh not yet implemented" << std::endl; abort(); } diff --git a/src/meshGencase/MultiLevelMeshTwo.hpp b/src/meshGencase/MultiLevelMeshTwo.hpp index 4cc048375..72da5fbba 100644 --- a/src/meshGencase/MultiLevelMeshTwo.hpp +++ b/src/meshGencase/MultiLevelMeshTwo.hpp @@ -32,6 +32,7 @@ #include "ElemSto.hpp" #include "VBTypeEnum.hpp" #include "FETypeEnum.hpp" +#include "GeomElTypeEnum.hpp" namespace femus { @@ -46,8 +47,7 @@ class MultiLevelMeshTwo { public: //===== Constructors/ Destructor =========== - MultiLevelMeshTwo (const FemusInputParser& map_in, const std::string mesh_file_in); -// ~MultiLevelMeshTwo (); + MultiLevelMeshTwo (const unsigned nolevels, const unsigned dim, const GeomElType geomel_type, const std::string mesh_file_in); void clear (); //======= mesh generation functions ==== @@ -62,7 +62,6 @@ class MultiLevelMeshTwo { //attributes ************************************ const uint _dim; ///< spatial dimension - const uint _mesh_order; // ==== PARALLEL === uint _iproc; /// current subdomain uint _NoSubdom; /// Number of subdomains (subdomain P) @@ -113,7 +112,6 @@ class MultiLevelMeshTwo { //get functions inline const double get_Lref() const {return _Lref;} inline const uint get_dim() const {return _dim;} - inline const FemusInputParser GetRuntimeMap() const { return _mesh_rtmap; } //set functions inline void SetLref(const double lref_in) { _Lref = lref_in; } @@ -127,7 +125,6 @@ class MultiLevelMeshTwo { protected: - const FemusInputParser & _mesh_rtmap; std::string _mesh_file; //mesh file name from the mesh generator private: diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index e1c2039f9..e422b53f1 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -1942,7 +1942,7 @@ void XDMFWriter::ReadMeshAndNondimensionalizeBiquadraticHDF5(const std::string o //I'll put a check if (mesh._dim != topdata[0] ) {std::cout << "MultiLevelMeshTwo::read_c. Mismatch: the mesh dimension is " << mesh._dim - << " while the dimension in the configuration file is " << mesh.GetRuntimeMap().get("dimension") + << " while the dimension in the configuration file is " << mesh.get_dim() << ". Recompile either gencase or your application appropriately" << std::endl;abort();} //it seems like it doesn't print to file if I don't put the endline "<< std::endl". //Also, "\n" seems to have no effect, "<< std::endl" must be used @@ -2303,7 +2303,7 @@ void XDMFWriter::PrintMeshBiquadraticHDF5(const std::string output_path, const M // ======================================================================= -// For every matrix, compute "dimension", "position", "len", "offlen" +// For every matrix, compute dimension, position, len, offlen // this function concerns a COUPLE of finite element families, that's it // fe_row = rows // fe_col = columns diff --git a/src/utils/FemusDefault.hpp b/src/utils/FemusDefault.hpp index a13e6d9f8..0e0b06a31 100644 --- a/src/utils/FemusDefault.hpp +++ b/src/utils/FemusDefault.hpp @@ -59,6 +59,7 @@ //********************************************* //********** BOUNDARY CONDITIONS ************** #define DEFAULT_BC_FLAG 1 //=0 if you put a function on the RHS //you also have to comment the bc_read +#define DEFAULT_BDRY_TOLL 0.0000001 //********************************************* //**************************************** @@ -75,7 +76,6 @@ #define DEFAULT_EPS_LSOLV_C 1.e-20//1.e-10 #define DEFAULT_EPS_PREPOST 1.e-20 #define DEFAULT_MAXITS_LSOLV 40 -// #define DEFAULT_MAXITS_LSOLV_C 40 //it's not there now!!! is it required a special one for the coarsest? #define DEFAULT_MG_GAMMA 1 #define DEFAULT_NC_PRE 8 //16 #define DEFAULT_NC_COARSE 40 @@ -84,6 +84,6 @@ //************************************************************************************** //************************************************************************************** -#define DEFAULT_NDIGITS 4 +#define DEFAULT_NDIGITS 4 //n of digits for the timestep printing #endif \ No newline at end of file diff --git a/src/utils/Math.hpp b/src/utils/Math.hpp index f23763da5..b22efb3db 100644 --- a/src/utils/Math.hpp +++ b/src/utils/Math.hpp @@ -107,13 +107,10 @@ const uint myproc = eqnmap_in.GetMeshTwo()._iproc; CurrentElem currelem(Level,vb,NULL,eqnmap_in.GetMeshTwo(),eqnmap_in.GetElemType()); //element without equation CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,eqnmap_in.GetQrule(currelem.GetDim())); - //======== ELEMENT MAPPING ======= - const uint meshql = (int) eqnmap_in.GetMeshTwo().GetRuntimeMap().get("meshql"); - //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); xyz._dim = eqnmap_in.GetMeshTwo().get_dim(); - xyz._FEord = meshql; + xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); From 91d3f94fc431468e7e7420ad068741175c62090c Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Sun, 8 Mar 2015 22:53:49 -0500 Subject: [PATCH 52/91] Add MLMesh to CurrentElem to retrieve mesh data --- applications/OptimalControl/fe_test/EqnT.cpp | 2 +- applications/OptimalControl/mhdopt/EqnMHD.cpp | 4 +-- .../OptimalControl/mhdopt/EqnMHDAD.cpp | 2 ++ .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 3 ++- applications/OptimalControl/mhdopt/EqnNS.cpp | 4 +-- .../OptimalControl/mhdopt/EqnNSAD.cpp | 3 ++- .../OptimalControl/mhdopt/OptLoop.cpp | 4 ++- applications/OptimalControl/tempopt/EqnNS.cpp | 3 ++- applications/OptimalControl/tempopt/EqnT.cpp | 3 +++ .../OptimalControl/tempopt/OptLoop.cpp | 9 +++++-- src/equations/BoundaryConditions.cpp | 5 +++- src/equations/CurrentElem.cpp | 12 ++++----- src/equations/CurrentElem.hpp | 7 ++--- src/equations/SystemTwo.cpp | 2 ++ src/utils/Math.hpp | 26 +++++++++++-------- 15 files changed, 57 insertions(+), 32 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 507bd8be3..eb9dd95c5 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -66,7 +66,7 @@ for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ========= diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index fb0cd73ee..f77b16ae8 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -72,7 +72,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== @@ -360,7 +360,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0;iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index d0b08c9d1..5c14722a4 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -68,6 +68,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== @@ -321,6 +322,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0;iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 09f5805b2..e90656b85 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -78,6 +78,7 @@ using namespace femus; for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== @@ -373,7 +374,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0;iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 10f039b58..d2465ba0e 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -160,7 +160,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== @@ -548,7 +548,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0; iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index aaa817a70..38e829297 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -67,6 +67,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== @@ -327,7 +328,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0;iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //=========INTERNAL QUANTITIES (unknowns of the equation) ================== diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 7eafa5c24..4ba7f7108 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -514,7 +514,9 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S const uint mesh_vb = VV; + Mesh *mymsh = eqn->GetMLProb()._ml_msh->GetLevel(Level); CurrentElem currelem(Level,VV,eqn,*mesh,eqn->GetMLProb().GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,eqn->GetMLProb().GetQrule(currelem.GetDim())); // processor index @@ -534,7 +536,7 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = DIMENSION; xyz_refbox._FEord = MESH_ORDER; - xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = mymsh->el->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); //========== diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 4f3c0371e..014f30f4b 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -84,7 +84,7 @@ for (int iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); - + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); @@ -379,6 +379,7 @@ for (uint fe = 0; fe < QL; fe++) { for (uint iel=0; iel < (nel_e - nel_b) ; iel++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index d033f16f1..65d761ee6 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -29,6 +29,7 @@ // application #include "TempQuantities.hpp" +#include "../../../src/equations/CurrentElem.hpp" // The question is: WHERE is the ORDER of the VARIABLES established? @@ -122,6 +123,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri for (uint iel=0; iel < (nel_e - nel_b); iel++) { CurrentElem currelem(Level,VV,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); @@ -411,6 +413,7 @@ for (uint fe = 0; fe < QL; fe++) { CurrentElem currelem(Level,BB,&my_system,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); diff --git a/applications/OptimalControl/tempopt/OptLoop.cpp b/applications/OptimalControl/tempopt/OptLoop.cpp index 7bd2dc4bd..76e8d41a1 100644 --- a/applications/OptimalControl/tempopt/OptLoop.cpp +++ b/applications/OptimalControl/tempopt/OptLoop.cpp @@ -82,6 +82,7 @@ J = ComputeNormControl ( ml_prob.GetMeshTwo()._NoLevels - 1,&ml_prob.GetMeshTwo( double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const SystemTwo* eqn, const std::string output_time) { + Mesh *mymsh = eqn->GetMLProb()._ml_msh->GetLevel(Level); //====== processor index const uint myproc = mesh->_iproc; const uint space_dim = mesh->get_dim(); @@ -89,6 +90,7 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S const uint mesh_vb = VV; CurrentElem currelem(Level,VV,eqn,*mesh,eqn->GetMLProb().GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,eqn->GetMLProb().GetQrule(currelem.GetDim())); //========== @@ -120,7 +122,7 @@ double ComputeIntegral (const uint Level, const MultiLevelMeshTwo* mesh, const S CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = MESH_ORDER; - xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = mymsh->el->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); @@ -224,7 +226,10 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons const uint mesh_vb = VV; + Mesh *mymsh = eqn->GetMLProb()._ml_msh->GetLevel(Level); + CurrentElem currelem(Level,VV,eqn,*mesh,eqn->GetMLProb().GetElemType()); + currelem.SetMesh(mymsh); CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,eqn->GetMLProb().GetQrule(currelem.GetDim())); //======Functions in the integrand ============ @@ -246,7 +251,7 @@ double ComputeNormControl (const uint Level, const MultiLevelMeshTwo* mesh, cons CurrentQuantity xyz_refbox(currgp); xyz_refbox._dim = space_dim; xyz_refbox._FEord = MESH_ORDER; - xyz_refbox._ndof = NVE[ mesh->_geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + xyz_refbox._ndof = mymsh->el->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); xyz_refbox.Allocate(); diff --git a/src/equations/BoundaryConditions.cpp b/src/equations/BoundaryConditions.cpp index d94e970cb..1d120fb15 100644 --- a/src/equations/BoundaryConditions.cpp +++ b/src/equations/BoundaryConditions.cpp @@ -222,8 +222,10 @@ void BoundaryConditions::GenerateBdc() { for (uint Level=0; Level <_dofmap->_mesh._NoLevels;Level++) { //loop over the levels + Mesh *mymsh = _dofmap->_eqn->GetMLProb()._ml_msh->GetLevel(Level); CurrentElem currelem(Level,BB,_dofmap->_eqn,_dofmap->_mesh,_dofmap->_eqn->GetMLProb().GetElemType()); - const uint el_nnodes_b = NVE[ _dofmap->_mesh._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; + currelem.SetMesh(mymsh); + const uint el_nnodes_b = mymsh->el->GetElementFaceDofNumber(ZERO_ELEM,ZERO_FACE,BIQUADR_FE); for (uint isubd=0; isubd<_dofmap->_mesh._NoSubdom; ++isubd) { uint iel_b = _dofmap->_mesh._off_el[BB][ _dofmap->_mesh._NoLevels*isubd + Level]; @@ -367,6 +369,7 @@ void BoundaryConditions::GenerateBdc() { // // // // // void BoundaryConditions::GenerateBdcElem() { // // // // // // // // // // CurrentElem currelem(BB,_dofmap->_eqn,_dofmap->_mesh,_dofmap->_eqn->GetMLProb().GetElemType()); +// // // // // currelem.SetMesh(mymsh); // // // // // // // // // // uint space_dim = _dofmap->_mesh.get_dim(); // // // // // diff --git a/src/equations/CurrentElem.cpp b/src/equations/CurrentElem.cpp index 88e6917a9..0ce609e57 100644 --- a/src/equations/CurrentElem.cpp +++ b/src/equations/CurrentElem.cpp @@ -37,7 +37,7 @@ namespace femus { { //========== Current "Geometric Element" ======================== - uint elnodes = NVE[ _mesh._geomelem_flag[_dim-1] ][BIQUADR_FE]; + uint elnodes = NVE[ _mesh._geomelem_flag[_dim-1] ][BIQUADR_FE];// mymsh->el->GetElementDofNumber(ZERO_ELEM,BIQUADR_FE); _el_conn.resize(elnodes); _el_conn_new.resize(elnodes); _xx_nds.resize(_mesh.get_dim()*elnodes); @@ -58,7 +58,7 @@ namespace femus { } - CurrentElem::~CurrentElem() {} + void CurrentElem::SetMesh(const Mesh * mesh_in) { _mesh_new = mesh_in; return; } @@ -142,7 +142,7 @@ for (uint ivar=0; ivar < _eqn->_dofmap._nvars[fe]; ivar++) { void CurrentElem::PrintOrientation() const { const uint mesh_dim = _mesh.get_dim(); - const uint el_nnodes = NVE[ _mesh._geomelem_flag[_dim-1] ][BIQUADR_FE]; + const uint el_nnodes = _el_conn.size(); std::vector xi(mesh_dim,0.); std::vector eta(mesh_dim,0.); @@ -210,7 +210,7 @@ void CurrentElem::PrintOrientation() const { void CurrentElem::SetMidpoint() { const uint mesh_dim = _mesh.get_dim(); - const uint el_nnodes = NVE[ _mesh._geomelem_flag[_dim-1] ][BIQUADR_FE]; + const uint el_nnodes = _el_conn.size(); for (uint idim=0; idim< mesh_dim; idim++) _el_xm[idim]=0.; @@ -230,7 +230,7 @@ void CurrentElem::PrintOrientation() const { void CurrentElem::SetDofobjConnCoords(const uint isubd_in,const uint iel) { const uint mydim = _mesh.get_dim(); - const uint el_nnodes = NVE[ _mesh._geomelem_flag[_dim-1] ][BIQUADR_FE]; + const uint el_nnodes = _el_conn.size(); for (uint n=0; n offset) {std::cout << "Quadratic transformation over linear mesh " << std::endl;abort();} /*);*/ diff --git a/src/equations/CurrentElem.hpp b/src/equations/CurrentElem.hpp index 8f16f3a6d..8ea9ca2ba 100644 --- a/src/equations/CurrentElem.hpp +++ b/src/equations/CurrentElem.hpp @@ -37,7 +37,6 @@ class CurrentQuantity; public: CurrentElem(const uint level, const uint vb, const SystemTwo*, const MultiLevelMeshTwo& mesh, const std::vector< std::vector > & elem_type); - ~CurrentElem(); inline const uint GetVb() const { return _mesh.get_dim() - _dim; @@ -105,11 +104,13 @@ class CurrentQuantity; const uint GetLevel() const {return _Level;} - //TODO make these private + //TODO make these private //========== Equation-related ======================== const SystemTwo * _eqn; //con questo puoi accedere a dati e funzioni DEL PADRE, NON al FIGLIO const MultiLevelMeshTwo & _mesh; - + const Mesh * _mesh_new; + void SetMesh(const Mesh * mesh_in); + private: const std::vector & _elem_type; diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index c6ae1b084..7d61508b9 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -283,7 +283,9 @@ void SystemTwo::Initialize() { for (uint Level = 0; Level< GetGridn(); Level++) { + Mesh *mymsh = GetMLProb()._ml_msh->GetLevel(Level); CurrentElem currelem(Level,VV,this,GetMLProb().GetMeshTwo(),GetMLProb().GetElemType()); + currelem.SetMesh(mymsh); const uint el_dof_objs = NVE[ GetMLProb().GetMeshTwo()._geomelem_flag[currelem.GetDim()-1] ][BIQUADR_FE]; uint iel_b = GetMLProb().GetMeshTwo()._off_el[VV][ GetMLProb().GetMeshTwo()._iproc*GetGridn() + Level ]; diff --git a/src/utils/Math.hpp b/src/utils/Math.hpp index b22efb3db..43d7f1f88 100644 --- a/src/utils/Math.hpp +++ b/src/utils/Math.hpp @@ -96,20 +96,24 @@ inline void extend_nds(const uint el_ndofs,const double* a_nds, double* a_nds3D, //================================================================= -inline double FunctionIntegral (const uint vb, MultiLevelProblem & eqnmap_in, double (*pt2func)(double, const std::vector ) ) { +inline double FunctionIntegral (const uint vb, MultiLevelProblem & ml_prob, double (*pt2func)(double, const std::vector ) ) { const uint mesh_vb = vb; -const uint Level = eqnmap_in.GetMeshTwo()._NoLevels - 1; -const uint myproc = eqnmap_in.GetMeshTwo()._iproc; + +const uint Level = ml_prob.GetMeshTwo()._NoLevels - 1; +const uint myproc = ml_prob.GetMeshTwo()._iproc; double time = 0.; - CurrentElem currelem(Level,vb,NULL,eqnmap_in.GetMeshTwo(),eqnmap_in.GetElemType()); //element without equation - CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,eqnmap_in.GetQrule(currelem.GetDim())); + Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); + + CurrentElem currelem(Level,vb,NULL,ml_prob.GetMeshTwo(),ml_prob.GetElemType()); //element without equation + currelem.SetMesh(mymsh); + CurrentGaussPointBase & currgp = CurrentGaussPointBase::build(currelem,ml_prob.GetQrule(currelem.GetDim())); //========= DOMAIN MAPPING CurrentQuantity xyz(currgp); - xyz._dim = eqnmap_in.GetMeshTwo().get_dim(); + xyz._dim = ml_prob.GetMeshTwo().get_dim(); xyz._FEord = MESH_MAPPING_FE; xyz._ndof = currelem.GetElemType(xyz._FEord)->GetNDofs(); xyz.Allocate(); @@ -117,11 +121,11 @@ const uint myproc = eqnmap_in.GetMeshTwo()._iproc; double integral = 0.; //loop over the geom el types - const uint el_ngauss = eqnmap_in.GetQrule(currelem.GetDim()).GetGaussPointsNumber(); + const uint el_ngauss = ml_prob.GetQrule(currelem.GetDim()).GetGaussPointsNumber(); //parallel sum - const uint nel_e = eqnmap_in.GetMeshTwo()._off_el[mesh_vb][eqnmap_in.GetMeshTwo()._NoLevels*myproc+Level+1]; - const uint nel_b = eqnmap_in.GetMeshTwo()._off_el[mesh_vb][eqnmap_in.GetMeshTwo()._NoLevels*myproc+Level]; + const uint nel_e = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level+1]; + const uint nel_b = ml_prob.GetMeshTwo()._off_el[mesh_vb][ml_prob.GetMeshTwo()._NoLevels*myproc+Level]; for (uint iel=0; iel < (nel_e - nel_b); iel++) { @@ -139,7 +143,7 @@ double Jac_g=0.; if (vb==0) Jac_g = currgp.JacVectVV_g(xyz); //not xyz_refbox! else if (vb==1) Jac_g = currgp.JacVectBB_g(xyz); //not xyz_refbox! - const double wgt_g = eqnmap_in.GetQrule(currelem.GetDim()).GetGaussWeight(qp); + const double wgt_g = ml_prob.GetQrule(currelem.GetDim()).GetGaussWeight(qp); for (uint fe = 0; fe < QL; fe++) { currgp.SetPhiElDofsFEVB_g (fe,qp); } @@ -157,7 +161,7 @@ double myval_g = pt2func(time,xyz._val_g); std::cout << std::endl << " ^^^^^^^^^^^^^^^^^L'integrale sul processore "<< myproc << " vale: " << integral << std::endl; double weights_sum = 0.; - for (uint qp = 0; qp < el_ngauss; qp++) weights_sum += eqnmap_in.GetQrule(currelem.GetDim()).GetGaussWeight(qp); + for (uint qp = 0; qp < el_ngauss; qp++) weights_sum += ml_prob.GetQrule(currelem.GetDim()).GetGaussWeight(qp); std::cout << std::endl << " ^^^^^^^^^^^^^^^^^ La somma dei pesi vale: " << weights_sum << std::endl; double J=0.; From 6198218e8370fd17f22dbaeeef28f2b51d562e8e Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 00:49:51 -0500 Subject: [PATCH 53/91] Cleaning fe_test --- applications/OptimalControl/fe_test/EqnT.cpp | 128 +++++++++---------- applications/OptimalControl/fe_test/main.cpp | 9 +- src/equations/CurrentElem.hpp | 8 +- 3 files changed, 73 insertions(+), 72 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index eb9dd95c5..68b1044fb 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -75,17 +75,17 @@ Tempold.VectWithQtyFillBasic(); Tempold.Allocate(); -//=========INTERNAL QUANTITIES (unknowns of the equation) ========= - CurrentQuantity Temp2(currgp); - Temp2._qtyptr = my_system.GetUnknownQuantitiesVector()[1]; - Temp2.VectWithQtyFillBasic(); - Temp2.Allocate(); +// //=========INTERNAL QUANTITIES (unknowns of the equation) ========= +// CurrentQuantity Temp2(currgp); +// Temp2._qtyptr = my_system.GetUnknownQuantitiesVector()[1]; +// Temp2.VectWithQtyFillBasic(); +// Temp2.Allocate(); //=========INTERNAL QUANTITIES (unknowns of the equation) ========= - CurrentQuantity Temp3(currgp); - Temp3._qtyptr = my_system.GetUnknownQuantitiesVector()[2]; - Temp3.VectWithQtyFillBasic(); - Temp3.Allocate(); +// CurrentQuantity Temp3(currgp); +// Temp3._qtyptr = my_system.GetUnknownQuantitiesVector()[2]; +// Temp3.VectWithQtyFillBasic(); +// Temp3.Allocate(); //=========EXTERNAL QUANTITIES (couplings) ===== //========= //DOMAIN MAPPING @@ -123,8 +123,8 @@ currelem.SetElDofsBc(); Tempold.GetElemDofs(); - Temp2.GetElemDofs(); - Temp3.GetElemDofs(); +// Temp2.GetElemDofs(); +// Temp3.GetElemDofs(); // =============== // Now the point is this: there are several functions of space @@ -159,8 +159,8 @@ for (uint fe = 0; fe < QL; fe++) { //======= end of the "COMMON SHAPE PART"================== Tempold.val_g(); - Temp2.val_g(); - Temp3.val_g(); +// Temp2.val_g(); +// Temp3.val_g(); // always remember to get the dofs for the variables you use! // The point is that you fill the dofs with different functions... @@ -170,8 +170,8 @@ for (uint fe = 0; fe < QL; fe++) { for (uint i=0; i < Tempold._ndof/*the maximum number is for biquadratic*/; i++) { const double phii_g = currgp._phi_ndsQLVB_g[Tempold._FEord][i]; - const double phii_gLL = currgp._phi_ndsQLVB_g[Temp2._FEord][i]; - const double phii_gKK = currgp._phi_ndsQLVB_g[Temp3._FEord][i]; +// const double phii_gLL = currgp._phi_ndsQLVB_g[Temp2._FEord][i]; +// const double phii_gKK = currgp._phi_ndsQLVB_g[Temp3._FEord][i]; for (uint idim = 0; idim < space_dim; idim++) dphiidx_g[idim] = currgp._dphidxyz_ndsQLVB_g[Tempold._FEord][i+idim*Tempold._ndof]; @@ -185,41 +185,41 @@ for (uint fe = 0; fe < QL; fe++) { currelem.Mat()(i,i) += (1-currelem.GetBCDofFlag()[i])*detb; //========= SECOND ROW ===================== - int ip1 = i + Tempold._ndof; - - if (i < currelem.GetElemType(Temp2._FEord)->GetNDofs() ) { - currelem.Rhs()(ip1) += - currelem.GetBCDofFlag()[ip1]*dtxJxW_g*( - 0.07*phii_gLL - ) - + (1-currelem.GetBCDofFlag()[ip1])*detb*(Temp2._val_dofs[i]); - - currelem.Mat()(ip1,ip1) += (1-currelem.GetBCDofFlag()[ip1])*detb; - } +// int ip1 = i + Tempold._ndof; +// +// if (i < currelem.GetElemType(Temp2._FEord)->GetNDofs() ) { +// currelem.Rhs()(ip1) += +// currelem.GetBCDofFlag()[ip1]*dtxJxW_g*( +// 0.07*phii_gLL +// ) +// + (1-currelem.GetBCDofFlag()[ip1])*detb*(Temp2._val_dofs[i]); +// +// currelem.Mat()(ip1,ip1) += (1-currelem.GetBCDofFlag()[ip1])*detb; +// } -//======= THIRD ROW =================================== - int ip2 = i + Tempold._ndof + Temp2._ndof; - - if (i < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { - currelem.Rhs()(ip2) += - currelem.GetBCDofFlag()[ip2]*dtxJxW_g*( - 0.07*phii_gKK - ) - + (1-currelem.GetBCDofFlag()[ip2])*detb*(Temp3._val_dofs[i]); - - currelem.Mat()(ip2,ip2) += (1-currelem.GetBCDofFlag()[ip2])*detb; - } +// //======= THIRD ROW =================================== +// int ip2 = i + Tempold._ndof + Temp2._ndof; +// +// if (i < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { +// currelem.Rhs()(ip2) += +// currelem.GetBCDofFlag()[ip2]*dtxJxW_g*( +// 0.07*phii_gKK +// ) +// + (1-currelem.GetBCDofFlag()[ip2])*detb*(Temp3._val_dofs[i]); +// +// currelem.Mat()(ip2,ip2) += (1-currelem.GetBCDofFlag()[ip2])*detb; +// } // Matrix Assemblying --------------------------- for (uint j=0; jGetNDofs() ) { - if ( j < currelem.GetElemType(Temp2._FEord)->GetNDofs() ) { - currelem.Mat()(ip1,jp1) += - currelem.GetBCDofFlag()[ip1]* - dtxJxW_g*( -// phij_gLL*phii_gLL - + Lap_gLL - ); - } - } +// if ( i < currelem.GetElemType(Temp2._FEord)->GetNDofs() ) { +// if ( j < currelem.GetElemType(Temp2._FEord)->GetNDofs() ) { +// currelem.Mat()(ip1,jp1) += +// currelem.GetBCDofFlag()[ip1]* +// dtxJxW_g*( +// // phij_gLL*phii_gLL +// + Lap_gLL +// ); +// } +// } //============= THIRD ROW ============= //======= DIAGONAL ================== - if ( i < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { - if ( j < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { - currelem.Mat()(ip2,jp2) += - currelem.GetBCDofFlag()[ip2]* - dtxJxW_g*( - phij_gKK*phii_gKK - + Lap_gKK - ); - } - } +// if ( i < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { +// if ( j < currelem.GetElemType(Temp3._FEord)->GetNDofs() ) { +// currelem.Mat()(ip2,jp2) += +// currelem.GetBCDofFlag()[ip2]* +// dtxJxW_g*( +// phij_gKK*phii_gKK +// + Lap_gKK +// ); +// } +// } diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 427fb288f..4c5e992bc 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -67,6 +67,7 @@ // ======= MyDomainShape (optional, implemented as child of Domain) ==================== FemusInputParser box_map("Box",files.GetOutputPath()); + Box mybox(mesh.get_dim(),box_map); mybox.InitAndNondimensionalize(mesh.get_Lref()); @@ -92,8 +93,8 @@ //======================================================== Temperature temperature("Qty_Temperature",qty_map,1,0/*biquadratic*/); qty_map.AddQuantity(&temperature); - Temperature temperature2("Qty_Temperature2",qty_map,1,1/*linear*/); qty_map.AddQuantity(&temperature2); - Temperature temperature3("Qty_Temperature3",qty_map,1,2/*constant*/); qty_map.AddQuantity(&temperature3); +// Temperature temperature2("Qty_Temperature2",qty_map,1,1/*linear*/); qty_map.AddQuantity(&temperature2); +// Temperature temperature3("Qty_Temperature3",qty_map,1,2/*constant*/); qty_map.AddQuantity(&temperature3); // ===== end QuantityMap ========================================= // ====== Start new main ================================= @@ -121,8 +122,8 @@ SystemTwo & eqnT = ml_prob.add_system("Eqn_T"); eqnT.AddSolutionToSystemPDE("FAKE"); eqnT.AddUnknownToSystemPDE(&temperature); - eqnT.AddUnknownToSystemPDE(&temperature2); - eqnT.AddUnknownToSystemPDE(&temperature3); +// eqnT.AddUnknownToSystemPDE(&temperature2); +// eqnT.AddUnknownToSystemPDE(&temperature3); eqnT.SetAssembleFunction(GenMatRhsT); //================================ diff --git a/src/equations/CurrentElem.hpp b/src/equations/CurrentElem.hpp index 8ea9ca2ba..5da41c98b 100644 --- a/src/equations/CurrentElem.hpp +++ b/src/equations/CurrentElem.hpp @@ -120,15 +120,15 @@ class CurrentQuantity; DenseMatrix _KeM; DenseVector _FeM; uint _el_n_dofs; - std::vector _el_dof_indices; - std::vector _bc_eldofs; //So the element must be aware of the BC of the equation + std::vector _el_dof_indices; // this must become a vect of vect + std::vector _bc_eldofs; // this must become a vect of vect // ======================================================================================== //========== Current Geometric Element: needs the MESH ======================== std::vector _el_conn; /// vector of the global nodes for that element [NNDS]; - std::vector _el_conn_new; /// vector of the global nodes for that element [NNDS]; + std::vector _el_conn_new; uint _vol_iel_DofObj; /// i need to put the element also. - std::vector _xx_nds; /// vector of the node coordinates for that element [_spacedimension*NNDS]; + std::vector _xx_nds; /// vector of the node coordinates for that element [_spacedimension*NNDS]; // this must become a vect of vect std::vector _el_xm; /// element center point [_spacedimension]; const uint _dim; //spatial dimension of the current element (can be different from the mesh dimension!) const uint _mesh_vb; //index for the mesh From cda536ff6e3ee37f48ef8fb3bfb86dbe68dfd08e Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 13:04:01 -0500 Subject: [PATCH 54/91] Introduced temporary init_two() to reduce SystemTwo --- applications/OptimalControl/fe_test/main.cpp | 2 +- applications/OptimalControl/mhdopt/main.cpp | 2 +- applications/OptimalControl/tempopt/main.cpp | 6 ++-- src/equations/ExplicitSystem.hpp | 3 ++ src/equations/ImplicitSystem.hpp | 3 ++ src/equations/LinearImplicitSystem.cpp | 29 ++++++++++++++++++++ src/equations/LinearImplicitSystem.hpp | 3 ++ src/equations/System.hpp | 3 ++ 8 files changed, 46 insertions(+), 5 deletions(-) diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 4c5e992bc..0edd90a61 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -140,7 +140,7 @@ SystemTwo* sys = static_cast(eqn->second); // //===================== - sys -> init(); + sys -> init_two(); sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== diff --git a/applications/OptimalControl/mhdopt/main.cpp b/applications/OptimalControl/mhdopt/main.cpp index 6fb9a7b7b..6f7e8de71 100644 --- a/applications/OptimalControl/mhdopt/main.cpp +++ b/applications/OptimalControl/mhdopt/main.cpp @@ -222,7 +222,7 @@ int main(int argc, char** argv) { SystemTwo* sys = static_cast(eqn->second); // //===================== - sys -> init(); + sys -> init_two(); sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 1505c356e..72b63a964 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -179,7 +179,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr SystemTwo* sys = static_cast(eqn->second); //===================== - sys -> init(); //the dof map is built here based on all the solutions associated with that system + sys -> init_two(); //the dof map is built here based on all the solutions associated with that system sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== @@ -189,9 +189,9 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr //===================== sys -> initVectors(); //===================== - sys -> Initialize(); //why do they do this BEFORE the dofmap? + sys -> Initialize(); ///===================== - sys -> _bcond.GenerateBdc(); //why do they do this BEFORE the dofmap? + sys -> _bcond.GenerateBdc(); //===================== sys -> ReadMGOps(files.GetOutputPath()); diff --git a/src/equations/ExplicitSystem.hpp b/src/equations/ExplicitSystem.hpp index c1a18c8d9..ae2ecf78f 100644 --- a/src/equations/ExplicitSystem.hpp +++ b/src/equations/ExplicitSystem.hpp @@ -54,6 +54,9 @@ class ExplicitSystem : public System { /** Init the system PDE structures */ virtual void init(); + + /** @deprecated Init the system PDE structures */ + virtual void init_two(){}; /** * @returns \p "Explicit". Helps in identifying diff --git a/src/equations/ImplicitSystem.hpp b/src/equations/ImplicitSystem.hpp index 3ea56734b..704b2bb2b 100644 --- a/src/equations/ImplicitSystem.hpp +++ b/src/equations/ImplicitSystem.hpp @@ -54,6 +54,9 @@ class ImplicitSystem : public ExplicitSystem { /** Init the system PDE structures */ virtual void init(); + /** @deprecated Init the system PDE structures */ + virtual void init_two() {}; + /** * @returns \p "Implicit". Helps in identifying * the system type in an equation system file. diff --git a/src/equations/LinearImplicitSystem.cpp b/src/equations/LinearImplicitSystem.cpp index ba811f5d0..9209d1c53 100644 --- a/src/equations/LinearImplicitSystem.cpp +++ b/src/equations/LinearImplicitSystem.cpp @@ -100,6 +100,35 @@ void LinearImplicitSystem::init() { AddVariableToBeSolved("All"); } +/// @deprecated +// this function is like init but it doesn't call InitPDE +void LinearImplicitSystem::init_two() { + + _LinSolver.resize(_gridn); + + _LinSolver[0]=LinearEquationSolver::build(0,_msh[0],GMRES_SMOOTHER).release(); + for(unsigned i=1;i<_gridn;i++){ + _LinSolver[i]=LinearEquationSolver::build(i,_msh[i],_SmootherType).release(); + } + +// for (unsigned i=0; i<_gridn; i++) { +// _LinSolver[i]->InitPde(_SolSystemPdeIndex,_ml_sol->GetSolType(), +// _ml_sol->GetSolName(),&_solution[i]->_Bdc,_gridr,_gridn,_SparsityPattern); +// } +// +// for (unsigned ig=1; ig<_gridn; ig++) { +// BuildProlongatorMatrix(ig); +// } + + _NSchurVar_test=0; + _numblock_test=0; + _numblock_all_test=0; + // By default we solved for all the PDE variables + ClearVariablesToBeSolved(); + AddVariableToBeSolved("All"); +} + + void LinearImplicitSystem::AddSystemLevel() { diff --git a/src/equations/LinearImplicitSystem.hpp b/src/equations/LinearImplicitSystem.hpp index 0b10f4d6d..706c2d16f 100644 --- a/src/equations/LinearImplicitSystem.hpp +++ b/src/equations/LinearImplicitSystem.hpp @@ -55,6 +55,9 @@ class LinearImplicitSystem : public ImplicitSystem { /** Init the system PDE structures */ virtual void init(); + /** @deprecated Init the system PDE structures */ + virtual void init_two(); + /** Add a system level */ void AddSystemLevel(); /** diff --git a/src/equations/System.hpp b/src/equations/System.hpp index 10d41664f..97dd36513 100644 --- a/src/equations/System.hpp +++ b/src/equations/System.hpp @@ -82,6 +82,9 @@ class System { /** Init the system PDE structures */ virtual void init(); + /** @deprecated Init the system PDE structures */ + virtual void init_two(){}; + /** Get the index of the Solution "solname" for this system */ unsigned GetSolPdeIndex(const char solname[]); From 214f5a67ea991776d4704eebea9fd11ecfeec17a Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 13:30:02 -0500 Subject: [PATCH 55/91] _A now is _KK --- applications/OptimalControl/fe_test/EqnT.cpp | 8 +-- applications/OptimalControl/mhdopt/EqnMHD.cpp | 10 +-- .../OptimalControl/mhdopt/EqnMHDAD.cpp | 10 +-- .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 10 +-- applications/OptimalControl/mhdopt/EqnNS.cpp | 10 +-- .../OptimalControl/mhdopt/EqnNSAD.cpp | 10 +-- applications/OptimalControl/tempopt/EqnNS.cpp | 10 +-- applications/OptimalControl/tempopt/EqnT.cpp | 10 +-- src/equations/SystemTwo.cpp | 64 +++++-------------- src/equations/SystemTwo.hpp | 9 ++- src/equations/TimeLoop.cpp | 8 +-- 11 files changed, 62 insertions(+), 97 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 68b1044fb..3bc18a6ed 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -36,7 +36,7 @@ //======== ELEMENT MAPPING ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -273,7 +273,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.Mat().print_scientific(std::cout); - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop // ***************************************************************** @@ -287,12 +287,12 @@ for (uint fe = 0; fe < QL; fe++) { }//END VOLUME - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " Matrix and RHS assembled for equation " << my_system.name() - << " Level "<< Level << " dofs " << my_system._A[Level]->n() << std::endl; + << " Level "<< Level << " dofs " << my_system._LinSolver[Level]->_KK->n() << std::endl; #endif return; diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index f77b16ae8..18c05884e 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -51,7 +51,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -335,7 +335,7 @@ for (uint fe = 0; fe < QL; fe++) { // end element gaussian integration loop /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -532,7 +532,7 @@ for (uint fe = 0; fe < QL; fe++) { } // end BDRYelement gaussian integration loop - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); @@ -543,12 +543,12 @@ for (uint fe = 0; fe < QL; fe++) { // END BOUNDARY // ***************************************************************** - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs " << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs " << std::endl; #endif diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index 5c14722a4..9e30bf4ec 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -47,7 +47,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -300,7 +300,7 @@ for (uint fe = 0; fe < QL; fe++) { // end element gaussian integration loop /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -420,7 +420,7 @@ for (uint fe = 0; fe < QL; fe++) { } //gauss - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); }//elem loop @@ -428,12 +428,12 @@ for (uint fe = 0; fe < QL; fe++) { }//END BOUNDARY ************************ - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs " << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs " << std::endl; #endif return; diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index e90656b85..3ce20645b 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -57,7 +57,7 @@ using namespace femus; double Lapxi_g[DIMENSION]; //=========================== - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -351,7 +351,7 @@ for (uint fe = 0; fe < QL; fe++) { //============================================================== /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -473,7 +473,7 @@ const double phii_g = currgp._phi_ndsQLVB_g[BeOld._FEord][i]; //================== END GAUSS LOOP (qp loop) ====================== //================================================================== - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -484,12 +484,12 @@ const double phii_g = currgp._phi_ndsQLVB_g[BeOld._FEord][i]; // END BOUNDARY // ************************** - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs " << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs " << std::endl; #endif return; diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index d2465ba0e..9b91a44f1 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -137,7 +137,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); //========== GEOMETRIC ELEMENT ======== const uint space_dim = ml_prob._ml_msh->GetDimension(); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -525,7 +525,7 @@ for (uint fe = 0; fe < QL; fe++) { //============================================================== /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -666,7 +666,7 @@ for (uint fe = 0; fe < QL; fe++) { //================== END GAUSS LOOP (qp loop) ====================== //================================================================== - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); @@ -677,12 +677,12 @@ for (uint fe = 0; fe < QL; fe++) { } // END BOUNDARY ****************************** - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs" << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs" << std::endl; #endif return; diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index 38e829297..c82306355 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -47,7 +47,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); // //======== GEOMETRICAL ELEMENT ======= const uint space_dim = ml_prob._ml_msh->GetDimension(); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -305,7 +305,7 @@ for (uint fe = 0; fe < QL; fe++) { // end element gaussian integration loop /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -427,19 +427,19 @@ for (uint fe = 0; fe < QL; fe++) { } //gauss - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); }//elem loop }//END BOUNDARY ************************ - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs" << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs" << std::endl; #endif return; diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 014f30f4b..2786fc175 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -62,7 +62,7 @@ std::vector AdvRhs_g(space_dim); //Operator: Adv(u,u,phi) //================================================ - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -355,7 +355,7 @@ for (uint fe = 0; fe < QL; fe++) { //============================================================== /// Add element matrix and rhs to the global ones. - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); @@ -501,7 +501,7 @@ for (uint fe = 0; fe < QL; fe++) { //================== END GAUSS LOOP (qp loop) ====================== //================================================================== - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); @@ -512,13 +512,13 @@ for (uint fe = 0; fe < QL; fe++) { } // END BOUNDARY ****************************** - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level - << " with " << my_system._A[Level]->m() << " dofs" << std::endl; + << " with " << my_system._LinSolver[Level]->_KK->m() << " dofs" << std::endl; #endif return; diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index 65d761ee6..acf47c5c0 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -108,7 +108,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri // QfluxDOTn>0: energy flows outside (cooling) QfluxDOTn<0: energy flows inside (heating) std::vector Qflux_g(space_dim); - my_system._A[Level]->zero(); + my_system._LinSolver[Level]->_KK->zero(); my_system._b[Level]->zero(); // ========================================== @@ -394,7 +394,7 @@ for (uint fe = 0; fe < QL; fe++) { } //end i (row) } // end of the quadrature point qp-loop - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop // ***************************************************************** @@ -520,7 +520,7 @@ int el_Neum_flag=0; } // end BDRYelement gaussian integration loop - my_system._A[Level]->add_matrix(currelem.Mat(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -529,13 +529,13 @@ int el_Neum_flag=0; }//END BOUNDARY - my_system._A[Level]->close(); + my_system._LinSolver[Level]->_KK->close(); my_system._b[Level]->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " Matrix and RHS assembled for equation " << my_system.name() - << " Level "<< Level << " dofs " << my_system._A[Level]->n() << std::endl; + << " Level "<< Level << " dofs " << my_system._LinSolver[Level]->_KK->n() << std::endl; #endif return; diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 7d61508b9..4b099182e 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -70,12 +70,10 @@ SystemTwo::~SystemTwo() { //========= MGOps =========================== for (uint Level =0; Level< GetGridn(); Level++) { - delete _A[Level]; if (Level < GetGridn() - 1) delete _Rst[Level]; if (Level > 0) delete _Prl[Level]; } - _A.clear(); _Rst.clear(); _Prl.clear(); @@ -480,12 +478,12 @@ double SystemTwo::MGStep(int Level, // Level double xNorm0=_x[Level]->linfty_norm(); _b[Level]->close(); double bNorm0=_b[Level]->linfty_norm(); - _A[Level]->close(); - double ANorm0=_A[Level]->l1_norm(); + _LinSolver[Level]->_KK->close(); + double ANorm0=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANorm0 << " bNorm linfty " << bNorm0 << " xNormINITIAL linfty " << xNorm0 << std::endl; #endif - rest = _LinSolver[Level]->solve(*_A[Level],*_A[Level],*_x[Level],*_b[Level],DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level #ifdef DEFAULT_PRINT_CONV std::cout << " Coarse sol : res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -493,7 +491,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << " Norm of x after the coarse solution " << _x[Level]->linfty_norm() << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_A[Level]); //************ compute the coarse residual + _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK); //************ compute the coarse residual _res[Level]->close(); std::cout << "COARSE Level " << Level << " res linfty " << _res[Level]->linfty_norm() << " res l2 " << _res[Level]->l2_norm() << std::endl; @@ -511,12 +509,12 @@ double SystemTwo::MGStep(int Level, // Level double xNormpre=_x[Level]->linfty_norm(); _b[Level]->close(); double bNormpre=_b[Level]->linfty_norm(); - _A[Level]->close(); - double ANormpre=_A[Level]->l1_norm(); + _LinSolver[Level]->_KK->close(); + double ANormpre=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANormpre << " bNorm linfty " << bNormpre << " xNormINITIAL linfty " << xNormpre << std::endl; #endif - rest = _LinSolver[Level]->solve(*_A[Level],*_A[Level],*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level #ifdef DEFAULT_PRINT_CONV std::cout << " Pre Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -526,7 +524,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_A[Level]);//********** compute the residual + _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK);//********** compute the residual /// std::cout << "************ END ONE PRE-SMOOTHING *****************"<< std::endl; @@ -566,12 +564,12 @@ double SystemTwo::MGStep(int Level, // Level double xNormpost=_x[Level]->linfty_norm(); _b[Level]->close(); double bNormpost=_b[Level]->linfty_norm(); - _A[Level]->close(); - double ANormpost=_A[Level]->l1_norm(); + _LinSolver[Level]->_KK->close(); + double ANormpost=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANormpost << " bNorm linfty " << bNormpost << " xNormINITIAL linfty " << xNormpost << std::endl; #endif - rest = _LinSolver[Level]->solve(*_A[Level],*_A[Level],*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level #ifdef DEFAULT_PRINT_CONV std::cout<<" Post Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -581,7 +579,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout<< " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_A[Level]); //******* compute the residual + _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK); //******* compute the residual /// std::cout << "************ END ONE POST-SMOOTHING *****************"<< std::endl; @@ -780,8 +778,6 @@ void SystemTwo::ReadMGOps(const std::string output_path) { void SystemTwo::ReadMatrix(const std::string& namefile) { - _A.resize(GetGridn()); - for (uint Level = 0; Level< GetGridn(); Level++) { std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Level; @@ -865,8 +861,8 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { } - _A[Level] = SparseMatrix::build().release(); -// // _A[Level]->init(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); ///@todo BACK TO a REASONABLE INIT + _LinSolver[Level]->_KK = SparseMatrix::build().release(); +// // _LinSolver[Level]->_KK->init(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); ///@todo BACK TO a REASONABLE INIT Graph graph; graph.resize(mrow_glob_t); @@ -916,36 +912,6 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { for (int c=0;cupdate_sparsity_pattern_old(graph); + _LinSolver[Level]->_KK->update_sparsity_pattern_old(graph); // clean =============== graph.clear(); diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index e07187797..8843656f8 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -65,9 +65,8 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= //======== MG Ops ============ (procs,levels) ==== //======================================================================= - std::vector _A; // LinearEquation (each level) - std::vector _Rst; // LinearEquation (each level) - std::vector _Prl; // LinearEquation (each level) + std::vector _Rst; // LinearEquation (each level) _RR + std::vector _Prl; // LinearEquation (each level) _PP void ReadMGOps(const std::string output_path); // LinearEquation (each level) void ReadMatrix(const std::string& name); // LinearEquation (each level) @@ -82,8 +81,8 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= std::vector _b; //// LinearEquation (each level) - std::vector _x; //// LinearEquation (each level) - std::vector _res; //// LinearEquation (each level) + std::vector _x; //// LinearEquation (each level) _EPS + std::vector _res; //// LinearEquation (each level) _RES std::vector _x_old; //// LinearEquation (each level) diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 3ea8a8052..ad5b9f0e3 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -116,10 +116,10 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { eqn_in-> GetAssembleFunction()(eqn_in->GetMLProb(),Level,0,true); #ifdef DEFAULT_PRINT_INFO - eqn_in->_A[Level]->close(); - double ANorm = eqn_in->_A[Level]->l1_norm(); + eqn_in->_LinSolver[Level]->_KK->close(); + double ANorm = eqn_in->_LinSolver[Level]->_KK->l1_norm(); -// _A[Level]->print_graphic(true); TODO should pass this true or false as a parameter +// _LinSolver[Level]->_KK->print_graphic(true); TODO should pass this true or false as a parameter std::cout << " ANorm l1 " << Level << " " << ANorm << std::endl; #endif @@ -144,7 +144,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { eqn_in->MGSolve(DEFAULT_EPS_LSOLV, DEFAULT_MAXITS_LSOLV); // // for (uint Level = 0 ; Level < GetGridn(); Level++) { -// // _solver[Level]->solve(*_A[Level],*_x[Level],*_b[Level],1.e-6,40); +// // _solver[Level]->solve(*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],1.e-6,40); // // _x[Level]->localize(*_x_old[Level]); // x_old = x // // } From d7b4a8df1257059728dc275d467e0a274446354a Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 13:41:37 -0500 Subject: [PATCH 56/91] _Rst is now _RR --- src/equations/SystemTwo.cpp | 15 +++++++-------- src/equations/SystemTwo.hpp | 1 - 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 4b099182e..737ed56af 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -70,11 +70,11 @@ SystemTwo::~SystemTwo() { //========= MGOps =========================== for (uint Level =0; Level< GetGridn(); Level++) { - if (Level < GetGridn() - 1) delete _Rst[Level]; +// if (Level < GetGridn() - 1) delete _Rst[Level]; if (Level > 0) delete _Prl[Level]; } - _Rst.clear(); +// _Rst.clear(); _Prl.clear(); //======== Vectors ========================== @@ -530,7 +530,7 @@ double SystemTwo::MGStep(int Level, // Level /// std::cout << ">>>>>>>> BEGIN ONE DESCENT >>>>>>>>>>"<< std::endl; - _b[Level-1]->matrix_mult(*_res[Level],*_Rst[Level-1]);//****** restrict the residual from the finer grid ( new rhs ) + _b[Level-1]->matrix_mult(*_res[Level],*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) _x[Level-1]->close(); //initial value of x for the presmoothing iterations _x[Level-1]->zero(); //initial value of x for the presmoothing iterations @@ -1209,7 +1209,6 @@ void SystemTwo::ReadProl(const std::string& name) { //perche' sono legati ai DOF (devi pensare che la questione del mesh e' gia' risolta) void SystemTwo::ReadRest(const std::string& name) { - _Rst.resize(GetGridn()); //TODO why do it bigger? for (uint Level = 0; Level< GetGridn() - 1; Level++) { @@ -1290,7 +1289,7 @@ void SystemTwo::ReadRest(const std::string& name) { uint off_proc=GetGridn()*GetMLProb().GetMeshTwo()._iproc; - _Rst[Lev_c] = SparseMatrix::build().release(); + _LinSolver[Lev_c]->_RR = SparseMatrix::build().release(); // // // _Rst[Lev_c]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT //we have to do this before appropriately!!! int nrowt=0;int nclnt=0; @@ -1354,7 +1353,7 @@ void SystemTwo::ReadRest(const std::string& name) { std::cout << "Printing Restrictor ===========" << std::endl; pattern.print(); - _Rst[Lev_c]->update_sparsity_pattern_old(pattern); //TODO see + _LinSolver[Lev_c]->_RR->update_sparsity_pattern_old(pattern); //TODO see // _Rst[Lev_c]->close(); // if (GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(); //there is no print function for rectangular matrices, and print_personal doesnt seem to be working... // la print stampa il contenuto, ma io voglio solo stampare lo sparsity pattern! @@ -1382,7 +1381,7 @@ void SystemTwo::ReadRest(const std::string& name) { for (uint i1=0;i1add_matrix(*valmat,tmp,ind); + _LinSolver[Lev_c]->_RR->add_matrix(*valmat,tmp,ind); delete valmat; }// end dof loop } // end var loop @@ -1402,7 +1401,7 @@ void SystemTwo::ReadRest(const std::string& name) { pattern.clear(); - _Rst[Lev_c]->close(); //TODO Do we really need this? + _LinSolver[Lev_c]->_RR->close(); // if (GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(std::cout); // _Rst[Lev_c]->print_graphic(false); // TODO should pass this true or false as a parameter diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 8843656f8..3c5467f9d 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -65,7 +65,6 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= //======== MG Ops ============ (procs,levels) ==== //======================================================================= - std::vector _Rst; // LinearEquation (each level) _RR std::vector _Prl; // LinearEquation (each level) _PP void ReadMGOps(const std::string output_path); // LinearEquation (each level) From b4b83ee78acda3194338fb4c13e958d4c5696cdd Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 13:52:51 -0500 Subject: [PATCH 57/91] _Prl is now _PP --- src/equations/SystemTwo.cpp | 22 ++++++---------------- src/equations/SystemTwo.hpp | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 737ed56af..23ac245f1 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -68,15 +68,6 @@ SystemTwo::SystemTwo(MultiLevelProblem& e_map_in, const std::string & eqname_in, // where the new is is called! SystemTwo::~SystemTwo() { - //========= MGOps =========================== - for (uint Level =0; Level< GetGridn(); Level++) { -// if (Level < GetGridn() - 1) delete _Rst[Level]; - if (Level > 0) delete _Prl[Level]; - } - -// _Rst.clear(); - _Prl.clear(); - //======== Vectors ========================== for (uint Level =0; Levelmatrix_mult(*_x[Level-1],*_Prl[Level]); //**** project the solution + _x[Level]->matrix_mult(*_x[Level-1],*_LinSolver[Level]->_PP); //**** project the solution res_fine = MGStep(Level,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); @@ -545,7 +536,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << "BEFORE PROL Level " << Level << " res linfty " << _res[Level-1]->linfty_norm() << " res l2 " << _res[Level-1]->l2_norm() << std::endl; #endif - _res[Level]->matrix_mult(*_x[Level-1],*_Prl[Level]);//******** project the dx from the coarser grid + _res[Level]->matrix_mult(*_x[Level-1],*_LinSolver[Level]->_PP);//******** project the dx from the coarser grid #ifdef DEFAULT_PRINT_CONV _res[Level]->close(); //here, the _res contains the prolongation of dx, so the new x is x_old + P dx @@ -971,7 +962,6 @@ void SystemTwo::ReadMatrix(const std::string& namefile) { //This function depends on _iproc void SystemTwo::ReadProl(const std::string& name) { - _Prl.resize(GetGridn()); ///@todo one place is left empty in practice, we can optimize this!!! for (uint Level = 1; Level< GetGridn(); Level++) { @@ -1053,7 +1043,7 @@ void SystemTwo::ReadProl(const std::string& name) { uint off_proc = GetMLProb().GetMeshTwo()._iproc*GetGridn(); - _Prl[ Lev_f ] = SparseMatrix::build().release(); + _LinSolver[Lev_f]->_PP = SparseMatrix::build().release(); // // // _Prl[ Lev_f ]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT // local matrix dimension @@ -1130,7 +1120,7 @@ void SystemTwo::ReadProl(const std::string& name) { std::cout << "Printing Prolongator ===========" << std::endl; pattern.print(); - _Prl[ Lev_f ]->update_sparsity_pattern_old(pattern); //TODO shall we make the two operations of updating sparsity pattern and setting values together? + _LinSolver[Lev_f]->_PP->update_sparsity_pattern_old(pattern); //TODO shall we make the two operations of updating sparsity pattern and setting values together? //=========== VALUES =================== DenseMatrix *valmat; @@ -1150,7 +1140,7 @@ void SystemTwo::ReadProl(const std::string& name) { for (uint j=0; jadd_matrix(*valmat,tmp,ind); + _LinSolver[Lev_f]->_PP->add_matrix(*valmat,tmp,ind); delete valmat; } } @@ -1171,7 +1161,7 @@ void SystemTwo::ReadProl(const std::string& name) { pattern.clear(); - _Prl[ Lev_f ]->close(); //TODO do we need this? + _LinSolver[Lev_f]->_PP->close(); // if (GetMLProb().GetMeshTwo()._iproc==0) _Prl[ Lev_f ]->print_personal(); // _Prl[ Lev_f ]->print_graphic(false); //TODO should pass this true or false as a parameter } //end levels diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 3c5467f9d..ea6e59b73 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -65,7 +65,7 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= //======== MG Ops ============ (procs,levels) ==== //======================================================================= - std::vector _Prl; // LinearEquation (each level) _PP +// std::vector _Prl; // LinearEquation (each level) _PP void ReadMGOps(const std::string output_path); // LinearEquation (each level) void ReadMatrix(const std::string& name); // LinearEquation (each level) From 454822ef015d19f39faea60f8070aa6ba48cd210 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 14:10:50 -0500 Subject: [PATCH 58/91] _x_oold only at fine level now --- applications/OptimalControl/mhdopt/OptLoop.cpp | 10 +++++----- src/equations/SystemTwo.cpp | 11 ++++++----- src/equations/SystemTwo.hpp | 3 +-- src/equations/TimeLoop.cpp | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 4ba7f7108..6ca56da43 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -74,7 +74,7 @@ namespace femus { //now it is an optimization loop //question:how do I see the NONLINEAR LOOPS alone? //you call transient_loop() instead of optimization_loop() -//x_old and _x_oold will be used +//x_old and _xoold will be used //either for OPTIMIZATION iterations or for NONLINEAR iterations, //depending on what you need @@ -181,8 +181,8 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { //xold there was a good value //xoold there was still the value multiplied // omega = 1.; //"omega=1" and "no if" is equal to the old loop - eqnMHDCONT._x_oold[NoLevels - 1]->close(); - std::cout << "Linfty norm of Becont _x_oold " << eqnMHDCONT._x_oold [NoLevels - 1]->linfty_norm() << std::endl; + eqnMHDCONT._x_oold->close(); + std::cout << "Linfty norm of Becont _x_oold " << eqnMHDCONT._x_oold->linfty_norm() << std::endl; eqnMHDCONT._x_old[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont _x_old " << eqnMHDCONT._x_old [NoLevels - 1]->linfty_norm() << std::endl; @@ -200,9 +200,9 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont _x_old*omega " << eqnMHDCONT._x_tmp [NoLevels - 1]->linfty_norm() << std::endl; - eqnMHDCONT._x_oold[NoLevels - 1]->close(); + eqnMHDCONT._x_oold->close(); std::cout << "Linfty norm of Becont _x_oold " - << eqnMHDCONT._x_oold [NoLevels - 1]->linfty_norm() << std::endl; + << eqnMHDCONT._x_oold->linfty_norm() << std::endl; _x_oldopt[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont _x_oldopt " diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 23ac245f1..3f9c810e8 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -74,17 +74,17 @@ SystemTwo::~SystemTwo() { delete _res[Level]; delete _x[Level]; delete _x_old[Level]; - delete _x_oold[Level]; delete _x_tmp[Level]; } + _b.clear(); _res.clear(); _x.clear(); _x_old.clear(); - _x_oold.clear(); _x_tmp.clear(); + delete _x_oold; } @@ -160,7 +160,6 @@ void SystemTwo::initVectors() { //allocation _x.resize(GetGridn()); _x_old.resize(GetGridn()); - _x_oold.resize(GetGridn()); _x_tmp.resize(GetGridn()); _b.resize(GetGridn()); _res.resize(GetGridn()); @@ -179,12 +178,14 @@ void SystemTwo::initVectors() { _x[Level]->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _x_old[Level] = NumericVector::build().release(); _x_old[Level]->init(_dofmap._Dim[Level],false, SERIAL); - _x_oold[Level] = NumericVector::build().release(); - _x_oold[Level]->init(_dofmap._Dim[Level],false, SERIAL); _x_tmp[Level] = NumericVector::build().release(); _x_tmp[Level]->init(_dofmap._Dim[Level],false, SERIAL); } //end level loop + + _x_oold = NumericVector::build().release(); + _x_oold->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); + return; } diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index ea6e59b73..15a61d226 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -65,7 +65,6 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= //======== MG Ops ============ (procs,levels) ==== //======================================================================= -// std::vector _Prl; // LinearEquation (each level) _PP void ReadMGOps(const std::string output_path); // LinearEquation (each level) void ReadMatrix(const std::string& name); // LinearEquation (each level) @@ -85,7 +84,7 @@ class SystemTwo : public LinearImplicitSystem { std::vector _x_old; //// LinearEquation (each level) - std::vector _x_oold; //this is used by MGTimeStep and also by the OptLoop + NumericVector * _x_oold; //this is used by MGTimeStep and also by the OptLoop std::vector _x_tmp; //this is used by MGTimeStep and also by the OptLoop void initVectors(); ///initialize vectors //System// diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index ad5b9f0e3..87b2c7cae 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -104,7 +104,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { std::cout << std::endl << " Solving " << eqn_in->name() << " , step " << iter << std::endl; ///A0) Put x_old into x_oold - *(eqn_in->_x_oold[eqn_in->GetGridn()-1]) = *(eqn_in->_x_old[eqn_in->GetGridn()-1]); + *(eqn_in->_x_oold) = *(eqn_in->_x_old[eqn_in->GetGridn()-1]); /// A) Assemblying #if DEFAULT_PRINT_TIME==1 @@ -165,7 +165,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { /// std::cout << "$$$$$$$$$ Check the convergence $$$$$$$" << std::endl; eqn_in->_x_tmp[eqn_in->GetGridn()-1]->zero(); - eqn_in->_x_tmp[eqn_in->GetGridn()-1]->add(+1.,*(eqn_in->_x_oold[eqn_in->GetGridn()-1])); + eqn_in->_x_tmp[eqn_in->GetGridn()-1]->add(+1.,*(eqn_in->_x_oold)); eqn_in->_x_tmp[eqn_in->GetGridn()-1]->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_oold -x_old =actually= (x_old - x) //(x must not be touched, as you print from it) From 9b2679f20aeafae9d36ac49d3bbcfe52a087b033 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 14:18:09 -0500 Subject: [PATCH 59/91] _x_old_opt only fine --- .../OptimalControl/mhdopt/OptLoop.cpp | 33 +++++++------------ .../OptimalControl/mhdopt/OptLoop.hpp | 2 +- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 6ca56da43..06f619b1c 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -82,11 +82,7 @@ namespace femus { OptLoop::~OptLoop() { - for (uint Level = 0; Level < _x_oldopt.size(); Level++) { - delete _x_oldopt[Level]; - } - - _x_oldopt.clear(); + delete _x_oldopt; } @@ -163,7 +159,7 @@ double lin_deltax_MHDCONT = 0.; #endif //nitialize Becont - _x_oldopt[NoLevels - 1]->zero(); //initialize Boldopt=0; + _x_oldopt->zero(); //initialize Boldopt=0; //OPTIMIZATION LOOP @@ -187,8 +183,8 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { eqnMHDCONT._x_old[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont _x_old " << eqnMHDCONT._x_old [NoLevels - 1]->linfty_norm() << std::endl; - _x_oldopt[NoLevels - 1]->close(); - std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt [NoLevels - 1]->linfty_norm() << std::endl; + _x_oldopt->close(); + std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; ////////////////// @@ -204,11 +200,11 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont _x_oold " << eqnMHDCONT._x_oold->linfty_norm() << std::endl; - _x_oldopt[NoLevels - 1]->close(); + _x_oldopt->close(); std::cout << "Linfty norm of Becont _x_oldopt " - << _x_oldopt [NoLevels - 1]->linfty_norm() << std::endl; + << _x_oldopt->linfty_norm() << std::endl; - eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt[NoLevels - 1],eqnMHDCONT._x_tmp [NoLevels - 1],1.- omega); + eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt,eqnMHDCONT._x_tmp [NoLevels - 1],1.- omega); eqnMHDCONT._x_tmp[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont x_old*omega + (1-omega)*xoold " << eqnMHDCONT._x_tmp [NoLevels - 1]->linfty_norm() << std::endl; @@ -321,7 +317,7 @@ if ( fabs(J - Jold) > epsJ /*|| 1*/ ) { //******* update Jold //you must update it only here, because here it is the good point to restart from Jold = J; #ifdef MHDCONT_EQUATIONS - *(_x_oldopt[NoLevels-1]) = *(eqnMHDCONT._x_old[NoLevels-1]); + *(_x_oldopt) = *(eqnMHDCONT._x_old[NoLevels-1]); #endif //this will be the new _x_oldopt? @@ -467,15 +463,10 @@ const uint delta_opt_step = opt_step - _t_idx_in; void OptLoop::init_equation_data(const SystemTwo* eqn) { -//======equation-specific vectors ===================== - _x_oldopt.resize(eqn->GetGridn()); - - for(uint Level = 0; Level < _x_oldopt.size(); Level++) { - uint n_glob = eqn->_dofmap._Dim[Level]; //is it already filled? Now yes!!!!!!!!! - _x_oldopt[Level] = NumericVector::build().release(); _x_oldopt[Level]->init(n_glob,false, SERIAL); - } - - + uint n_glob = eqn->_dofmap._Dim[eqn->GetGridn()-1]; + _x_oldopt = NumericVector::build().release(); + _x_oldopt->init(n_glob,false, SERIAL); + return; } diff --git a/applications/OptimalControl/mhdopt/OptLoop.hpp b/applications/OptimalControl/mhdopt/OptLoop.hpp index 4ead0870c..f77eff3b2 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.hpp +++ b/applications/OptimalControl/mhdopt/OptLoop.hpp @@ -28,7 +28,7 @@ class OptLoop : public TimeLoop { void init_equation_data(const SystemTwo* eqn); //====data - std::vector _x_oldopt; //old optimization step + NumericVector * _x_oldopt; //old optimization step }; From 139f50935ec49e6659c4de5cc9d38e5a107bbeb2 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 14:26:12 -0500 Subject: [PATCH 60/91] _x_tmp only fine --- applications/OptimalControl/mhdopt/OptLoop.cpp | 18 +++++++++--------- src/equations/SystemTwo.cpp | 11 ++++------- src/equations/SystemTwo.hpp | 2 +- src/equations/TimeLoop.cpp | 12 ++++++------ 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 06f619b1c..c1339b9d0 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -188,13 +188,13 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { ////////////////// - eqnMHDCONT._x_tmp[NoLevels-1]->zero(); - *(eqnMHDCONT._x_tmp[NoLevels-1]) = *(eqnMHDCONT._x_old[NoLevels-1]); - eqnMHDCONT._bcond.Bc_ScaleDofVec(eqnMHDCONT._x_tmp[NoLevels - 1], omega ); - eqnMHDCONT._x_tmp[NoLevels - 1]->close(); + eqnMHDCONT._x_tmp->zero(); + *(eqnMHDCONT._x_tmp) = *(eqnMHDCONT._x_old[NoLevels-1]); + eqnMHDCONT._bcond.Bc_ScaleDofVec(eqnMHDCONT._x_tmp, omega ); + eqnMHDCONT._x_tmp->close(); std::cout << "Omega " << omega << std::endl; std::cout << "Linfty norm of Becont _x_old*omega " - << eqnMHDCONT._x_tmp [NoLevels - 1]->linfty_norm() << std::endl; + << eqnMHDCONT._x_tmp->linfty_norm() << std::endl; eqnMHDCONT._x_oold->close(); std::cout << "Linfty norm of Becont _x_oold " @@ -204,12 +204,12 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; - eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt,eqnMHDCONT._x_tmp [NoLevels - 1],1.- omega); - eqnMHDCONT._x_tmp[NoLevels - 1]->close(); + eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt,eqnMHDCONT._x_tmp,1.- omega); + eqnMHDCONT._x_tmp->close(); std::cout << "Linfty norm of Becont x_old*omega + (1-omega)*xoold " - << eqnMHDCONT._x_tmp [NoLevels - 1]->linfty_norm() << std::endl; + << eqnMHDCONT._x_tmp->linfty_norm() << std::endl; - *(eqnMHDCONT._x_old[NoLevels-1]) = *(eqnMHDCONT._x_tmp[NoLevels-1]); + *(eqnMHDCONT._x_old[NoLevels-1]) = *(eqnMHDCONT._x_tmp); eqnMHDCONT._x_old[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont _x_old updated " diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 3f9c810e8..2e7901752 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -74,18 +74,16 @@ SystemTwo::~SystemTwo() { delete _res[Level]; delete _x[Level]; delete _x_old[Level]; - delete _x_tmp[Level]; + } - _b.clear(); _res.clear(); _x.clear(); _x_old.clear(); - _x_tmp.clear(); delete _x_oold; - + delete _x_tmp; } @@ -160,7 +158,6 @@ void SystemTwo::initVectors() { //allocation _x.resize(GetGridn()); _x_old.resize(GetGridn()); - _x_tmp.resize(GetGridn()); _b.resize(GetGridn()); _res.resize(GetGridn()); @@ -178,13 +175,13 @@ void SystemTwo::initVectors() { _x[Level]->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _x_old[Level] = NumericVector::build().release(); _x_old[Level]->init(_dofmap._Dim[Level],false, SERIAL); - _x_tmp[Level] = NumericVector::build().release(); - _x_tmp[Level]->init(_dofmap._Dim[Level],false, SERIAL); } //end level loop _x_oold = NumericVector::build().release(); _x_oold->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); + _x_tmp = NumericVector::build().release(); + _x_tmp->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); return; diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 15a61d226..122dcc9c1 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -85,7 +85,7 @@ class SystemTwo : public LinearImplicitSystem { std::vector _x_old; //// LinearEquation (each level) NumericVector * _x_oold; //this is used by MGTimeStep and also by the OptLoop - std::vector _x_tmp; //this is used by MGTimeStep and also by the OptLoop + NumericVector * _x_tmp; //this is used by MGTimeStep and also by the OptLoop void initVectors(); ///initialize vectors //System// diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 87b2c7cae..0ff8183c3 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -164,18 +164,18 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { #endif /// std::cout << "$$$$$$$$$ Check the convergence $$$$$$$" << std::endl; - eqn_in->_x_tmp[eqn_in->GetGridn()-1]->zero(); - eqn_in->_x_tmp[eqn_in->GetGridn()-1]->add(+1.,*(eqn_in->_x_oold)); - eqn_in->_x_tmp[eqn_in->GetGridn()-1]->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); + eqn_in->_x_tmp->zero(); + eqn_in->_x_tmp->add(+1.,*(eqn_in->_x_oold)); + eqn_in->_x_tmp->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_oold -x_old =actually= (x_old - x) //(x must not be touched, as you print from it) //x_oold must not be touched ! Because it's used later for UPDATING Becont! //so you must create a temporary vector necessarily. - eqn_in->_x_tmp[eqn_in->GetGridn()-1]->close(); - double deltax_norm = eqn_in->_x_tmp[eqn_in->GetGridn()-1]->l2_norm(); + eqn_in->_x_tmp->close(); + double deltax_norm = eqn_in->_x_tmp->l2_norm(); std::cout << " $$$$$$ " << eqn_in->name() << " error l2 " << deltax_norm << std::endl; - std::cout << " $$$$$$ " << eqn_in->name() << " error linfty " << eqn_in->_x_tmp[eqn_in->GetGridn()-1]->linfty_norm() << std::endl; + std::cout << " $$$$$$ " << eqn_in->name() << " error linfty " << eqn_in->_x_tmp->linfty_norm() << std::endl; //AAA when the vectors have nan's, the norm becomes zero! //when the residual norm in pre and post smoothing is too big, //then it doesnt do any iterations, the solver doesnt solve anymore, so the solution remains frozen From 38e0b85e6afded0d7a00e82eb16490caf7745785 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 17:16:31 -0500 Subject: [PATCH 61/91] Removed x_oold --- .../OptimalControl/mhdopt/OptLoop.cpp | 23 ++++++++++--------- src/equations/SystemTwo.cpp | 3 --- src/equations/SystemTwo.hpp | 1 - src/equations/TimeLoop.cpp | 11 +++++++-- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index c1339b9d0..923f2ea5e 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -177,14 +177,15 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { //xold there was a good value //xoold there was still the value multiplied // omega = 1.; //"omega=1" and "no if" is equal to the old loop - eqnMHDCONT._x_oold->close(); - std::cout << "Linfty norm of Becont _x_oold " << eqnMHDCONT._x_oold->linfty_norm() << std::endl; - - eqnMHDCONT._x_old[NoLevels - 1]->close(); - std::cout << "Linfty norm of Becont _x_old " << eqnMHDCONT._x_old [NoLevels - 1]->linfty_norm() << std::endl; - - _x_oldopt->close(); - std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; + +// // // eqnMHDCONT._x_oold->close(); +// // // std::cout << "Linfty norm of Becont _xoold " << eqnMHDCONT._x_oold->linfty_norm() << std::endl; +// // // +// // // eqnMHDCONT._x_old[NoLevels - 1]->close(); +// // // std::cout << "Linfty norm of Becont _x_old " << eqnMHDCONT._x_old [NoLevels - 1]->linfty_norm() << std::endl; +// // // +// // // _x_oldopt->close(); +// // // std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; ////////////////// @@ -196,9 +197,9 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont _x_old*omega " << eqnMHDCONT._x_tmp->linfty_norm() << std::endl; - eqnMHDCONT._x_oold->close(); - std::cout << "Linfty norm of Becont _x_oold " - << eqnMHDCONT._x_oold->linfty_norm() << std::endl; +// // // eqnMHDCONT._x_oold->close(); +// // // std::cout << "Linfty norm of Becont _xoold " +// // // << eqnMHDCONT._x_oold->linfty_norm() << std::endl; _x_oldopt->close(); std::cout << "Linfty norm of Becont _x_oldopt " diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 2e7901752..fdaf1d3b1 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -82,7 +82,6 @@ SystemTwo::~SystemTwo() { _x.clear(); _x_old.clear(); - delete _x_oold; delete _x_tmp; } @@ -178,8 +177,6 @@ void SystemTwo::initVectors() { } //end level loop - _x_oold = NumericVector::build().release(); - _x_oold->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); _x_tmp = NumericVector::build().release(); _x_tmp->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 122dcc9c1..bc7af4277 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -84,7 +84,6 @@ class SystemTwo : public LinearImplicitSystem { std::vector _x_old; //// LinearEquation (each level) - NumericVector * _x_oold; //this is used by MGTimeStep and also by the OptLoop NumericVector * _x_tmp; //this is used by MGTimeStep and also by the OptLoop void initVectors(); ///initialize vectors //System// diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 0ff8183c3..18967ae73 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -103,8 +103,12 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { std::cout << std::endl << " Solving " << eqn_in->name() << " , step " << iter << std::endl; + NumericVector * _x_oold = NumericVector::build().release(); + _x_oold->init(eqn_in->_dofmap._Dim[eqn_in->GetGridn()-1],false, SERIAL); + + ///A0) Put x_old into x_oold - *(eqn_in->_x_oold) = *(eqn_in->_x_old[eqn_in->GetGridn()-1]); + *(_x_oold) = *(eqn_in->_x_old[eqn_in->GetGridn()-1]); /// A) Assemblying #if DEFAULT_PRINT_TIME==1 @@ -165,7 +169,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { /// std::cout << "$$$$$$$$$ Check the convergence $$$$$$$" << std::endl; eqn_in->_x_tmp->zero(); - eqn_in->_x_tmp->add(+1.,*(eqn_in->_x_oold)); + eqn_in->_x_tmp->add(+1.,*(_x_oold)); eqn_in->_x_tmp->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_oold -x_old =actually= (x_old - x) //(x must not be touched, as you print from it) @@ -180,6 +184,9 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { //when the residual norm in pre and post smoothing is too big, //then it doesnt do any iterations, the solver doesnt solve anymore, so the solution remains frozen + // temp vector + delete _x_oold; + return deltax_norm; //TODO do we have to be based on l2norm or linfty norm??? } From 1ab6d37114452f71b55ace348ae4710aeb86ce08 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 17:34:19 -0500 Subject: [PATCH 62/91] Used auto_ptr to avoid explicit delete --- src/equations/SystemTwo.hpp | 4 +--- src/equations/TimeLoop.cpp | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index bc7af4277..9997fd323 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -70,9 +70,7 @@ class SystemTwo : public LinearImplicitSystem { void ReadMatrix(const std::string& name); // LinearEquation (each level) void ReadProl(const std::string& name); // LinearEquation (each level) void ReadRest(const std::string& name); // LinearEquation (each level) - void ComputeMatrix(); // LinearEquation (each level) - void ComputeProl(); // LinearEquation (each level) - void ComputeRest(); // LinearEquation (each level) + //======================================================================= //======== Vectors =============== (procs,levels) == diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 18967ae73..4ed8c15e4 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -103,7 +103,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { std::cout << std::endl << " Solving " << eqn_in->name() << " , step " << iter << std::endl; - NumericVector * _x_oold = NumericVector::build().release(); + std::auto_ptr _x_oold = NumericVector::build(); _x_oold->init(eqn_in->_dofmap._Dim[eqn_in->GetGridn()-1],false, SERIAL); @@ -184,9 +184,6 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { //when the residual norm in pre and post smoothing is too big, //then it doesnt do any iterations, the solver doesnt solve anymore, so the solution remains frozen - // temp vector - delete _x_oold; - return deltax_norm; //TODO do we have to be based on l2norm or linfty norm??? } From 2aad84fecf32a6d042949a0266f43852a72c9f86 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 17:44:48 -0500 Subject: [PATCH 63/91] _x_tmp2 local in OptLoop --- .../OptimalControl/mhdopt/OptLoop.cpp | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 923f2ea5e..2e7a3f961 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -188,14 +188,16 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { // // // std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; ////////////////// + NumericVector* _x_tmp2 = NumericVector::build().release(); + _x_tmp2->init(eqnMHDCONT._dofmap._Dim[eqnMHDCONT.GetGridn()-1],false, SERIAL); - eqnMHDCONT._x_tmp->zero(); - *(eqnMHDCONT._x_tmp) = *(eqnMHDCONT._x_old[NoLevels-1]); - eqnMHDCONT._bcond.Bc_ScaleDofVec(eqnMHDCONT._x_tmp, omega ); - eqnMHDCONT._x_tmp->close(); + _x_tmp2->zero(); + *(_x_tmp2) = *(eqnMHDCONT._x_old[NoLevels-1]); + eqnMHDCONT._bcond.Bc_ScaleDofVec(_x_tmp2, omega ); + _x_tmp2->close(); std::cout << "Omega " << omega << std::endl; std::cout << "Linfty norm of Becont _x_old*omega " - << eqnMHDCONT._x_tmp->linfty_norm() << std::endl; + << _x_tmp2->linfty_norm() << std::endl; // // // eqnMHDCONT._x_oold->close(); // // // std::cout << "Linfty norm of Becont _xoold " @@ -205,12 +207,12 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont _x_oldopt " << _x_oldopt->linfty_norm() << std::endl; - eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt,eqnMHDCONT._x_tmp,1.- omega); - eqnMHDCONT._x_tmp->close(); + eqnMHDCONT._bcond.Bc_AddScaleDofVec(_x_oldopt,_x_tmp2,1.- omega); + _x_tmp2->close(); std::cout << "Linfty norm of Becont x_old*omega + (1-omega)*xoold " - << eqnMHDCONT._x_tmp->linfty_norm() << std::endl; + << _x_tmp2->linfty_norm() << std::endl; - *(eqnMHDCONT._x_old[NoLevels-1]) = *(eqnMHDCONT._x_tmp); + *(eqnMHDCONT._x_old[NoLevels-1]) = *(_x_tmp2); eqnMHDCONT._x_old[NoLevels - 1]->close(); std::cout << "Linfty norm of Becont _x_old updated " @@ -453,7 +455,9 @@ while(lin_deltax_MHDCONT > eps_MHDCONT && k_MHDCONT < MaxIterMHDCONT ); const uint delta_opt_step = opt_step - _t_idx_in; if (delta_opt_step%print_step == 0) XDMFWriter::PrintSolLinear(_files.GetOutputPath(),opt_step,pseudo_opttimeval,e_map_in); //print sol.N.h5 and sol.N.xmf - + + delete _x_tmp2; //delete vector + } From 9d62f710d1e2099b1f85bc6e6cd8625a8505bdcd Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 17:57:19 -0500 Subject: [PATCH 64/91] Removed _x_tmp from SystemTwo --- src/equations/SystemTwo.cpp | 4 ---- src/equations/SystemTwo.hpp | 2 +- src/equations/TimeLoop.cpp | 14 ++++++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index fdaf1d3b1..9c498467a 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -82,7 +82,6 @@ SystemTwo::~SystemTwo() { _x.clear(); _x_old.clear(); - delete _x_tmp; } @@ -177,9 +176,6 @@ void SystemTwo::initVectors() { } //end level loop - _x_tmp = NumericVector::build().release(); - _x_tmp->init(_dofmap._Dim[GetGridn()-1],false, SERIAL); - return; } diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 9997fd323..dae28c7d3 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -82,7 +82,7 @@ class SystemTwo : public LinearImplicitSystem { std::vector _x_old; //// LinearEquation (each level) - NumericVector * _x_tmp; //this is used by MGTimeStep and also by the OptLoop + void initVectors(); ///initialize vectors //System// diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 4ed8c15e4..2b08dcae6 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -105,6 +105,8 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { std::auto_ptr _x_oold = NumericVector::build(); _x_oold->init(eqn_in->_dofmap._Dim[eqn_in->GetGridn()-1],false, SERIAL); + std::auto_ptr _x_tmp = NumericVector::build(); + _x_tmp->init(eqn_in->_dofmap._Dim[eqn_in->GetGridn()-1],false, SERIAL); ///A0) Put x_old into x_oold @@ -168,18 +170,18 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { #endif /// std::cout << "$$$$$$$$$ Check the convergence $$$$$$$" << std::endl; - eqn_in->_x_tmp->zero(); - eqn_in->_x_tmp->add(+1.,*(_x_oold)); - eqn_in->_x_tmp->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); + _x_tmp->zero(); + _x_tmp->add(+1.,*(_x_oold)); + _x_tmp->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_oold -x_old =actually= (x_old - x) //(x must not be touched, as you print from it) //x_oold must not be touched ! Because it's used later for UPDATING Becont! //so you must create a temporary vector necessarily. - eqn_in->_x_tmp->close(); - double deltax_norm = eqn_in->_x_tmp->l2_norm(); + _x_tmp->close(); + double deltax_norm = _x_tmp->l2_norm(); std::cout << " $$$$$$ " << eqn_in->name() << " error l2 " << deltax_norm << std::endl; - std::cout << " $$$$$$ " << eqn_in->name() << " error linfty " << eqn_in->_x_tmp->linfty_norm() << std::endl; + std::cout << " $$$$$$ " << eqn_in->name() << " error linfty " << _x_tmp->linfty_norm() << std::endl; //AAA when the vectors have nan's, the norm becomes zero! //when the residual norm in pre and post smoothing is too big, //then it doesnt do any iterations, the solver doesnt solve anymore, so the solution remains frozen From 35be127c78c873b07128848b417a8547c68d8343 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 18:14:18 -0500 Subject: [PATCH 65/91] I used _RESC to replace _b --- applications/OptimalControl/fe_test/EqnT.cpp | 6 +-- applications/OptimalControl/mhdopt/EqnMHD.cpp | 8 ++-- .../OptimalControl/mhdopt/EqnMHDAD.cpp | 8 ++-- .../OptimalControl/mhdopt/EqnMHDCONT.cpp | 8 ++-- applications/OptimalControl/mhdopt/EqnNS.cpp | 8 ++-- .../OptimalControl/mhdopt/EqnNSAD.cpp | 8 ++-- applications/OptimalControl/tempopt/EqnNS.cpp | 8 ++-- applications/OptimalControl/tempopt/EqnT.cpp | 8 ++-- src/equations/SystemTwo.cpp | 42 +++++++++---------- src/equations/SystemTwo.hpp | 6 +-- 10 files changed, 55 insertions(+), 55 deletions(-) diff --git a/applications/OptimalControl/fe_test/EqnT.cpp b/applications/OptimalControl/fe_test/EqnT.cpp index 3bc18a6ed..3522d6282 100644 --- a/applications/OptimalControl/fe_test/EqnT.cpp +++ b/applications/OptimalControl/fe_test/EqnT.cpp @@ -37,7 +37,7 @@ const uint space_dim = ml_prob._ml_msh->GetDimension(); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -274,7 +274,7 @@ for (uint fe = 0; fe < QL; fe++) { currelem.Mat().print_scientific(std::cout); my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop // ***************************************************************** @@ -288,7 +288,7 @@ for (uint fe = 0; fe < QL; fe++) { }//END VOLUME my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " Matrix and RHS assembled for equation " << my_system.name() diff --git a/applications/OptimalControl/mhdopt/EqnMHD.cpp b/applications/OptimalControl/mhdopt/EqnMHD.cpp index 18c05884e..c6f85721a 100644 --- a/applications/OptimalControl/mhdopt/EqnMHD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHD.cpp @@ -52,7 +52,7 @@ void GenMatRhsMHD(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr const uint space_dim = ml_prob._ml_msh->GetDimension(); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -336,7 +336,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop @@ -533,7 +533,7 @@ for (uint fe = 0; fe < QL; fe++) { // end BDRYelement gaussian integration loop my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -544,7 +544,7 @@ for (uint fe = 0; fe < QL; fe++) { // END BOUNDARY // ***************************************************************** my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level diff --git a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp index 9e30bf4ec..308837d42 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDAD.cpp @@ -48,7 +48,7 @@ const int NonStatMHDAD = (int) ml_prob.GetInputParser().get("NonStatMHDAD"); const uint space_dim = ml_prob._ml_msh->GetDimension(); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -301,7 +301,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop @@ -421,7 +421,7 @@ for (uint fe = 0; fe < QL; fe++) { } //gauss my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); }//elem loop @@ -429,7 +429,7 @@ for (uint fe = 0; fe < QL; fe++) { }//END BOUNDARY ************************ my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level diff --git a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp index 3ce20645b..3493736eb 100644 --- a/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp +++ b/applications/OptimalControl/mhdopt/EqnMHDCONT.cpp @@ -58,7 +58,7 @@ using namespace femus; //=========================== my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -352,7 +352,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop @@ -474,7 +474,7 @@ const double phii_g = currgp._phi_ndsQLVB_g[BeOld._FEord][i]; //================================================================== my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } //end bdry element loop @@ -485,7 +485,7 @@ const double phii_g = currgp._phi_ndsQLVB_g[BeOld._FEord][i]; // END BOUNDARY // ************************** my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level diff --git a/applications/OptimalControl/mhdopt/EqnNS.cpp b/applications/OptimalControl/mhdopt/EqnNS.cpp index 9b91a44f1..8cf5db62b 100644 --- a/applications/OptimalControl/mhdopt/EqnNS.cpp +++ b/applications/OptimalControl/mhdopt/EqnNS.cpp @@ -138,7 +138,7 @@ const int NonStatNS = (int) ml_prob.GetInputParser().get("NonStatNS"); const uint space_dim = ml_prob._ml_msh->GetDimension(); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -526,7 +526,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop @@ -667,7 +667,7 @@ for (uint fe = 0; fe < QL; fe++) { //================================================================== my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -678,7 +678,7 @@ for (uint fe = 0; fe < QL; fe++) { // END BOUNDARY ****************************** my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level diff --git a/applications/OptimalControl/mhdopt/EqnNSAD.cpp b/applications/OptimalControl/mhdopt/EqnNSAD.cpp index c82306355..3dbc7dd2d 100644 --- a/applications/OptimalControl/mhdopt/EqnNSAD.cpp +++ b/applications/OptimalControl/mhdopt/EqnNSAD.cpp @@ -48,7 +48,7 @@ const int NonStatNSAD = (int) ml_prob.GetInputParser().get("NonStatNSAD"); const uint space_dim = ml_prob._ml_msh->GetDimension(); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -306,7 +306,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop @@ -428,14 +428,14 @@ for (uint fe = 0; fe < QL; fe++) { } //gauss my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); }//elem loop }//END BOUNDARY ************************ my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO std::cout << " GenMatRhs " << my_system.name() << ": assembled Level " << Level diff --git a/applications/OptimalControl/tempopt/EqnNS.cpp b/applications/OptimalControl/tempopt/EqnNS.cpp index 2786fc175..807bbc29d 100644 --- a/applications/OptimalControl/tempopt/EqnNS.cpp +++ b/applications/OptimalControl/tempopt/EqnNS.cpp @@ -63,7 +63,7 @@ //================================================ my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== Mesh *mymsh = ml_prob._ml_msh->GetLevel(Level); @@ -356,7 +356,7 @@ for (uint fe = 0; fe < QL; fe++) { /// Add element matrix and rhs to the global ones. my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -502,7 +502,7 @@ for (uint fe = 0; fe < QL; fe++) { //================================================================== my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } @@ -513,7 +513,7 @@ for (uint fe = 0; fe < QL; fe++) { // END BOUNDARY ****************************** my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO diff --git a/applications/OptimalControl/tempopt/EqnT.cpp b/applications/OptimalControl/tempopt/EqnT.cpp index acf47c5c0..643b0b4b0 100644 --- a/applications/OptimalControl/tempopt/EqnT.cpp +++ b/applications/OptimalControl/tempopt/EqnT.cpp @@ -109,7 +109,7 @@ void GenMatRhsT(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gri std::vector Qflux_g(space_dim); my_system._LinSolver[Level]->_KK->zero(); - my_system._b[Level]->zero(); + my_system._LinSolver[Level]->_RESC->zero(); // ========================================== // ========================================== @@ -395,7 +395,7 @@ for (uint fe = 0; fe < QL; fe++) { } // end of the quadrature point qp-loop my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of element loop // ***************************************************************** @@ -521,7 +521,7 @@ int el_Neum_flag=0; // end BDRYelement gaussian integration loop my_system._LinSolver[Level]->_KK->add_matrix(currelem.Mat(),currelem.GetDofIndices()); - my_system._b[Level]->add_vector(currelem.Rhs(),currelem.GetDofIndices()); + my_system._LinSolver[Level]->_RESC->add_vector(currelem.Rhs(),currelem.GetDofIndices()); } // end of BDRYelement loop @@ -530,7 +530,7 @@ int el_Neum_flag=0; }//END BOUNDARY my_system._LinSolver[Level]->_KK->close(); - my_system._b[Level]->close(); + my_system._LinSolver[Level]->_RESC->close(); #ifdef DEFAULT_PRINT_INFO diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 9c498467a..005744c13 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -70,14 +70,14 @@ SystemTwo::~SystemTwo() { //======== Vectors ========================== for (uint Level =0; Levelinit(_dofmap._Dim[Level],m_l,false,AUTOMATIC); + _LinSolver[Level]->_RESC = NumericVector::build().release(); + _LinSolver[Level]->_RESC->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _res[Level] = NumericVector::build().release(); _res[Level]->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _x[Level] = NumericVector::build().release(); @@ -365,14 +365,14 @@ void SystemTwo::MGSolve(double Eps1, // tolerance for the linear solver #endif double res_fine; - _b[GetGridn()-1]->close(); - double bNorm_fine = _b[GetGridn()-1]->l2_norm(); + _LinSolver[GetGridn()-1]->_RESC->close(); + double bNorm_fine = _LinSolver[GetGridn()-1]->_RESC->l2_norm(); _x_old[GetGridn()-1]->close(); double x_old_fine = _x_old[GetGridn()-1]->l2_norm(); #ifdef DEFAULT_PRINT_INFO std::cout << " bNorm_fine l2 " << bNorm_fine << std::endl; - std::cout << " bNorm_fine linfty " << _b[GetGridn()-1]->linfty_norm() << std::endl; + std::cout << " bNorm_fine linfty " << _LinSolver[GetGridn()-1]->_RESC->linfty_norm() << std::endl; std::cout << " xold_fine l2 " << x_old_fine << std::endl; #endif @@ -458,14 +458,14 @@ double SystemTwo::MGStep(int Level, // Level #ifdef DEFAULT_PRINT_CONV _x[Level]->close(); double xNorm0=_x[Level]->linfty_norm(); - _b[Level]->close(); - double bNorm0=_b[Level]->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNorm0=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); double ANorm0=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANorm0 << " bNorm linfty " << bNorm0 << " xNormINITIAL linfty " << xNorm0 << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level #ifdef DEFAULT_PRINT_CONV std::cout << " Coarse sol : res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -473,7 +473,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << " Norm of x after the coarse solution " << _x[Level]->linfty_norm() << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK); //************ compute the coarse residual + _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK); //************ compute the coarse residual _res[Level]->close(); std::cout << "COARSE Level " << Level << " res linfty " << _res[Level]->linfty_norm() << " res l2 " << _res[Level]->l2_norm() << std::endl; @@ -489,14 +489,14 @@ double SystemTwo::MGStep(int Level, // Level #ifdef DEFAULT_PRINT_CONV _x[Level]->close(); double xNormpre=_x[Level]->linfty_norm(); - _b[Level]->close(); - double bNormpre=_b[Level]->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNormpre=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); double ANormpre=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANormpre << " bNorm linfty " << bNormpre << " xNormINITIAL linfty " << xNormpre << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level #ifdef DEFAULT_PRINT_CONV std::cout << " Pre Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -506,13 +506,13 @@ double SystemTwo::MGStep(int Level, // Level std::cout << " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK);//********** compute the residual + _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK);//********** compute the residual /// std::cout << "************ END ONE PRE-SMOOTHING *****************"<< std::endl; /// std::cout << ">>>>>>>> BEGIN ONE DESCENT >>>>>>>>>>"<< std::endl; - _b[Level-1]->matrix_mult(*_res[Level],*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) + _LinSolver[Level-1]->_RESC->matrix_mult(*_res[Level],*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) _x[Level-1]->close(); //initial value of x for the presmoothing iterations _x[Level-1]->zero(); //initial value of x for the presmoothing iterations @@ -544,14 +544,14 @@ double SystemTwo::MGStep(int Level, // Level #ifdef DEFAULT_PRINT_CONV _x[Level]->close(); double xNormpost=_x[Level]->linfty_norm(); - _b[Level]->close(); - double bNormpost=_b[Level]->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNormpost=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); double ANormpost=_LinSolver[Level]->_KK->l1_norm(); std::cout << "Level " << Level << " ANorm l1 " << ANormpost << " bNorm linfty " << bNormpost << " xNormINITIAL linfty " << xNormpost << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level #ifdef DEFAULT_PRINT_CONV std::cout<<" Post Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -561,7 +561,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout<< " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_b[Level],*_x[Level],*_LinSolver[Level]->_KK); //******* compute the residual + _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK); //******* compute the residual /// std::cout << "************ END ONE POST-SMOOTHING *****************"<< std::endl; diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index dae28c7d3..d35406bfe 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -76,11 +76,11 @@ class SystemTwo : public LinearImplicitSystem { //======== Vectors =============== (procs,levels) == //======================================================================= - std::vector _b; //// LinearEquation (each level) - std::vector _x; //// LinearEquation (each level) _EPS +// std::vector _b; //// LinearEquation (each level) _RESC std::vector _res; //// LinearEquation (each level) _RES + std::vector _x; //// LinearEquation (each level) _EPS - std::vector _x_old; //// LinearEquation (each level) + std::vector _x_old; //// LinearEquation (each level) _EPSC From 87d8d760df54374de6b31ca68ed83fbf86587394 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 18:35:09 -0500 Subject: [PATCH 66/91] I used _EPS to replace _x --- src/equations/SystemTwo.cpp | 88 +++++++++++++++---------------------- src/equations/SystemTwo.hpp | 4 +- src/equations/TimeLoop.cpp | 2 +- src/solution/XDMFWriter.cpp | 4 +- 4 files changed, 40 insertions(+), 58 deletions(-) diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 005744c13..be8e80c3a 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -57,29 +57,14 @@ SystemTwo::SystemTwo(MultiLevelProblem& e_map_in, const std::string & eqname_in, LinearImplicitSystem(e_map_in,eqname_in,number,smoother_type) { } -// =================================================== -/// This function is the SystemTwo destructor. -//the important thing is that these destructions occur AFTER -//the destructions of the levels inside -//these things were allocated and filled in various init functions -//either in the Base or in the DA -//here, we destroy them in the place where they belong -// pay attention to the fact that a lot of these delete are ok only if the respective function -// where the new is is called! SystemTwo::~SystemTwo() { //======== Vectors ========================== for (uint Level =0; Level_RESC = NumericVector::build().release(); _LinSolver[Level]->_RESC->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); - _res[Level] = NumericVector::build().release(); - _res[Level]->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); - _x[Level] = NumericVector::build().release(); - _x[Level]->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); + _LinSolver[Level]->_RES = NumericVector::build().release(); + _LinSolver[Level]->_RES->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); + _LinSolver[Level]->_EPS = NumericVector::build().release(); + _LinSolver[Level]->_EPS->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _x_old[Level] = NumericVector::build().release(); _x_old[Level]->init(_dofmap._Dim[Level],false, SERIAL); @@ -294,7 +276,7 @@ void SystemTwo::Initialize() { _UnknownQuantitiesVector[q]->initialize_xyz(&xp[0],value); const int dof_pos_lev = _dofmap.GetDofQuantityComponent(Level,_UnknownQuantitiesVector[q],ivar,fine_node); - _x[Level]->set( dof_pos_lev, value[ivar] ); + _LinSolver[Level]->_EPS->set( dof_pos_lev, value[ivar] ); } //dof objects } @@ -315,7 +297,7 @@ void SystemTwo::Initialize() { const int elem_lev = iel + sum_elems_prev_sd_at_lev; const int dof_pos_lev = _dofmap.GetDofQuantityComponent(Level,_UnknownQuantitiesVector[q],ivar,elem_lev); - _x[Level]->set( dof_pos_lev, value[ivar] ); + _LinSolver[Level]->_EPS->set( dof_pos_lev, value[ivar] ); } //k } //ivar @@ -327,7 +309,7 @@ void SystemTwo::Initialize() { } // end of element loop - _x[Level]->localize(*_x_old[Level]); + _LinSolver[Level]->_EPS->localize(*_x_old[Level]); _x_old[Level]->close(); } //end Level @@ -379,7 +361,7 @@ void SystemTwo::MGSolve(double Eps1, // tolerance for the linear solver // FAS Multigrid (Nested) --------- bool NestedMG=false; if (NestedMG) { - _x[0]->zero(); + _LinSolver[0]->_EPS->zero(); MGStep(0,1.e-20,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); //smooth on the coarse level WITH PHYSICAL b ! @@ -387,7 +369,7 @@ void SystemTwo::MGSolve(double Eps1, // tolerance for the linear solver for (uint Level = 1; Level < GetGridn(); Level++) { - _x[Level]->matrix_mult(*_x[Level-1],*_LinSolver[Level]->_PP); //**** project the solution + _LinSolver[Level]->_EPS->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP); //**** project the solution res_fine = MGStep(Level,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); @@ -456,8 +438,8 @@ double SystemTwo::MGStep(int Level, // Level /// std::cout << "************ REACHED THE BOTTOM *****************"<< std::endl; #ifdef DEFAULT_PRINT_CONV - _x[Level]->close(); - double xNorm0=_x[Level]->linfty_norm(); + _LinSolver[Level]->_EPS->close(); + double xNorm0=_LinSolver[Level]->_EPS->linfty_norm(); _LinSolver[Level]->_RESC->close(); double bNorm0=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); @@ -465,18 +447,18 @@ double SystemTwo::MGStep(int Level, // Level std::cout << "Level " << Level << " ANorm l1 " << ANorm0 << " bNorm linfty " << bNorm0 << " xNormINITIAL linfty " << xNorm0 << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level #ifdef DEFAULT_PRINT_CONV std::cout << " Coarse sol : res-norm: " << rest.second << " n-its: " << rest.first << std::endl; - _x[Level]->close(); - std::cout << " Norm of x after the coarse solution " << _x[Level]->linfty_norm() << std::endl; + _LinSolver[Level]->_EPS->close(); + std::cout << " Norm of x after the coarse solution " << _LinSolver[Level]->_EPS->linfty_norm() << std::endl; #endif - _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK); //************ compute the coarse residual + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //************ compute the coarse residual - _res[Level]->close(); - std::cout << "COARSE Level " << Level << " res linfty " << _res[Level]->linfty_norm() << " res l2 " << _res[Level]->l2_norm() << std::endl; + _LinSolver[Level]->_RES->close(); + std::cout << "COARSE Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; } @@ -487,8 +469,8 @@ double SystemTwo::MGStep(int Level, // Level std::clock_t start_time=std::clock(); #endif #ifdef DEFAULT_PRINT_CONV - _x[Level]->close(); - double xNormpre=_x[Level]->linfty_norm(); + _LinSolver[Level]->_EPS->close(); + double xNormpre=_LinSolver[Level]->_EPS->linfty_norm(); _LinSolver[Level]->_RESC->close(); double bNormpre=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); @@ -496,7 +478,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << "Level " << Level << " ANorm l1 " << ANormpre << " bNorm linfty " << bNormpre << " xNormINITIAL linfty " << xNormpre << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level #ifdef DEFAULT_PRINT_CONV std::cout << " Pre Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -506,15 +488,15 @@ double SystemTwo::MGStep(int Level, // Level std::cout << " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK);//********** compute the residual + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK);//********** compute the residual /// std::cout << "************ END ONE PRE-SMOOTHING *****************"<< std::endl; /// std::cout << ">>>>>>>> BEGIN ONE DESCENT >>>>>>>>>>"<< std::endl; - _LinSolver[Level-1]->_RESC->matrix_mult(*_res[Level],*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) - _x[Level-1]->close(); //initial value of x for the presmoothing iterations - _x[Level-1]->zero(); //initial value of x for the presmoothing iterations + _LinSolver[Level-1]->_RESC->matrix_mult(*_LinSolver[Level]->_RES,*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) + _LinSolver[Level-1]->_EPS->close(); //initial value of x for the presmoothing iterations + _LinSolver[Level-1]->_EPS->zero(); //initial value of x for the presmoothing iterations for (uint g=1; g <= Gamma; g++) MGStep(Level-1,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); //***** call MGStep for another possible descent @@ -523,17 +505,17 @@ double SystemTwo::MGStep(int Level, // Level /// std::cout << ">>>>>>>> BEGIN ONE ASCENT >>>>>>>>"<< std::endl; #ifdef DEFAULT_PRINT_CONV - _res[Level-1]->close(); - std::cout << "BEFORE PROL Level " << Level << " res linfty " << _res[Level-1]->linfty_norm() << " res l2 " << _res[Level-1]->l2_norm() << std::endl; + _LinSolver[Level-1]->_RES->close(); + std::cout << "BEFORE PROL Level " << Level << " res linfty " << _LinSolver[Level-1]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level-1]->_RES->l2_norm() << std::endl; #endif - _res[Level]->matrix_mult(*_x[Level-1],*_LinSolver[Level]->_PP);//******** project the dx from the coarser grid + _LinSolver[Level]->_RES->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP);//******** project the dx from the coarser grid #ifdef DEFAULT_PRINT_CONV - _res[Level]->close(); + _LinSolver[Level]->_RES->close(); //here, the _res contains the prolongation of dx, so the new x is x_old + P dx - std::cout << "AFTER PROL Level " << Level << " res linfty " << _res[Level]->linfty_norm() << " res l2 " << _res[Level]->l2_norm() << std::endl; + std::cout << "AFTER PROL Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; #endif - _x[Level]->add(*_res[Level]);// adding the coarser residual to x + _LinSolver[Level]->_EPS->add(*_LinSolver[Level]->_RES);// adding the coarser residual to x //initial value of x for the post-smoothing iterations //_b is the same as before /// std::cout << "************ BEGIN ONE POST-SMOOTHING *****************"<< std::endl; @@ -542,8 +524,8 @@ double SystemTwo::MGStep(int Level, // Level start_time=std::clock(); #endif #ifdef DEFAULT_PRINT_CONV - _x[Level]->close(); - double xNormpost=_x[Level]->linfty_norm(); + _LinSolver[Level]->_EPS->close(); + double xNormpost=_LinSolver[Level]->_EPS->linfty_norm(); _LinSolver[Level]->_RESC->close(); double bNormpost=_LinSolver[Level]->_RESC->linfty_norm(); _LinSolver[Level]->_KK->close(); @@ -551,7 +533,7 @@ double SystemTwo::MGStep(int Level, // Level std::cout << "Level " << Level << " ANorm l1 " << ANormpost << " bNorm linfty " << bNormpost << " xNormINITIAL linfty " << xNormpost << std::endl; #endif - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_x[Level],*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level #ifdef DEFAULT_PRINT_CONV std::cout<<" Post Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; @@ -561,13 +543,13 @@ double SystemTwo::MGStep(int Level, // Level std::cout<< " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; #endif - _res[Level]->resid(*_LinSolver[Level]->_RESC,*_x[Level],*_LinSolver[Level]->_KK); //******* compute the residual + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //******* compute the residual /// std::cout << "************ END ONE POST-SMOOTHING *****************"<< std::endl; } - _res[Level]->close(); + _LinSolver[Level]->_RES->close(); return rest.second; //it returns the residual norm of whatever level you are in // if this is the l2_norm then also the nonlinear solver is computed in the l2 norm diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index d35406bfe..eb0f62220 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -77,8 +77,8 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= // std::vector _b; //// LinearEquation (each level) _RESC - std::vector _res; //// LinearEquation (each level) _RES - std::vector _x; //// LinearEquation (each level) _EPS +// std::vector _res; //// LinearEquation (each level) _RES +// std::vector _x; //// LinearEquation (each level) _EPS std::vector _x_old; //// LinearEquation (each level) _EPSC diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index 2b08dcae6..bcae41752 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -164,7 +164,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { /// std::cout << "$$$$$$$$$ Computed the x with the MG method $$$$$$$" << std::endl; /// E) Update of the old solution at the top Level - eqn_in->_x[eqn_in->GetGridn()-1]->localize(*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_old = x + eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPS->localize(*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_old = x #ifdef DEFAULT_PRINT_INFO std::cout << "$$$$$$$$$ Updated the x_old solution $$$$$$$$$" << std::endl; #endif diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 865910306..57ed410ff 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -1156,12 +1156,12 @@ void XDMFWriter::read_system_solutions(const std::string namefile, const MultiLe uint elem_gidx=(iel+mesh->_off_el[VV][mesh->_iproc*mesh->_NoLevels+mesh->_NoLevels-1])*NVE[ mesh->_geomelem_flag[mesh->get_dim()-1] ][BIQUADR_FE]; for (uint i=0; i_el_map[VV][elem_gidx+i]; // the global node - eqn->_x[mesh->_NoLevels-1]->set(dofmap->GetDof(mesh->_NoLevels-1,QQ,ivar,k), sol[k]*Irefval); // set the field + eqn->_LinSolver[mesh->_NoLevels-1]->_EPS->set(dofmap->GetDof(mesh->_NoLevels-1,QQ,ivar,k), sol[k]*Irefval); // set the field } } } - eqn->_x[mesh->_NoLevels-1]->localize(* eqn->_x_old[mesh->_NoLevels-1]); + eqn->_LinSolver[mesh->_NoLevels-1]->_EPS->localize(* eqn->_x_old[mesh->_NoLevels-1]); // clean H5Fclose(file_id); delete []sol; From 183ad380461c13705c6fa3e54f9a048bcc090fd9 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 18:52:39 -0500 Subject: [PATCH 67/91] I used _EPSC to replace _x_old --- .../OptimalControl/mhdopt/OptLoop.cpp | 10 +++---- src/equations/CurrentQuantity.cpp | 2 +- src/equations/SystemTwo.cpp | 28 ++++--------------- src/equations/SystemTwo.hpp | 13 +-------- src/equations/TimeLoop.cpp | 10 ++----- src/solution/XDMFWriter.cpp | 8 +++--- 6 files changed, 20 insertions(+), 51 deletions(-) diff --git a/applications/OptimalControl/mhdopt/OptLoop.cpp b/applications/OptimalControl/mhdopt/OptLoop.cpp index 2e7a3f961..0e49ee6ab 100644 --- a/applications/OptimalControl/mhdopt/OptLoop.cpp +++ b/applications/OptimalControl/mhdopt/OptLoop.cpp @@ -192,7 +192,7 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { _x_tmp2->init(eqnMHDCONT._dofmap._Dim[eqnMHDCONT.GetGridn()-1],false, SERIAL); _x_tmp2->zero(); - *(_x_tmp2) = *(eqnMHDCONT._x_old[NoLevels-1]); + *(_x_tmp2) = *(eqnMHDCONT._LinSolver[NoLevels-1]->_EPSC); eqnMHDCONT._bcond.Bc_ScaleDofVec(_x_tmp2, omega ); _x_tmp2->close(); std::cout << "Omega " << omega << std::endl; @@ -212,11 +212,11 @@ for (uint opt_step = _t_idx_in + 1; opt_step <= _t_idx_final; opt_step++) { std::cout << "Linfty norm of Becont x_old*omega + (1-omega)*xoold " << _x_tmp2->linfty_norm() << std::endl; - *(eqnMHDCONT._x_old[NoLevels-1]) = *(_x_tmp2); + *(eqnMHDCONT._LinSolver[NoLevels-1]->_EPSC) = *(_x_tmp2); - eqnMHDCONT._x_old[NoLevels - 1]->close(); + eqnMHDCONT._LinSolver[NoLevels-1]->_EPSC->close(); std::cout << "Linfty norm of Becont _x_old updated " - << eqnMHDCONT._x_old [NoLevels - 1]->linfty_norm() << std::endl; + << eqnMHDCONT._LinSolver[NoLevels-1]->_EPSC->linfty_norm() << std::endl; // eqnMHDCONT.x[NoLevels - 1]->close(); @@ -320,7 +320,7 @@ if ( fabs(J - Jold) > epsJ /*|| 1*/ ) { //******* update Jold //you must update it only here, because here it is the good point to restart from Jold = J; #ifdef MHDCONT_EQUATIONS - *(_x_oldopt) = *(eqnMHDCONT._x_old[NoLevels-1]); + *(_x_oldopt) = *(eqnMHDCONT._LinSolver[NoLevels-1]->_EPSC); #endif //this will be the new _x_oldopt? diff --git a/src/equations/CurrentQuantity.cpp b/src/equations/CurrentQuantity.cpp index e0b36b5c6..384fc5e9b 100644 --- a/src/equations/CurrentQuantity.cpp +++ b/src/equations/CurrentQuantity.cpp @@ -281,7 +281,7 @@ void CurrentQuantity::GetElemDofs() { const uint dofkivar = _eqnptr->_dofmap.GetDofPosIn(Lev_pick_dof,DofObj + ivar*length_nodedof[vect_ord] + off_total); - if (vect_ord < KK ) { _val_dofs[indx] = ( *(_eqnptr->_x_old[Lev_pick_dof]) )(dofkivar); } + if (vect_ord < KK ) { _val_dofs[indx] = ( *( _eqnptr->_LinSolver[Lev_pick_dof]->_EPSC ) )(dofkivar); } } } diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index be8e80c3a..55d86eef5 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -57,20 +57,6 @@ SystemTwo::SystemTwo(MultiLevelProblem& e_map_in, const std::string & eqname_in, LinearImplicitSystem(e_map_in,eqname_in,number,smoother_type) { } -SystemTwo::~SystemTwo() { - - //======== Vectors ========================== - for (uint Level =0; Level_RES->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); _LinSolver[Level]->_EPS = NumericVector::build().release(); _LinSolver[Level]->_EPS->init(_dofmap._Dim[Level],m_l,false,AUTOMATIC); - _x_old[Level] = NumericVector::build().release(); - _x_old[Level]->init(_dofmap._Dim[Level],false, SERIAL); + _LinSolver[Level]->_EPSC = NumericVector::build().release(); + _LinSolver[Level]->_EPSC->init(_dofmap._Dim[Level],false, SERIAL); } //end level loop @@ -309,8 +293,8 @@ void SystemTwo::Initialize() { } // end of element loop - _LinSolver[Level]->_EPS->localize(*_x_old[Level]); - _x_old[Level]->close(); + _LinSolver[Level]->_EPS->localize(*_LinSolver[Level]->_EPSC); + _LinSolver[Level]->_EPSC->close(); } //end Level @@ -349,8 +333,8 @@ void SystemTwo::MGSolve(double Eps1, // tolerance for the linear solver _LinSolver[GetGridn()-1]->_RESC->close(); double bNorm_fine = _LinSolver[GetGridn()-1]->_RESC->l2_norm(); - _x_old[GetGridn()-1]->close(); - double x_old_fine = _x_old[GetGridn()-1]->l2_norm(); + _LinSolver[GetGridn()-1]->_EPSC->close(); + double x_old_fine = _LinSolver[GetGridn()-1]->_EPSC->l2_norm(); #ifdef DEFAULT_PRINT_INFO std::cout << " bNorm_fine l2 " << bNorm_fine << std::endl; diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index eb0f62220..57d161085 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -55,9 +55,6 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= SystemTwo(MultiLevelProblem & equations_map, const std::string & eq_name_in, const unsigned int number, const MgSmoother & smoother_type); //System// - ~SystemTwo(); //System// - - DofMap _dofmap; //// LinearEquation (each level) BoundaryConditions _bcond; @@ -71,18 +68,10 @@ class SystemTwo : public LinearImplicitSystem { void ReadProl(const std::string& name); // LinearEquation (each level) void ReadRest(const std::string& name); // LinearEquation (each level) - -//======================================================================= -//======== Vectors =============== (procs,levels) == -//======================================================================= - // std::vector _b; //// LinearEquation (each level) _RESC // std::vector _res; //// LinearEquation (each level) _RES // std::vector _x; //// LinearEquation (each level) _EPS - - std::vector _x_old; //// LinearEquation (each level) _EPSC - - +// std::vector _x_old; //// LinearEquation (each level) _EPSC void initVectors(); ///initialize vectors //System// diff --git a/src/equations/TimeLoop.cpp b/src/equations/TimeLoop.cpp index bcae41752..8aaa54943 100644 --- a/src/equations/TimeLoop.cpp +++ b/src/equations/TimeLoop.cpp @@ -110,7 +110,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { ///A0) Put x_old into x_oold - *(_x_oold) = *(eqn_in->_x_old[eqn_in->GetGridn()-1]); + *(_x_oold) = *( eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPSC ); /// A) Assemblying #if DEFAULT_PRINT_TIME==1 @@ -149,10 +149,6 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { eqn_in->MGSolve(DEFAULT_EPS_LSOLV, DEFAULT_MAXITS_LSOLV); -// // for (uint Level = 0 ; Level < GetGridn(); Level++) { -// // _solver[Level]->solve(*_LinSolver[Level]->_KK,*_x[Level],*_b[Level],1.e-6,40); -// // _x[Level]->localize(*_x_old[Level]); // x_old = x -// // } #if DEFAULT_PRINT_TIME==1 std::clock_t end_time_sol = std::clock(); @@ -164,7 +160,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { /// std::cout << "$$$$$$$$$ Computed the x with the MG method $$$$$$$" << std::endl; /// E) Update of the old solution at the top Level - eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPS->localize(*(eqn_in->_x_old[eqn_in->GetGridn()-1])); // x_old = x + eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPS->localize(*(eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPSC)); // x_old = x #ifdef DEFAULT_PRINT_INFO std::cout << "$$$$$$$$$ Updated the x_old solution $$$$$$$$$" << std::endl; #endif @@ -172,7 +168,7 @@ double TimeLoop::MGTimeStep(const uint iter, SystemTwo * eqn_in) const { _x_tmp->zero(); _x_tmp->add(+1.,*(_x_oold)); - _x_tmp->add(-1.,*(eqn_in->_x_old[eqn_in->GetGridn()-1])); + _x_tmp->add(-1.,*(eqn_in->_LinSolver[eqn_in->GetGridn()-1]->_EPSC)); // x_oold -x_old =actually= (x_old - x) //(x must not be touched, as you print from it) //x_oold must not be touched ! Because it's used later for UPDATING Becont! diff --git a/src/solution/XDMFWriter.cpp b/src/solution/XDMFWriter.cpp index 57ed410ff..10271d2e2 100644 --- a/src/solution/XDMFWriter.cpp +++ b/src/solution/XDMFWriter.cpp @@ -988,7 +988,7 @@ void XDMFWriter::write(const std::string namefile, const MultiLevelMeshTwo* mesh #ifndef NDEBUG if ( pos_on_Qnodes_lev >= (int) n_nodes_lev ) { std::cout << "^^^^^^^OUT OF THE ARRAY ^^^^^^" << std::endl; abort(); } #endif - sol_on_Qnodes[ pos_on_Qnodes_lev/* pos_in_mesh_obj*/ ] = (* eqn->_x_old[Level])(pos_in_sol_vec_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[QQ] ]; + sol_on_Qnodes[ pos_on_Qnodes_lev/* pos_in_mesh_obj*/ ] = (* eqn->_LinSolver[Level]->_EPSC )(pos_in_sol_vec_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[QQ] ]; pos_in_mesh_obj++; } } //end subd @@ -1030,7 +1030,7 @@ void XDMFWriter::write(const std::string namefile, const MultiLevelMeshTwo* mesh if ( pos_on_Qnodes_lev >= (int) n_nodes_lev ) { std::cout << "^^^^^^^OUT OF THE ARRAY ^^^^^^" << std::endl; abort(); } #endif - sol_on_Qnodes[ pos_on_Qnodes_lev ] = (*eqn->_x_old[Level])(pos_in_sol_vec_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[LL] ]; + sol_on_Qnodes[ pos_on_Qnodes_lev ] = ( *eqn->_LinSolver[Level]->_EPSC )(pos_in_sol_vec_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[LL] ]; } } @@ -1098,7 +1098,7 @@ void XDMFWriter::write(const std::string namefile, const MultiLevelMeshTwo* mesh int elem_lev = iel + sum_elems_prev_sd_at_lev; int dof_pos_lev = dofmap->GetDof(Level,KK,ivar,elem_lev); for (uint is = 0; is < NRE[mesh->_eltype_flag[VV]]; is++) { - sol_on_cells[cel*NRE[mesh->_eltype_flag[VV]] + is] = (* eqn->_x_old[Level])(dof_pos_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[KK] ]; + sol_on_cells[cel*NRE[mesh->_eltype_flag[VV]] + is] = (* eqn->_LinSolver[Level]->_EPSC)(dof_pos_lev) * eqn->_refvalue[ ivar + dofmap->_VarOff[KK] ]; } cel++; } @@ -1161,7 +1161,7 @@ void XDMFWriter::read_system_solutions(const std::string namefile, const MultiLe } } - eqn->_LinSolver[mesh->_NoLevels-1]->_EPS->localize(* eqn->_x_old[mesh->_NoLevels-1]); + eqn->_LinSolver[mesh->_NoLevels-1]->_EPS->localize(* eqn->_LinSolver[mesh->_NoLevels-1]->_EPSC); // clean H5Fclose(file_id); delete []sol; From 9713fda79f9b4b3f74e9e15a8deb854c283258e8 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 19:05:49 -0500 Subject: [PATCH 68/91] Moved MG routines to LinearImplicitSystem --- src/equations/LinearImplicitSystem.cpp | 240 +++++++++++++++++++++++++ src/equations/LinearImplicitSystem.hpp | 9 +- src/equations/SystemTwo.cpp | 233 ------------------------ src/equations/SystemTwo.hpp | 9 - 4 files changed, 248 insertions(+), 243 deletions(-) diff --git a/src/equations/LinearImplicitSystem.cpp b/src/equations/LinearImplicitSystem.cpp index 9209d1c53..33f9f1bd5 100644 --- a/src/equations/LinearImplicitSystem.cpp +++ b/src/equations/LinearImplicitSystem.cpp @@ -632,6 +632,246 @@ void LinearImplicitSystem::SetNumberOfSchurVariables(const unsigned short &NSchu } +// ================================================================= +// std::vector _b; //// LinearEquation (each level) _RESC +// std::vector _res; //// LinearEquation (each level) _RES +// std::vector _x; //// LinearEquation (each level) _EPS +// std::vector _x_old; //// LinearEquation (each level) _EPSC + +//if the residual norm is small enough,exit the cycle, and so also the MGSolve +//this is also the check for the single level solver +//what is the meaning of having multiple cycles for single-grid solver? +//they are all like just a single linear solver loop, where convergence has already been reached, +// and you do another check after the previous one in the linear solver loop +//the big question is: +///@todo why dont you do "res_fine < Eps1" +// instead of "res_fine < Eps1*(1.+ bNorm_fine)" ??? +//because one is for the absolute error and another one is for the relative error +/// This function solves the discrete problem with multigrid solver +void LinearImplicitSystem::MGSolve(double Eps1, // tolerance for the linear solver + int MaxIter, // n iterations + const uint Gamma, // Control V W cycle + const uint Nc_pre, // n pre-smoothing cycles + const uint Nc_coarse, // n coarse cycles + const uint Nc_post // n post-smoothing cycles + ) { + +#ifdef DEFAULT_PRINT_INFO + std::cout << "######### BEGIN MG SOLVE ########" << std::endl; +#endif + double res_fine; + + _LinSolver[GetGridn()-1]->_RESC->close(); + double bNorm_fine = _LinSolver[GetGridn()-1]->_RESC->l2_norm(); + _LinSolver[GetGridn()-1]->_EPSC->close(); + double x_old_fine = _LinSolver[GetGridn()-1]->_EPSC->l2_norm(); + +#ifdef DEFAULT_PRINT_INFO + std::cout << " bNorm_fine l2 " << bNorm_fine << std::endl; + std::cout << " bNorm_fine linfty " << _LinSolver[GetGridn()-1]->_RESC->linfty_norm() << std::endl; + std::cout << " xold_fine l2 " << x_old_fine << std::endl; +#endif + + // FAS Multigrid (Nested) --------- + bool NestedMG=false; + if (NestedMG) { + _LinSolver[0]->_EPS->zero(); + MGStep(0,1.e-20,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); + + //smooth on the coarse level WITH PHYSICAL b ! + //and compute the residual + + for (uint Level = 1; Level < GetGridn(); Level++) { + + _LinSolver[Level]->_EPS->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP); //**** project the solution + + res_fine = MGStep(Level,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); + + } + } // NestedMG + + // V or W cycle + int cycle = 0; + bool exit_mg = false; + + while (!exit_mg && cycle rest; + + if (Level == 0) { +/// std::cout << "************ REACHED THE BOTTOM *****************"<< std::endl; + +#ifdef DEFAULT_PRINT_CONV + _LinSolver[Level]->_EPS->close(); + double xNorm0=_LinSolver[Level]->_EPS->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNorm0=_LinSolver[Level]->_RESC->linfty_norm(); + _LinSolver[Level]->_KK->close(); + double ANorm0=_LinSolver[Level]->_KK->l1_norm(); + std::cout << "Level " << Level << " ANorm l1 " << ANorm0 << " bNorm linfty " << bNorm0 << " xNormINITIAL linfty " << xNorm0 << std::endl; +#endif + + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level + +#ifdef DEFAULT_PRINT_CONV + std::cout << " Coarse sol : res-norm: " << rest.second << " n-its: " << rest.first << std::endl; + _LinSolver[Level]->_EPS->close(); + std::cout << " Norm of x after the coarse solution " << _LinSolver[Level]->_EPS->linfty_norm() << std::endl; +#endif + + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //************ compute the coarse residual + + _LinSolver[Level]->_RES->close(); + std::cout << "COARSE Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; + + } + + else { + +/// std::cout << "************ BEGIN ONE PRE-SMOOTHING *****************"<< std::endl; +#ifdef DEFAULT_PRINT_TIME + std::clock_t start_time=std::clock(); +#endif +#ifdef DEFAULT_PRINT_CONV + _LinSolver[Level]->_EPS->close(); + double xNormpre=_LinSolver[Level]->_EPS->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNormpre=_LinSolver[Level]->_RESC->linfty_norm(); + _LinSolver[Level]->_KK->close(); + double ANormpre=_LinSolver[Level]->_KK->l1_norm(); + std::cout << "Level " << Level << " ANorm l1 " << ANormpre << " bNorm linfty " << bNormpre << " xNormINITIAL linfty " << xNormpre << std::endl; +#endif + + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level + +#ifdef DEFAULT_PRINT_CONV + std::cout << " Pre Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; +#endif +#ifdef DEFAULT_PRINT_TIME + std::clock_t end_time=std::clock(); + std::cout << " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; +#endif + + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK);//********** compute the residual + +/// std::cout << "************ END ONE PRE-SMOOTHING *****************"<< std::endl; + +/// std::cout << ">>>>>>>> BEGIN ONE DESCENT >>>>>>>>>>"<< std::endl; + + _LinSolver[Level-1]->_RESC->matrix_mult(*_LinSolver[Level]->_RES,*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) + _LinSolver[Level-1]->_EPS->close(); //initial value of x for the presmoothing iterations + _LinSolver[Level-1]->_EPS->zero(); //initial value of x for the presmoothing iterations + + for (uint g=1; g <= Gamma; g++) + MGStep(Level-1,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); //***** call MGStep for another possible descent + +//at this point you have certainly reached the COARSE level + +/// std::cout << ">>>>>>>> BEGIN ONE ASCENT >>>>>>>>"<< std::endl; +#ifdef DEFAULT_PRINT_CONV + _LinSolver[Level-1]->_RES->close(); + std::cout << "BEFORE PROL Level " << Level << " res linfty " << _LinSolver[Level-1]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level-1]->_RES->l2_norm() << std::endl; +#endif + + _LinSolver[Level]->_RES->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP);//******** project the dx from the coarser grid +#ifdef DEFAULT_PRINT_CONV + _LinSolver[Level]->_RES->close(); + //here, the _res contains the prolongation of dx, so the new x is x_old + P dx + std::cout << "AFTER PROL Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; +#endif + _LinSolver[Level]->_EPS->add(*_LinSolver[Level]->_RES);// adding the coarser residual to x + //initial value of x for the post-smoothing iterations + //_b is the same as before +/// std::cout << "************ BEGIN ONE POST-SMOOTHING *****************"<< std::endl; + // postsmooting (Nc_post) +#ifdef DEFAULT_PRINT_TIME + start_time=std::clock(); +#endif +#ifdef DEFAULT_PRINT_CONV + _LinSolver[Level]->_EPS->close(); + double xNormpost=_LinSolver[Level]->_EPS->linfty_norm(); + _LinSolver[Level]->_RESC->close(); + double bNormpost=_LinSolver[Level]->_RESC->linfty_norm(); + _LinSolver[Level]->_KK->close(); + double ANormpost=_LinSolver[Level]->_KK->l1_norm(); + std::cout << "Level " << Level << " ANorm l1 " << ANormpost << " bNorm linfty " << bNormpost << " xNormINITIAL linfty " << xNormpost << std::endl; +#endif + + rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level + +#ifdef DEFAULT_PRINT_CONV + std::cout<<" Post Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; +#endif +#ifdef DEFAULT_PRINT_TIME + end_time=std::clock(); + std::cout<< " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; +#endif + + _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //******* compute the residual + +/// std::cout << "************ END ONE POST-SMOOTHING *****************"<< std::endl; + + } + + _LinSolver[Level]->_RES->close(); + + return rest.second; //it returns the residual norm of whatever level you are in + // if this is the l2_norm then also the nonlinear solver is computed in the l2 norm + //WHAT NORM is THIS?!? l2, but PRECONDITIONED!!! + +} + + } //end namespace femus diff --git a/src/equations/LinearImplicitSystem.hpp b/src/equations/LinearImplicitSystem.hpp index 706c2d16f..cf4525957 100644 --- a/src/equations/LinearImplicitSystem.hpp +++ b/src/equations/LinearImplicitSystem.hpp @@ -24,7 +24,7 @@ #include "MgTypeEnum.hpp" #include "DirichletBCTypeEnum.hpp" #include "MgSmootherEnum.hpp" - +#include "FemusDefault.hpp" namespace femus { @@ -58,6 +58,13 @@ class LinearImplicitSystem : public ImplicitSystem { /** @deprecated Init the system PDE structures */ virtual void init_two(); + /** @deprecated Multigrid routine */ + void MGSolve(double Eps,int MaxIter, const uint Gamma=DEFAULT_MG_GAMMA, const uint Nc_pre=DEFAULT_NC_PRE,const uint Nc_coarse=DEFAULT_NC_COARSE,const uint Nc_post=DEFAULT_NC_POST); + + /** @deprecated Multigrid step routine */ + double MGStep(int Level,double Eps1,int MaxIter, const uint Gamma, const uint Nc_pre,const uint Nc_coarse,const uint Nc_post); + + /** Add a system level */ void AddSystemLevel(); /** diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 55d86eef5..3e21531e3 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -307,239 +307,6 @@ void SystemTwo::Initialize() { } -// ================================================================= -//if the residual norm is small enough,exit the cycle, and so also the MGSolve -//this is also the check for the single level solver -//what is the meaning of having multiple cycles for single-grid solver? -//they are all like just a single linear solver loop, where convergence has already been reached, -// and you do another check after the previous one in the linear solver loop -//the big question is: -///@todo why dont you do "res_fine < Eps1" -// instead of "res_fine < Eps1*(1.+ bNorm_fine)" ??? -//because one is for the absolute error and another one is for the relative error -/// This function solves the discrete problem with multigrid solver -void SystemTwo::MGSolve(double Eps1, // tolerance for the linear solver - int MaxIter, // n iterations - const uint Gamma, // Control V W cycle - const uint Nc_pre, // n pre-smoothing cycles - const uint Nc_coarse, // n coarse cycles - const uint Nc_post // n post-smoothing cycles - ) { - -#ifdef DEFAULT_PRINT_INFO - std::cout << "######### BEGIN MG SOLVE ########" << std::endl; -#endif - double res_fine; - - _LinSolver[GetGridn()-1]->_RESC->close(); - double bNorm_fine = _LinSolver[GetGridn()-1]->_RESC->l2_norm(); - _LinSolver[GetGridn()-1]->_EPSC->close(); - double x_old_fine = _LinSolver[GetGridn()-1]->_EPSC->l2_norm(); - -#ifdef DEFAULT_PRINT_INFO - std::cout << " bNorm_fine l2 " << bNorm_fine << std::endl; - std::cout << " bNorm_fine linfty " << _LinSolver[GetGridn()-1]->_RESC->linfty_norm() << std::endl; - std::cout << " xold_fine l2 " << x_old_fine << std::endl; -#endif - - // FAS Multigrid (Nested) --------- - bool NestedMG=false; - if (NestedMG) { - _LinSolver[0]->_EPS->zero(); - MGStep(0,1.e-20,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); - - //smooth on the coarse level WITH PHYSICAL b ! - //and compute the residual - - for (uint Level = 1; Level < GetGridn(); Level++) { - - _LinSolver[Level]->_EPS->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP); //**** project the solution - - res_fine = MGStep(Level,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); - - } - } // NestedMG - - // V or W cycle - int cycle = 0; - bool exit_mg = false; - - while (!exit_mg && cycle rest; - - if (Level == 0) { -/// std::cout << "************ REACHED THE BOTTOM *****************"<< std::endl; - -#ifdef DEFAULT_PRINT_CONV - _LinSolver[Level]->_EPS->close(); - double xNorm0=_LinSolver[Level]->_EPS->linfty_norm(); - _LinSolver[Level]->_RESC->close(); - double bNorm0=_LinSolver[Level]->_RESC->linfty_norm(); - _LinSolver[Level]->_KK->close(); - double ANorm0=_LinSolver[Level]->_KK->l1_norm(); - std::cout << "Level " << Level << " ANorm l1 " << ANorm0 << " bNorm linfty " << bNorm0 << " xNormINITIAL linfty " << xNorm0 << std::endl; -#endif - - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_LSOLV_C,Nc_coarse); //****** smooth on the coarsest level - -#ifdef DEFAULT_PRINT_CONV - std::cout << " Coarse sol : res-norm: " << rest.second << " n-its: " << rest.first << std::endl; - _LinSolver[Level]->_EPS->close(); - std::cout << " Norm of x after the coarse solution " << _LinSolver[Level]->_EPS->linfty_norm() << std::endl; -#endif - - _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //************ compute the coarse residual - - _LinSolver[Level]->_RES->close(); - std::cout << "COARSE Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; - - } - - else { - -/// std::cout << "************ BEGIN ONE PRE-SMOOTHING *****************"<< std::endl; -#ifdef DEFAULT_PRINT_TIME - std::clock_t start_time=std::clock(); -#endif -#ifdef DEFAULT_PRINT_CONV - _LinSolver[Level]->_EPS->close(); - double xNormpre=_LinSolver[Level]->_EPS->linfty_norm(); - _LinSolver[Level]->_RESC->close(); - double bNormpre=_LinSolver[Level]->_RESC->linfty_norm(); - _LinSolver[Level]->_KK->close(); - double ANormpre=_LinSolver[Level]->_KK->l1_norm(); - std::cout << "Level " << Level << " ANorm l1 " << ANormpre << " bNorm linfty " << bNormpre << " xNormINITIAL linfty " << xNormpre << std::endl; -#endif - - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST, Nc_pre); //****** smooth on the finer level - -#ifdef DEFAULT_PRINT_CONV - std::cout << " Pre Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; -#endif -#ifdef DEFAULT_PRINT_TIME - std::clock_t end_time=std::clock(); - std::cout << " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; -#endif - - _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK);//********** compute the residual - -/// std::cout << "************ END ONE PRE-SMOOTHING *****************"<< std::endl; - -/// std::cout << ">>>>>>>> BEGIN ONE DESCENT >>>>>>>>>>"<< std::endl; - - _LinSolver[Level-1]->_RESC->matrix_mult(*_LinSolver[Level]->_RES,*_LinSolver[Level-1]->_RR);//****** restrict the residual from the finer grid ( new rhs ) - _LinSolver[Level-1]->_EPS->close(); //initial value of x for the presmoothing iterations - _LinSolver[Level-1]->_EPS->zero(); //initial value of x for the presmoothing iterations - - for (uint g=1; g <= Gamma; g++) - MGStep(Level-1,Eps1,MaxIter,Gamma,Nc_pre,Nc_coarse,Nc_post); //***** call MGStep for another possible descent - -//at this point you have certainly reached the COARSE level - -/// std::cout << ">>>>>>>> BEGIN ONE ASCENT >>>>>>>>"<< std::endl; -#ifdef DEFAULT_PRINT_CONV - _LinSolver[Level-1]->_RES->close(); - std::cout << "BEFORE PROL Level " << Level << " res linfty " << _LinSolver[Level-1]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level-1]->_RES->l2_norm() << std::endl; -#endif - - _LinSolver[Level]->_RES->matrix_mult(*_LinSolver[Level-1]->_EPS,*_LinSolver[Level]->_PP);//******** project the dx from the coarser grid -#ifdef DEFAULT_PRINT_CONV - _LinSolver[Level]->_RES->close(); - //here, the _res contains the prolongation of dx, so the new x is x_old + P dx - std::cout << "AFTER PROL Level " << Level << " res linfty " << _LinSolver[Level]->_RES->linfty_norm() << " res l2 " << _LinSolver[Level]->_RES->l2_norm() << std::endl; -#endif - _LinSolver[Level]->_EPS->add(*_LinSolver[Level]->_RES);// adding the coarser residual to x - //initial value of x for the post-smoothing iterations - //_b is the same as before -/// std::cout << "************ BEGIN ONE POST-SMOOTHING *****************"<< std::endl; - // postsmooting (Nc_post) -#ifdef DEFAULT_PRINT_TIME - start_time=std::clock(); -#endif -#ifdef DEFAULT_PRINT_CONV - _LinSolver[Level]->_EPS->close(); - double xNormpost=_LinSolver[Level]->_EPS->linfty_norm(); - _LinSolver[Level]->_RESC->close(); - double bNormpost=_LinSolver[Level]->_RESC->linfty_norm(); - _LinSolver[Level]->_KK->close(); - double ANormpost=_LinSolver[Level]->_KK->l1_norm(); - std::cout << "Level " << Level << " ANorm l1 " << ANormpost << " bNorm linfty " << bNormpost << " xNormINITIAL linfty " << xNormpost << std::endl; -#endif - - rest = _LinSolver[Level]->solve(*_LinSolver[Level]->_KK,*_LinSolver[Level]->_KK,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_RESC,DEFAULT_EPS_PREPOST,Nc_post); //***** smooth on the coarser level - -#ifdef DEFAULT_PRINT_CONV - std::cout<<" Post Lev: " << Level << ", res-norm: " << rest.second << " n-its: " << rest.first << std::endl; -#endif -#ifdef DEFAULT_PRINT_TIME - end_time=std::clock(); - std::cout<< " time ="<< double(end_time- start_time) / CLOCKS_PER_SEC << std::endl; -#endif - - _LinSolver[Level]->_RES->resid(*_LinSolver[Level]->_RESC,*_LinSolver[Level]->_EPS,*_LinSolver[Level]->_KK); //******* compute the residual - -/// std::cout << "************ END ONE POST-SMOOTHING *****************"<< std::endl; - - } - - _LinSolver[Level]->_RES->close(); - - return rest.second; //it returns the residual norm of whatever level you are in - // if this is the l2_norm then also the nonlinear solver is computed in the l2 norm - //WHAT NORM is THIS?!? l2, but PRECONDITIONED!!! - -} // ========================================= void SystemTwo::ReadMGOps(const std::string output_path) { diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 57d161085..91f9abc42 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -68,17 +68,8 @@ class SystemTwo : public LinearImplicitSystem { void ReadProl(const std::string& name); // LinearEquation (each level) void ReadRest(const std::string& name); // LinearEquation (each level) -// std::vector _b; //// LinearEquation (each level) _RESC -// std::vector _res; //// LinearEquation (each level) _RES -// std::vector _x; //// LinearEquation (each level) _EPS -// std::vector _x_old; //// LinearEquation (each level) _EPSC - void initVectors(); ///initialize vectors //System// -//=================== - void MGSolve(double Eps,int MaxIter, const uint Gamma=DEFAULT_MG_GAMMA, const uint Nc_pre=DEFAULT_NC_PRE,const uint Nc_coarse=DEFAULT_NC_COARSE,const uint Nc_post=DEFAULT_NC_POST); //LinearImplicitSystem// - double MGStep(int Level,double Eps1,int MaxIter, const uint Gamma, const uint Nc_pre,const uint Nc_coarse,const uint Nc_post); //LinearImplicitSystem// - //======================================================================= //======= Quantities ========= //======================================================================= From aedc799d1a8bc323fc3ca6926b1a1a0a1730264c Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 19:30:37 -0500 Subject: [PATCH 69/91] Moved ReadMG functions as static in GenCase --- applications/OptimalControl/fe_test/main.cpp | 2 +- applications/OptimalControl/mhdopt/main.cpp | 2 +- applications/OptimalControl/tempopt/main.cpp | 2 +- src/algebra/PetscMatrix.hpp | 6 +- src/algebra/SparseMatrix.hpp | 13 +- src/equations/SystemTwo.cpp | 906 ------------------- src/equations/SystemTwo.hpp | 11 +- src/meshGencase/GenCase.cpp | 824 +++++++++++++++++ src/meshGencase/GenCase.hpp | 7 + 9 files changed, 845 insertions(+), 928 deletions(-) diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 0edd90a61..681475e35 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -154,7 +154,7 @@ //===================== sys -> _bcond.GenerateBdc(); //===================== - sys -> ReadMGOps(files.GetOutputPath()); + GenCase::ReadMGOps(files.GetOutputPath(),sys); } diff --git a/applications/OptimalControl/mhdopt/main.cpp b/applications/OptimalControl/mhdopt/main.cpp index 6f7e8de71..0587ca1e2 100644 --- a/applications/OptimalControl/mhdopt/main.cpp +++ b/applications/OptimalControl/mhdopt/main.cpp @@ -236,7 +236,7 @@ int main(int argc, char** argv) { //===================== sys -> _bcond.GenerateBdc(); //===================== - sys -> ReadMGOps(files.GetOutputPath()); + GenCase::ReadMGOps(files.GetOutputPath(),sys); } diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index 72b63a964..df8907fe0 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -193,7 +193,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr ///===================== sys -> _bcond.GenerateBdc(); //===================== - sys -> ReadMGOps(files.GetOutputPath()); + GenCase::ReadMGOps(files.GetOutputPath(),sys); } diff --git a/src/algebra/PetscMatrix.hpp b/src/algebra/PetscMatrix.hpp index 014741b02..d4d55ed12 100644 --- a/src/algebra/PetscMatrix.hpp +++ b/src/algebra/PetscMatrix.hpp @@ -121,9 +121,11 @@ class PetscMatrix : public SparseMatrix { int MatGetRowM(const int i_val,int cols[]=PETSC_NULL , double vals[]=PETSC_NULL ); // Setting ------------------------------------- - // update pattern - void update_sparsity_pattern_old (const Graph & sparsity_pattern); //TODO remove it soon + /** @deprecated */ + void update_sparsity_pattern_old (const Graph & sparsity_pattern); + void update_sparsity_pattern(const Graph &sparsity_pattern); ///< sparsity patter update (Graph) + void update_sparsity_pattern(int m,int n,int m_l,int n_l, ///< sparsity patter update (petsc) const std::vector n_oz,const std::vector n_nz); // set values diff --git a/src/algebra/SparseMatrix.hpp b/src/algebra/SparseMatrix.hpp index a78734e0f..2c43de31b 100644 --- a/src/algebra/SparseMatrix.hpp +++ b/src/algebra/SparseMatrix.hpp @@ -121,11 +121,10 @@ class SparseMatrix { /** Close flag */ virtual bool closed() const = 0; - // Updates the matrix sparsity pattern - /** Full sparsity update */ + /** @deprecated */ virtual void update_sparsity_pattern_old (const Graph &) =0; - /** To be Added */ + /** Full sparsity update */ virtual void update_sparsity_pattern (const Graph &) =0; /** Partial sparsity update */ @@ -216,7 +215,7 @@ class SparseMatrix { /** Print to the text file */ virtual void print_personal(std::ostream& os=std::cout) const = 0; - /** print to hdf5 files */ + /** @deprecated print to hdf5 files */ virtual void print_hdf5(const std::string name="NULL") const=0; // Read @@ -224,14 +223,14 @@ class SparseMatrix { void read(const std::string& name); /** Read from hdf5 files */ - /** Read lengths */ + /** @deprecated Read lengths */ virtual void read_len_hdf5(const std::string namefile,const int mode, int len_row[],int leng_off_row[]); - /** Read pos */ + /** @deprecated Read pos */ virtual void read_pos_hdf5(const std::string namefile, const int mode, int pos[]); - /** Read dimensions */ + /** @deprecated Read dimensions */ virtual void read_dim_hdf5(const std::string namefile, int dim[]); // Submatrices ------------------------------------------------------ diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 3e21531e3..7b31b3f81 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -308,912 +308,6 @@ void SystemTwo::Initialize() { -// ========================================= -void SystemTwo::ReadMGOps(const std::string output_path) { - - std::string f_matrix = DEFAULT_F_MATRIX; - std::string f_rest = DEFAULT_F_REST; - std::string f_prol = DEFAULT_F_PROL; - std::string ext_h5 = DEFAULT_EXT_H5; - - std::ostringstream filename; - std::string filename_base; - filename_base = output_path + "/"; - - filename.str(""); filename << filename_base << f_rest << ext_h5; - ReadRest(filename.str()); - - filename.str(""); filename << filename_base << f_matrix << ext_h5; - ReadMatrix(filename.str()); - - filename.str(""); filename << filename_base << f_prol << ext_h5; - ReadProl(filename.str()); - - return; -} - - - -//============================= -//This function depends on _iproc -//remember that a new does not vanish when inside a for loop, -//because the variable was declared outside -// it is NOT like a DECLARATION INSIDE - -//The point is that now we must be ready to READ the matrix, -//also the part with CONSTANT ELEMENTS. -//so we have to figure out how to put all the things together. -//basically we need to remember that we have a bunch of -// quantities that may be QQ, LL, KK, -// so eventually we'll have a certain number of QQ, LL and KK -//now, we simply have to decide HOW to ADD THEM in the MATRIX. -// so far, I think we can decide to put -//FIRST all the QQ, then LL, then KK. - -// The DofMap was already initialized much earlier than now. -// As a matter of fact, it was needed for setting the BC flags -// It would be nice not to have a lot of places where _Dim is recomputed... - -// initDofDim -// initDof -// initVectors - -//The GRAPH, or SPARSITY PATTERN, with PETSC functions can be filled JUST WITH ZEROS; -//but with LASPACK you need do put the DOF VALUES INSIDE. - -// so, I got an error that seems to tell me that I basically didn't fill the graph -//correctly. It seems like one processor fills it and the other ones do not, -//half of the lines seem to be unfilled. - -///@todo the std::cerr is not redirected to file, think of redirecting it also to file. -// The idea is that every output to terminal must be redirected to file. -// so printf must not be used - -// Every processor will call this function - -//Now, the dimension of "graph" is global, -// so it is the dimension of the whole - -//TODO: idea about SYNCHRONIZING OUTPUTS. -//I would really like all the outputs OF ALL THE LIBRARIES (HFD5, PETSC, MPI, LIBMESH) involved in FEMuS -//to be REDIRECTED to run_log, altogether. -//What is the best way to make it possible? -//I guess from shell, in principle. The point is how to generate the string for the time for the folder! -// I should use bash functions, make an environment variable, and let all the processes read that environment variable. -// And also, i would like to be able to choose whether to DUPLICATE them, -// so both to file and to std output, or only to file, or the other cases. - -//I need to have the TIME STRING. Bash has the date() function, I want to have it my way -//OK, THAT'S IT: date +%Y_%m_%d-%H_%M_%S - - - //TODO what is this mlinit used for?!? - // it is used to determine with WHAT DOF NUMBER the CURRENT PROCESSOR _iproc BEGINS. - // NOTICE THAT THE _NODE_DOF MAP IS FILLED COMPLETELY BY ALL PROCESSORS, - // BUT HERE IT IS READ IN PARALLEL BY EACH SEPARATE PROCESSOR !!! - //THEREFORE EACH PROCESSOR WILL START WITH ITS OWN INITIAL_DOF AND FINISH WITH ITS OWN FINAL_DOF. - //The difference between NODES and ELEMENTS is that for nodes - // we keep the offset as the FINEST NODES, because somehow - //we have to keep the correspondence with the NODES OF THE MESH, - //especially when we have to PRINT ON THE MESH - //as a matter of fact, we have to bring everything to the FINE MESH - //so we can view what happens on the FINE MESH - //every processor will fill QUADRATIC, LINEAR and CONSTANT DOFS - //being that these dofs belong to a given processor, they will be CONTIGUOUS in the matrix - // So you'll have - - // QQ LL KK || QQ LL KK || QQ LL KK - //< proc0 >||< proc1 >||< proc2 > - - // Now, consider the level to be FROZEN, we concentrate on the SUBDOMAINS - // Every processor will begin filling the rows at some point. - // Every processor has a range of rows, which is mrow_lev_proc_t - // Within this range you'll have to put QQ, LL and KK dofs - //so within this range you'll have a number of dofs for every fe given by mrow_lev_proc[r], - // of course each of them being multiplied by the number of variables of that type - // Now, you have to compare how you EXPLORE the NODE_DOF MAP and the MATRIX ROWS - //the node_dof map is basically separated into OFFSETS of GEOMETRICAL ENTITIES, - //so these ranges are BASED ON THE MESH GEOMETRICAL ENTITIES. - // every GEOMETRICAL ENTITY (NODE or ELEMENT) can have ONE OR MORE ASSOCIATED DOFS. - //NODES CAN HAVE QUADRATIC DOFS or LINEAR DOFS associated - //ELEMENTS CAN HAVE CONSTANT DOFS associated. - //so, the node dof is constructed by picking - // FIRST NODE QUADRATIC DOFS, for all the quadratic unknowns of the system - // THEN NODE LINEAR DOFS, for all the linear unknowns of the system - // THEN ELEMENT CONSTANT DOFS, for all the constant unknowns of the system - // so "QUADRATIC NODES" can be defined as "NODES to which QUADRATIC VARIABLES are associated", - // "LINEAR NODES" means "NODES to which LINEAR variables are associated" - // ELEMENTS are "GEOMETRICAL ENTITIES to which CONSTANT variables are associated" - // So the node dof is divided by - // "GEOMETRICAL ENTITIES for QUADRATIC DOFS" = "QUADRATIC NODES", the length of which must be multiplied by the "NUMBER OF QUADRATIC DOF VARIABLES" - // "GEOMETRICAL ENTITIES for LINEAR DOFS" = "LINEAR NODES", the length of which must be multiplied by the "NUMBER OF LINEAR DOF VARIABLES" - // "GEOMETRICAL ENTITIES for CONSTANT DOFS" = "ELEMENTS" the length of which must be multiplied by the "NUMBER OF CONSTANT DOF VARIABLES" - //This of course assumes that every GEOMETRICAL ENTITY has the SAME NUMBER of ASSOCIATED DOFS for every FE type. - //So you may say that the node_dof is ordered by GEOMETRICAL ENTITIES first, and WITHIN EACH GEOMETRICAL ENTITY you find ALL THE VARIABLES of THAT FE TYPE. - // This is because actually we have a ONE-TO-ONE CORRESPONDENCE between GEOMETRICAL ENTITY and ASSOCIATED DOF. - // In a sense, we start with a given DOF family, and, going backwards, we ask ourselves "WHAT IS THE SET OF GEOMETRICAL ENTITIES NATURALLY ASSOCIATED to THIS DOF FE Family?" - //For instance, we might have QUAD8 and QUAD9, and associate BOTH OF THEM to a "QUAD9 NODES".In that case we would have EMPTY points, - // and it is actually the same that happens when we have the LINEAR DOF FAMILY and we decide to associate the "QUADRATIC MESH NODES" to it for various reasons: multigrid, parallel computing, etc...) - //So our current situation is: - // QUADRATIC FE DOFS ---> QUADRATIC MESH NODES (at the FINE level) - // LINEAR FE DOFS ---> QUADRATIC MESH NODES (at the FINE level) - // CONSTANT FE DOFS ---> MESH ELEMENTS (at the CURRENT level) - //So, we see that for various reasons we may actually have EMPTY SPACES for two reasons: - // 1) BECAUSE we are at some level which is NOT THE FINE - // 2) even at the FINE Level, we have LINEAR FINE DOFS built on top of QUADRATIC FINE NODES - - //so, _nvars[QQ] is the number of QUADRATIC FE variables - - //NOW, THE POINT IS THIS: FOR EVERY SUBDOMAIN, Do we want to have ALL DOFS CONTIGUOUS or NOT? - //Yes, of course we want, so in the same subdomain we would have QUADRATIC DOFS, THEN LINEAR DOFS, THEN CONSTANT DOFS. - //Otherwise, we would have that dofs of the SAME SUBDOMAIN are DISJOINT. - //Keeping all the dofs of the same subdomain CONTIGUOUS, the equations do not change, they will be the same, - // but in this way we will have AS FEW OFF-PROCESSOR COLUMNS as POSSIBLE! - // So, we do need to BUILD the NODE-DOF MAP APPROPRIATELY for the PARALLEL CASE! - //Of course, in a SERIAL ENVIRONMENT everything works fine - -//======================= -//The dimension of the Graph is the total number of rows -// This Graph is the TOTAL GRAPH for ALL THE MATRIX -//The Graph is basically a std::VECTOR of std::VECTORS, -// therefore you can use the resize() function both on graph and on graph[]. -//Also, by the way, with std::vectors you have the overloading of the operator[] -//===================== - -// Now, the point is: What is mlinit[]? -// Now, based on the mesh Node and Element numbering, we built the node_dof map. -//Now we have to Read the ONE-VARIABLE-MATRICES for EVERY LEVEL, -//and USE THEM to BUILD THE WHOLE MATRIX WITH ALL THE VARIABLES and SO ON. -//Now, we already know how the dof map is. So we gave a number to every dof. -// So after doing the NODE ORDERING and ELEMENT ORDERING (VV and BB) in the GENCASE, -// now it is time to use those orderings consequently and have the -//DOF ORDERING. -//The node map was built in such a way that ALL the DOFS associated to DofObjects (Elems or Nodes) -//of a given subdomain be CONTIGUOUS in the DOF ROW INDEXING. -//Now, given this DOF ORDERING, every PROCESSOR WILL TAKE CARE of ITS OWN DOFS, -// which are contiguous by construction of the node_dof map; -// therefore every processor will pick that block of contiguous row numbers -// and to each of them it will associate the corresponding LENGTH and OFFLENGTH - -// Notice how GRAPH has GLOBAL dimension, but SINCE THIS READ MATRIX is PARALLEL, -//Then each processor will fill only PART OF IT. So, actually it makes no sense to make graph be GLOBAL -// and then have each processor only fill one part of it. - -//ReadMatrix NEEDS the NODE_DOF to be filled BEFORE - //Now, we have to understand these steps: - //1) How we GENERATE the SINGLE DOF VARIABLE sparsity pattern in Gencase; - //2) How we BUILD the NODE_DOF MAP in PARALLEL based on these SINGLE VARIABLE SPARSITY PATTERNS; - //3) How we READ the MATRIX SPARSITY PATTERNS and COMBINE THEM WITH the NODE_DOF. - - //Basically, you have to COMBINE the "DOFS" (Matrix.h5) with the "MESH" (mesh.h5). - -// The node_dof of course takes into account the NUMBER of VARIABLES for each FE type -// So, if the node_dof was not filled correctly, then when you - - -void SystemTwo::ReadMatrix(const std::string& namefile) { - - for (uint Level = 0; Level< GetGridn(); Level++) { - - std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Level; - - uint*** rowcln; //number of rows and columns for one variable couple - uint*** length_row; //for every FE row and FE column - uint*** length_offrow; - uint*** pos_row; - - rowcln = new uint**[QL]; - length_row = new uint**[QL]; - length_offrow = new uint**[QL]; - pos_row = new uint**[QL]; - - hid_t file = H5Fopen(namefile.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); - - for (int r=0;r_KK = SparseMatrix::build().release(); -// // _LinSolver[Level]->_KK->init(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); ///@todo BACK TO a REASONABLE INIT - - Graph graph; - graph.resize(mrow_glob_t); - graph._m = mrow_glob_t; - graph._n = ncol_glob_t; - graph._ml = mrow_lev_proc_t; - graph._nl = ncol_lev_proc_t; - graph._ml_start = _dofmap.GetStartDof(Level,off_proc); - // TODO is this used? I guess it is used by update_sparsity_pattern ! - // Every subdomain has a local set of dofs, and these dofs start at a specific point. - // Now, remember that GetMLProb().GetMeshTwo()._off_nd[QQ] should only be used for computing offsets, so differences. - // Here, it is used ALONE, because it gives you the NODE (in femus ordering) AT WHICH THE CURRENT SUBDOMAIN BEGINS, - //and then from _node_dof[Level] (which was already constructed) you get THE LOCAL DOF AT THE CURRENT LEVEL TO START FROM. - // Clearly, pay attention when you add elements, because in that case you would need to REDO the _node_dof map !!! - //TODO: also, what happens if you have a system with ONLY ELEMENT BASED DOFS?!? - - - int FELevel[QL]; - FELevel[QQ] = Level; - FELevel[LL] = (Level+GetGridn())%(GetGridn()+1); //This is the map for the level of the LINEAR DOFS - FELevel[KK] = Level; - - int off_onevar[QL]; - off_onevar[QQ] = GetMLProb().GetMeshTwo()._NoNodesXLev[GetGridn()-1]; - off_onevar[LL] = GetMLProb().GetMeshTwo()._NoNodesXLev[GetGridn()-1]; - off_onevar[KK] = GetMLProb().GetMeshTwo()._n_elements_vb_lev[VV][Level]; - - uint off_EachFEFromStart[QL]; - off_EachFEFromStart[QQ] = 0; - off_EachFEFromStart[LL] = _dofmap._nvars[QQ]*off_onevar[QQ]; - off_EachFEFromStart[KK] = _dofmap._nvars[QQ]*off_onevar[QQ] + _dofmap._nvars[LL]*off_onevar[LL]; - - //============== - for (int r=0;r_KK->update_sparsity_pattern_old(graph); - - // clean =============== - graph.clear(); - - for (int r=0;r_PP = SparseMatrix::build().release(); -// // // _Prl[ Lev_f ]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT - - // local matrix dimension - uint ml[QL]; uint nl[QL]; - for (int fe=0; fe_PP->update_sparsity_pattern_old(pattern); //TODO shall we make the two operations of updating sparsity pattern and setting values together? - -//=========== VALUES =================== - DenseMatrix *valmat; - std::vector tmp(1); - for (int fe=0; fe ind(pattern[irow].size()-1); - for (uint j=0; j_PP->add_matrix(*valmat,tmp,ind); - delete valmat; - } - } - } //end fe - - - for (int fe=0;fe_PP->close(); -// if (GetMLProb().GetMeshTwo()._iproc==0) _Prl[ Lev_f ]->print_personal(); -// _Prl[ Lev_f ]->print_graphic(false); //TODO should pass this true or false as a parameter - } //end levels - -#ifdef DEFAULT_PRINT_INFO - std::cout << " ReadProl(B): read Op " << name.c_str() << std::endl; -#endif - - return; -} - - - -// ================================================================= -//This function depends on _iproc -//TODO AAA This operator here DEPENDS on the BOUNDARY CONDITIONS -// while the prolongator does not depend on the bc's... CHECK THAT -//Also notice that the Matrix, Restriction and Prolongation sparsity patterns -//are assembled by looping over NODES. -// Then, the values are set with NODE LOOPS for Rest and Prol, -// and with ELEMENT LOOP for the MATRIX (the Assemble Function) -//Level goes from 0 to < GetGridn() - 1 ==> Level is COARSE here - -// uint Lev_c = Level; -// uint Lev_f = Level+1; - //with these you explore arrays that go from 0 to GetGridn() - 1 - //so where the distinction between QQ and LL is already made - // with the EXTENDED levels you explore things that have an additional level, - // and so can work both with QQ and with LL - //the point is: there are parts where you cannot use extended levels, and parts where you can - //for instance, in this routine the FINE LEVELS and the FINE EXTENDED LEVELS will both be ok, - //so we can use them in both cases, but we cannot say the same for the COARSE levels and ext levels - - //AAA fai molta attenzione: per esplorare la node_dof devi usare Lev_c e Lev_f, - //perche' sono legati ai DOF (devi pensare che la questione del mesh e' gia' risolta) -void SystemTwo::ReadRest(const std::string& name) { - - - for (uint Level = 0; Level< GetGridn() - 1; Level++) { - - uint Lev_c = Level; - uint Lev_f = Level+1; - - std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Lev_f << "_" << Lev_c; - - int** rowcln; - int** len; - int** lenoff; - int** Rest_pos; - double** Rest_val; - - rowcln = new int*[QL]; - len = new int*[QL]; - lenoff = new int*[QL]; - Rest_pos = new int*[QL]; - Rest_val = new double*[QL]; - - hid_t file = H5Fopen(name.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); - - for (int fe=0;fe_RR = SparseMatrix::build().release(); -// // // _Rst[Lev_c]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT //we have to do this before appropriately!!! - - int nrowt=0;int nclnt=0; - for (int fe=0;fe_RR->update_sparsity_pattern_old(pattern); //TODO see -// _Rst[Lev_c]->close(); -// if (GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(); //there is no print function for rectangular matrices, and print_personal doesnt seem to be working... -// la print stampa il contenuto, ma io voglio solo stampare lo sparsity pattern! - //Allora cosa faccio: riempio di zeri e poi la stampo! No, di zeri no!!! devi riempirla con qualcos'altro! -//TODO how can I print the sparsity pattern in Petsc BEFORE FILLING the MATRIX ?!?! - //============================== -//========= SET VALUES ========= -//============================== - - DenseMatrix *valmat; - std::vector tmp(1); - for (int fe=0;fe ind(pattern[irow].size()-1); -// std::cout << "\n ==== " << irow << ": "; - for (uint i1=0;i1_RR->add_matrix(*valmat,tmp,ind); - delete valmat; - }// end dof loop - } // end var loop - } //end fe - - for (int fe=0;fe_RR->close(); -// if (GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(std::cout); -// _Rst[Lev_c]->print_graphic(false); // TODO should pass this true or false as a parameter - - } //end levels - -#ifdef DEFAULT_PRINT_INFO - std::cout << " ReadRest(B): read Op " << name.c_str() << std::endl; -#endif - return; -} - - - - - - - - - - - - - -// // // // void SystemTwo::func_xyz() { - -// // // // // double xyz[dimension]; -// // // // double xez[dimension]; -// // // // -// // // // //Give the point xyz in the 'dimensional' domain -// // // // -// // // // //NONdimensionalize THE COORDINATES, -// // // // //but i think here they are already dimensionalized -// // // // //do a code that depends EXPLICITLY from what was done before. -// // // // //A good practice would be to check if something had been done before... -// // // // -// // // // -// // // // // find in which element my point is -// // // // -// // // // //get the dofs of that element, in some order -// // // // -// // // // //compute the coordinate transformation -// // // // //as we have to transform the real coordinates into canonical ones, -// // // // //we have to invert x = x(\xi) -// // // // //so we have to compute \xi as a function of x -// // // // -// // // // -// // // // xez[0]=0.16; -// // // // xez[1]=0.4867; -// // // // -// // // // double* lin_shapes = new double[_eldof[0][1]]; -// // // // -// // // // //void FE::shapes_xez(const uint ql, const uint el_ndof,const double* xez, double* shapes) { -// // // // //for now i'll take the linear from the quadratics... -// // // // _fe[0]->shapes_xez(1,_eldof[0][1],xez,lin_shapes); -// // // // -// // // // -// // // // //transform the nondimensional physical coordinates to the -// // // // //coordinates in the reference element (\xi \eta) -// // // // -// // // // //compute the shape functions at that reference elements -// // // // //first the domain was linear, now pick the quadratic shapes for velocity i.e. -// // // // double* quad_shapes = new double[_eldof[0][0]]; -// // // // -// // // // _fe[0]->shapes_xez(0,_eldof[0][0],xez,quad_shapes); -// // // // -// // // // double* quad_dofs = new double[_eldof[0][0]]; -// // // // for (uint i=0;i<_eldof[0][0];i++ ) quad_dofs[i]= 87.; -// // // // //clearly the order in which these dofs are given must be the same as the connectivity order! -// // // // // -// // // // -// // // // //do the sum and you get the value... -// // // // //scalar product in R^n, not R^dim -// // // // -// // // // double resu = _utils.dotN(quad_shapes,quad_dofs,_eldof[0][0]); -// // // // -// // // // std::cout << "The final result is " << resu << std::endl; -// // // // -// // // // //given the computed vector of dofs -// // // // //given the real point xyz -// // // // //compute the function at that point -// // // // //find which element I am in -// // // // //retrieve from the global dof only the dofs of THAT element -// // // // // for every dof, transform to the canonical element -// // // // //retrieve the shape fncs for every local dof -// // // // //translate the global coordinate into the local coordinate -// // // // //compute all the functions at the local coordinate -// // // // //multiply and you're done -// // // // //to test things you may first do them ALL INSIDE A FUNCTION, -// // // // // without calling from outside, then you put it in a -// // // // //MODULAR FASHION. -// // // // - - - - - -// return; -// // // // } diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 91f9abc42..7cf376514 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -59,16 +59,7 @@ class SystemTwo : public LinearImplicitSystem { BoundaryConditions _bcond; -//======================================================================= -//======== MG Ops ============ (procs,levels) ==== -//======================================================================= - - void ReadMGOps(const std::string output_path); // LinearEquation (each level) - void ReadMatrix(const std::string& name); // LinearEquation (each level) - void ReadProl(const std::string& name); // LinearEquation (each level) - void ReadRest(const std::string& name); // LinearEquation (each level) - - void initVectors(); ///initialize vectors //System// + void initVectors(); ///initialize vectors //System// //======================================================================= //======= Quantities ========= diff --git a/src/meshGencase/GenCase.cpp b/src/meshGencase/GenCase.cpp index 6e993ae0a..60d437b17 100644 --- a/src/meshGencase/GenCase.cpp +++ b/src/meshGencase/GenCase.cpp @@ -2114,6 +2114,830 @@ void GenCase::ComputeMaxElXNode() { } +// ========================================= +void GenCase::ReadMGOps(const std::string output_path, const SystemTwo * mysys) { + + std::string f_matrix = DEFAULT_F_MATRIX; + std::string f_rest = DEFAULT_F_REST; + std::string f_prol = DEFAULT_F_PROL; + std::string ext_h5 = DEFAULT_EXT_H5; + + std::ostringstream filename; + std::string filename_base; + filename_base = output_path + "/"; + + filename.str(""); filename << filename_base << f_rest << ext_h5; + ReadRest(filename.str(),mysys); + + filename.str(""); filename << filename_base << f_matrix << ext_h5; + ReadMatrix(filename.str(),mysys); + + filename.str(""); filename << filename_base << f_prol << ext_h5; + ReadProl(filename.str(),mysys); + + return; +} + + + +//============================= +//This function depends on _iproc +//remember that a new does not vanish when inside a for loop, +//because the variable was declared outside +// it is NOT like a DECLARATION INSIDE + +//The point is that now we must be ready to READ the matrix, +//also the part with CONSTANT ELEMENTS. +//so we have to figure out how to put all the things together. +//basically we need to remember that we have a bunch of +// quantities that may be QQ, LL, KK, +// so eventually we'll have a certain number of QQ, LL and KK +//now, we simply have to decide HOW to ADD THEM in the MATRIX. +// so far, I think we can decide to put +//FIRST all the QQ, then LL, then KK. + +// The DofMap was already initialized much earlier than now. +// As a matter of fact, it was needed for setting the BC flags +// It would be nice not to have a lot of places where _Dim is recomputed... + +// initDofDim +// initDof +// initVectors + +//The GRAPH, or SPARSITY PATTERN, with PETSC functions can be filled JUST WITH ZEROS; +//but with LASPACK you need do put the DOF VALUES INSIDE. + +// so, I got an error that seems to tell me that I basically didn't fill the graph +//correctly. It seems like one processor fills it and the other ones do not, +//half of the lines seem to be unfilled. + +///@todo the std::cerr is not redirected to file, think of redirecting it also to file. +// The idea is that every output to terminal must be redirected to file. +// so printf must not be used + +// Every processor will call this function + +//Now, the dimension of "graph" is global, +// so it is the dimension of the whole + +//TODO: idea about SYNCHRONIZING OUTPUTS. +//I would really like all the outputs OF ALL THE LIBRARIES (HFD5, PETSC, MPI, LIBMESH) involved in FEMuS +//to be REDIRECTED to run_log, altogether. +//What is the best way to make it possible? +//I guess from shell, in principle. The point is how to generate the string for the time for the folder! +// I should use bash functions, make an environment variable, and let all the processes read that environment variable. +// And also, i would like to be able to choose whether to DUPLICATE them, +// so both to file and to std output, or only to file, or the other cases. + +//I need to have the TIME STRING. Bash has the date() function, I want to have it my way +//OK, THAT'S IT: date +%Y_%m_%d-%H_%M_%S + + + //TODO what is this mlinit used for?!? + // it is used to determine with WHAT DOF NUMBER the CURRENT PROCESSOR _iproc BEGINS. + // NOTICE THAT THE _NODE_DOF MAP IS FILLED COMPLETELY BY ALL PROCESSORS, + // BUT HERE IT IS READ IN PARALLEL BY EACH SEPARATE PROCESSOR !!! + //THEREFORE EACH PROCESSOR WILL START WITH ITS OWN INITIAL_DOF AND FINISH WITH ITS OWN FINAL_DOF. + //The difference between NODES and ELEMENTS is that for nodes + // we keep the offset as the FINEST NODES, because somehow + //we have to keep the correspondence with the NODES OF THE MESH, + //especially when we have to PRINT ON THE MESH + //as a matter of fact, we have to bring everything to the FINE MESH + //so we can view what happens on the FINE MESH + //every processor will fill QUADRATIC, LINEAR and CONSTANT DOFS + //being that these dofs belong to a given processor, they will be CONTIGUOUS in the matrix + // So you'll have + + // QQ LL KK || QQ LL KK || QQ LL KK + //< proc0 >||< proc1 >||< proc2 > + + // Now, consider the level to be FROZEN, we concentrate on the SUBDOMAINS + // Every processor will begin filling the rows at some point. + // Every processor has a range of rows, which is mrow_lev_proc_t + // Within this range you'll have to put QQ, LL and KK dofs + //so within this range you'll have a number of dofs for every fe given by mrow_lev_proc[r], + // of course each of them being multiplied by the number of variables of that type + // Now, you have to compare how you EXPLORE the NODE_DOF MAP and the MATRIX ROWS + //the node_dof map is basically separated into OFFSETS of GEOMETRICAL ENTITIES, + //so these ranges are BASED ON THE MESH GEOMETRICAL ENTITIES. + // every GEOMETRICAL ENTITY (NODE or ELEMENT) can have ONE OR MORE ASSOCIATED DOFS. + //NODES CAN HAVE QUADRATIC DOFS or LINEAR DOFS associated + //ELEMENTS CAN HAVE CONSTANT DOFS associated. + //so, the node dof is constructed by picking + // FIRST NODE QUADRATIC DOFS, for all the quadratic unknowns of the system + // THEN NODE LINEAR DOFS, for all the linear unknowns of the system + // THEN ELEMENT CONSTANT DOFS, for all the constant unknowns of the system + // so "QUADRATIC NODES" can be defined as "NODES to which QUADRATIC VARIABLES are associated", + // "LINEAR NODES" means "NODES to which LINEAR variables are associated" + // ELEMENTS are "GEOMETRICAL ENTITIES to which CONSTANT variables are associated" + // So the node dof is divided by + // "GEOMETRICAL ENTITIES for QUADRATIC DOFS" = "QUADRATIC NODES", the length of which must be multiplied by the "NUMBER OF QUADRATIC DOF VARIABLES" + // "GEOMETRICAL ENTITIES for LINEAR DOFS" = "LINEAR NODES", the length of which must be multiplied by the "NUMBER OF LINEAR DOF VARIABLES" + // "GEOMETRICAL ENTITIES for CONSTANT DOFS" = "ELEMENTS" the length of which must be multiplied by the "NUMBER OF CONSTANT DOF VARIABLES" + //This of course assumes that every GEOMETRICAL ENTITY has the SAME NUMBER of ASSOCIATED DOFS for every FE type. + //So you may say that the node_dof is ordered by GEOMETRICAL ENTITIES first, and WITHIN EACH GEOMETRICAL ENTITY you find ALL THE VARIABLES of THAT FE TYPE. + // This is because actually we have a ONE-TO-ONE CORRESPONDENCE between GEOMETRICAL ENTITY and ASSOCIATED DOF. + // In a sense, we start with a given DOF family, and, going backwards, we ask ourselves "WHAT IS THE SET OF GEOMETRICAL ENTITIES NATURALLY ASSOCIATED to THIS DOF FE Family?" + //For instance, we might have QUAD8 and QUAD9, and associate BOTH OF THEM to a "QUAD9 NODES".In that case we would have EMPTY points, + // and it is actually the same that happens when we have the LINEAR DOF FAMILY and we decide to associate the "QUADRATIC MESH NODES" to it for various reasons: multigrid, parallel computing, etc...) + //So our current situation is: + // QUADRATIC FE DOFS ---> QUADRATIC MESH NODES (at the FINE level) + // LINEAR FE DOFS ---> QUADRATIC MESH NODES (at the FINE level) + // CONSTANT FE DOFS ---> MESH ELEMENTS (at the CURRENT level) + //So, we see that for various reasons we may actually have EMPTY SPACES for two reasons: + // 1) BECAUSE we are at some level which is NOT THE FINE + // 2) even at the FINE Level, we have LINEAR FINE DOFS built on top of QUADRATIC FINE NODES + + //so, _nvars[QQ] is the number of QUADRATIC FE variables + + //NOW, THE POINT IS THIS: FOR EVERY SUBDOMAIN, Do we want to have ALL DOFS CONTIGUOUS or NOT? + //Yes, of course we want, so in the same subdomain we would have QUADRATIC DOFS, THEN LINEAR DOFS, THEN CONSTANT DOFS. + //Otherwise, we would have that dofs of the SAME SUBDOMAIN are DISJOINT. + //Keeping all the dofs of the same subdomain CONTIGUOUS, the equations do not change, they will be the same, + // but in this way we will have AS FEW OFF-PROCESSOR COLUMNS as POSSIBLE! + // So, we do need to BUILD the NODE-DOF MAP APPROPRIATELY for the PARALLEL CASE! + //Of course, in a SERIAL ENVIRONMENT everything works fine + +//======================= +//The dimension of the Graph is the total number of rows +// This Graph is the TOTAL GRAPH for ALL THE MATRIX +//The Graph is basically a std::VECTOR of std::VECTORS, +// therefore you can use the resize() function both on graph and on graph[]. +//Also, by the way, with std::vectors you have the overloading of the operator[] +//===================== + +// Now, the point is: What is mlinit[]? +// Now, based on the mesh Node and Element numbering, we built the node_dof map. +//Now we have to Read the ONE-VARIABLE-MATRICES for EVERY LEVEL, +//and USE THEM to BUILD THE WHOLE MATRIX WITH ALL THE VARIABLES and SO ON. +//Now, we already know how the dof map is. So we gave a number to every dof. +// So after doing the NODE ORDERING and ELEMENT ORDERING (VV and BB) in the GENCASE, +// now it is time to use those orderings consequently and have the +//DOF ORDERING. +//The node map was built in such a way that ALL the DOFS associated to DofObjects (Elems or Nodes) +//of a given subdomain be CONTIGUOUS in the DOF ROW INDEXING. +//Now, given this DOF ORDERING, every PROCESSOR WILL TAKE CARE of ITS OWN DOFS, +// which are contiguous by construction of the node_dof map; +// therefore every processor will pick that block of contiguous row numbers +// and to each of them it will associate the corresponding LENGTH and OFFLENGTH + +// Notice how GRAPH has GLOBAL dimension, but SINCE THIS READ MATRIX is PARALLEL, +//Then each processor will fill only PART OF IT. So, actually it makes no sense to make graph be GLOBAL +// and then have each processor only fill one part of it. + +//ReadMatrix NEEDS the NODE_DOF to be filled BEFORE + //Now, we have to understand these steps: + //1) How we GENERATE the SINGLE DOF VARIABLE sparsity pattern in Gencase; + //2) How we BUILD the NODE_DOF MAP in PARALLEL based on these SINGLE VARIABLE SPARSITY PATTERNS; + //3) How we READ the MATRIX SPARSITY PATTERNS and COMBINE THEM WITH the NODE_DOF. + + //Basically, you have to COMBINE the "DOFS" (Matrix.h5) with the "MESH" (mesh.h5). + +// The node_dof of course takes into account the NUMBER of VARIABLES for each FE type +// So, if the node_dof was not filled correctly, then when you + + +void GenCase::ReadMatrix(const std::string& namefile, const SystemTwo * mysys) { + + for (uint Level = 0; Level< mysys->GetGridn(); Level++) { + + std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Level; + + uint*** rowcln; //number of rows and columns for one variable couple + uint*** length_row; //for every FE row and FE column + uint*** length_offrow; + uint*** pos_row; + + rowcln = new uint**[QL]; + length_row = new uint**[QL]; + length_offrow = new uint**[QL]; + pos_row = new uint**[QL]; + + hid_t file = H5Fopen(namefile.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); + + for (int r=0;rGetMLProb().GetMeshTwo()._NoLevels; + uint off_proc = NoLevels*mysys->GetMLProb().GetMeshTwo()._iproc; + + uint mrow_glob_t = 0; + for (int fe=0; fe_dofmap._nvars[fe]*rowcln[fe][fe][0]; + uint ncol_glob_t = mrow_glob_t; + + uint mrow_lev_proc_t = 0; + for (int fe=0; fe_dofmap._DofLocLevProcFE[Level][mysys->GetMLProb().GetMeshTwo()._iproc][fe]*mysys->_dofmap._nvars[fe]; + uint ncol_lev_proc_t = mrow_lev_proc_t; + + uint DofObjInit_lev_PrevProcs[QL]; // what is this? it is the ROW INDEX at which to begin for every processor + + for (int r=0; rGetMLProb().GetMeshTwo()._iproc; isubd++) { + DofObjInit_lev_PrevProcs[QQ] += mysys->_dofmap._DofLocLevProcFE[Level][isubd][QQ]; + DofObjInit_lev_PrevProcs[LL] += mysys->_dofmap._DofLocLevProcFE[Level][isubd][LL]; + DofObjInit_lev_PrevProcs[KK] += mysys->_dofmap._DofLocLevProcFE[Level][isubd][KK]; + } + + + mysys->_LinSolver[Level]->_KK = SparseMatrix::build().release(); +// // mysys->_LinSolver[Level]->_KK->init(_Dim[Level],_Dim[Level], mrow_lev_proc_t, mrow_lev_proc_t); ///@todo BACK TO a REASONABLE INIT + + Graph graph; + graph.resize(mrow_glob_t); + graph._m = mrow_glob_t; + graph._n = ncol_glob_t; + graph._ml = mrow_lev_proc_t; + graph._nl = ncol_lev_proc_t; + graph._ml_start = mysys->_dofmap.GetStartDof(Level,off_proc); + // TODO is this used? I guess it is used by update_sparsity_pattern ! + // Every subdomain has a local set of dofs, and these dofs start at a specific point. + // Now, remember that mysys->GetMLProb().GetMeshTwo()._off_nd[QQ] should only be used for computing offsets, so differences. + // Here, it is used ALONE, because it gives you the NODE (in femus ordering) AT WHICH THE CURRENT SUBDOMAIN BEGINS, + //and then from _node_dof[Level] (which was already constructed) you get THE LOCAL DOF AT THE CURRENT LEVEL TO START FROM. + // Clearly, pay attention when you add elements, because in that case you would need to REDO the _node_dof map !!! + //TODO: also, what happens if you have a system with ONLY ELEMENT BASED DOFS?!? + + + int FELevel[QL]; + FELevel[QQ] = Level; + FELevel[LL] = (Level+mysys->GetGridn())%(mysys->GetGridn()+1); //This is the map for the level of the LINEAR DOFS + FELevel[KK] = Level; + + int off_onevar[QL]; + off_onevar[QQ] = mysys->GetMLProb().GetMeshTwo()._NoNodesXLev[mysys->GetGridn()-1]; + off_onevar[LL] = mysys->GetMLProb().GetMeshTwo()._NoNodesXLev[mysys->GetGridn()-1]; + off_onevar[KK] = mysys->GetMLProb().GetMeshTwo()._n_elements_vb_lev[VV][Level]; + + uint off_EachFEFromStart[QL]; + off_EachFEFromStart[QQ] = 0; + off_EachFEFromStart[LL] = mysys->_dofmap._nvars[QQ]*off_onevar[QQ]; + off_EachFEFromStart[KK] = mysys->_dofmap._nvars[QQ]*off_onevar[QQ] + mysys->_dofmap._nvars[LL]*off_onevar[LL]; + + //============== + for (int r=0;r_dofmap._nvars[r]; ivar++) { + + for (uint DofObj_lev = DofObjInit_lev_PrevProcs[r]; DofObj_lev < DofObjInit_lev_PrevProcs[r] + mysys->_dofmap._DofLocLevProcFE[Level][mysys->GetMLProb().GetMeshTwo()._iproc][r]; DofObj_lev++) { + + int dof_pos, irow; + if (rGetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[FELevel[r]][ DofObj_lev ]; } + else if (r==KK) { dof_pos = DofObj_lev; } + irow = mysys->_dofmap.GetDof(Level,r,ivar,dof_pos); + + int len[QL]; for (int c=0;c_dofmap._nvars[c]*len[c]; + graph[irow].resize(rowsize + 1); //There is a +1 because in the last position you memorize the number of offset dofs in that row + + int lenoff[QL]; for (int c=0;c_dofmap._nvars[c]*lenoff[c]; + graph[irow][rowsize] = lenoff_size; // last stored value is the number of in-matrix nonzero off-diagonal values + + } + } + } //end r + +//=========================== + std::cout << " Matrix \n"; + graph.print(); +//=========================== + + mysys->_LinSolver[Level]->_KK->update_sparsity_pattern_old(graph); + + // clean =============== + graph.clear(); + + for (int r=0;rGetGridn(); Level++) { + + uint Lev_c = Level-1; + uint Lev_f = Level; + + int FEXLevel_c[QL]; + FEXLevel_c[QQ] = Level-1; //COARSE Level for QUADRATIC + FEXLevel_c[LL] = (Level-1+mysys->GetGridn())%(mysys->GetGridn()+1); + FEXLevel_c[KK] = Level-1; //COARSE Level for CONSTANT //TODO is this used? + int FEXLevel_f[QL]; + FEXLevel_f[QQ] = Level; //FINE Level for QUADRATIC + FEXLevel_f[LL] = Level-1; // AAA look at the symmetry, this is exactly (_n_levels + Level1 + 1)%(_n_levels + 1); ! //FINE Level for LINEAR: Level1=0 means coarse linear, a finer linear is the first coarse quadratic, and so on and so on + FEXLevel_f[KK] = Level; //FINE Level for CONSTANT //TODO is this used? + + std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Lev_c << "_" << Lev_f; + + int** rowcln; + int** len; + int** lenoff; + int** Prol_pos; + double** Prol_val; + + rowcln = new int*[QL]; + len = new int*[QL]; + lenoff = new int*[QL]; + Prol_pos = new int*[QL]; + Prol_val = new double*[QL]; + + hid_t file = H5Fopen(name.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); //TODO do I need to open it here for every level?!? + + for (int fe=0; feGetMLProb().GetMeshTwo()._iproc*mysys->GetGridn(); + + mysys->_LinSolver[Lev_f]->_PP = SparseMatrix::build().release(); +// // // _Prl[ Lev_f ]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT + + // local matrix dimension + uint ml[QL]; uint nl[QL]; + for (int fe=0; feGetMLProb().GetMeshTwo()._off_nd[fe][off_proc + Lev_f +1] - mysys->GetMLProb().GetMeshTwo()._off_nd[fe][off_proc]; // local quadratic //COARSE (rows) + nl[fe] = mysys->GetMLProb().GetMeshTwo()._off_nd[fe][off_proc + Lev_c +1] - mysys->GetMLProb().GetMeshTwo()._off_nd[fe][off_proc]; // global quadratic //FINE QUADRATIC (cols) + } + else if (fe == KK) { + ml[fe] = mysys->GetMLProb().GetMeshTwo()._off_el[VV][off_proc + Lev_f +1] - mysys->GetMLProb().GetMeshTwo()._off_el[VV][off_proc + Lev_f]; + nl[fe] = mysys->GetMLProb().GetMeshTwo()._off_el[VV][off_proc + Lev_c +1] - mysys->GetMLProb().GetMeshTwo()._off_el[VV][off_proc + Lev_c]; + } + } + // pattern dimension + int nrowt=0;int nclnt=0; + for (int fe=0;fe_dofmap._nvars[fe]*rowcln[fe][0]; + nclnt += mysys->_dofmap._nvars[fe]*rowcln[fe][1]; + } + + Graph pattern; + pattern.resize(nrowt); + pattern._m=nrowt; + pattern._n=nclnt; + pattern._ml = 0; + pattern._nl = 0; + for (int fe=0;fe_dofmap._nvars[fe]*ml[fe]; // local _m + pattern._nl += mysys->_dofmap._nvars[fe]*nl[fe]; // local _n + } + uint ml_start = mysys->_dofmap.GetStartDof(Level,off_proc); + pattern._ml_start = ml_start; + + uint ml_init[QL]; //up to the current processor + for (int fe=0;feGetMLProb().GetMeshTwo()._iproc; isubd++) { + if (fe < KK) ml_init[fe] += mysys->GetMLProb().GetMeshTwo()._off_nd[fe][isubd*mysys->GetGridn() + Lev_f +1] - mysys->GetMLProb().GetMeshTwo()._off_nd[fe][isubd*mysys->GetGridn()]; + else if (fe == KK) ml_init[fe] += mysys->GetMLProb().GetMeshTwo()._off_el[VV][isubd*mysys->GetGridn() + Lev_f +1] - mysys->GetMLProb().GetMeshTwo()._off_el[VV][isubd*mysys->GetGridn() + Lev_f]; + } + } + + //============= POSITION ========= + for (int fe=0;fe_dofmap._nvars[fe];ivar++) { + for (unsigned int i = ml_init[fe]; i < ml_init[fe]+ml[fe]; i++) { + int dof_pos_f; + if (fe < KK) dof_pos_f = mysys->GetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_f[fe] ][ i ]; //end fe < ql + else if (fe == KK) dof_pos_f = i; + + int irow = mysys->_dofmap.GetDof(Lev_f,fe,ivar,dof_pos_f); + + uint ncol = len[fe][i+1] - len[fe][i]; + uint noff = lenoff[fe][i+1] - lenoff[fe][i]; + pattern[irow].resize(ncol+1); + pattern[irow][ncol] = noff; +// #ifdef FEMUS_HAVE_LASPACK + for (uint j=0; jGetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_c[fe] ][ dof_pos_lev_c ]; + else if (fe == KK) dof_pos_c = dof_pos_lev_c; + + pattern[irow][j] = mysys->_dofmap.GetDof(Lev_c,fe,ivar,dof_pos_c); + } +// #endif + + } + }//end fe < KK + } //end fe + + + std::cout << "Printing Prolongator ===========" << std::endl; + pattern.print(); + mysys->_LinSolver[Lev_f]->_PP->update_sparsity_pattern_old(pattern); + +//=========== VALUES =================== + DenseMatrix *valmat; + std::vector tmp(1); + for (int fe=0; fe_dofmap._nvars[fe];ivar++) { + for (unsigned int i=ml_init[fe]; iGetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_f[fe] ][ i ]; //end fe < ql + else if (fe == KK) dof_pos_f = i; + + int irow = mysys->_dofmap.GetDof(Lev_f,fe,ivar,dof_pos_f); + + uint ncol = len[fe][i+1]-len[fe][i]; + tmp[0] = irow; + std::vector< uint> ind(pattern[irow].size()-1); + for (uint j=0; j_LinSolver[Lev_f]->_PP->add_matrix(*valmat,tmp,ind); + delete valmat; + } + } + } //end fe + + + for (int fe=0;fe_LinSolver[Lev_f]->_PP->close(); +// if (mysys->GetMLProb().GetMeshTwo()._iproc==0) _Prl[ Lev_f ]->print_personal(); +// _Prl[ Lev_f ]->print_graphic(false); //TODO should pass this true or false as a parameter + } //end levels + +#ifdef DEFAULT_PRINT_INFO + std::cout << " ReadProl(B): read Op " << name.c_str() << std::endl; +#endif + + return; +} + + + +// ================================================================= +//This function depends on _iproc +//TODO AAA This operator here DEPENDS on the BOUNDARY CONDITIONS +// while the prolongator does not depend on the bc's... CHECK THAT +//Also notice that the Matrix, Restriction and Prolongation sparsity patterns +//are assembled by looping over NODES. +// Then, the values are set with NODE LOOPS for Rest and Prol, +// and with ELEMENT LOOP for the MATRIX (the Assemble Function) +//Level goes from 0 to < GetGridn() - 1 ==> Level is COARSE here + +// uint Lev_c = Level; +// uint Lev_f = Level+1; + //with these you explore arrays that go from 0 to GetGridn() - 1 + //so where the distinction between QQ and LL is already made + // with the EXTENDED levels you explore things that have an additional level, + // and so can work both with QQ and with LL + //the point is: there are parts where you cannot use extended levels, and parts where you can + //for instance, in this routine the FINE LEVELS and the FINE EXTENDED LEVELS will both be ok, + //so we can use them in both cases, but we cannot say the same for the COARSE levels and ext levels + + //AAA fai molta attenzione: per esplorare la node_dof devi usare Lev_c e Lev_f, + //perche' sono legati ai DOF (devi pensare che la questione del mesh e' gia' risolta) +void GenCase::ReadRest(const std::string& name, const SystemTwo * mysys) { + + + for (uint Level = 0; Level< mysys->GetGridn() - 1; Level++) { + + uint Lev_c = Level; + uint Lev_f = Level+1; + + std::ostringstream groupname_lev; groupname_lev << "LEVEL" << Lev_f << "_" << Lev_c; + + int** rowcln; + int** len; + int** lenoff; + int** Rest_pos; + double** Rest_val; + + rowcln = new int*[QL]; + len = new int*[QL]; + lenoff = new int*[QL]; + Rest_pos = new int*[QL]; + Rest_val = new double*[QL]; + + hid_t file = H5Fopen(name.c_str(),H5F_ACC_RDWR, H5P_DEFAULT); + + for (int fe=0;feGetGridn()-1) ! + + int FEXLevel_c[QL]; + FEXLevel_c[QQ] = Level; //COARSE Level for QUADRATIC + FEXLevel_c[LL] = (mysys->GetGridn() + Level)%(mysys->GetGridn() + 1); //COARSE Level for LINEAR: Level1=0 means coarse linear, a finer linear is the first coarse quadratic, and so on and so on + FEXLevel_c[KK] = Level; //COARSE Level for CONSTANT + int FEXLevel_f[QL]; + FEXLevel_f[QQ] = Level+1; //FINE Level for QUADRATIC + FEXLevel_f[LL] = Level; // AAA look at the symmetry, this is exactly (_n_levels + Level1 + 1)%(_n_levels + 1); ! //FINE Level for LINEAR: Level1=0 means coarse linear, a finer linear is the first coarse quadratic, and so on and so on + FEXLevel_f[KK] = Level+1; //FINE Level for CONSTANT + + uint off_proc=mysys->GetGridn()*mysys->GetMLProb().GetMeshTwo()._iproc; + + mysys->_LinSolver[Lev_c]->_RR = SparseMatrix::build().release(); +// // // _Rst[Lev_c]->init(0,0,0,0); //TODO BACK TO A REASONABLE INIT //we have to do this before appropriately!!! + + int nrowt=0;int nclnt=0; + for (int fe=0;fe_dofmap._nvars[fe]*rowcln[fe][0]; + nclnt += mysys->_dofmap._nvars[fe]*rowcln[fe][1]; + } + + + Graph pattern; + pattern.resize(nrowt); + pattern._m = nrowt; + pattern._n = nclnt; // global dim _m x _n + pattern._ml = 0; // local _m + pattern._nl = 0; // local _n + for (int fe=0;fe_dofmap._nvars[fe]*mysys->_dofmap._DofLocLevProcFE[Lev_c][mysys->GetMLProb().GetMeshTwo()._iproc][fe]; + pattern._nl += mysys->_dofmap._nvars[fe]*mysys->_dofmap._DofLocLevProcFE[Lev_f][mysys->GetMLProb().GetMeshTwo()._iproc][fe]; + } + + // starting indices for local matrix + uint ml_start = mysys->_dofmap.GetStartDof(Lev_c,off_proc); // offset proc nodes + pattern._ml_start = ml_start; + uint DofObjInit_lev_PrevProcs_c[QL]; + for (int fe=0;feGetMLProb().GetMeshTwo()._iproc; isubd++) { //up to the current processor + if (fe < KK) /*mlinit*/ DofObjInit_lev_PrevProcs_c[fe] += mysys->GetMLProb().GetMeshTwo()._off_nd[fe][ isubd*mysys->GetGridn() + Lev_c +1 ] - mysys->GetMLProb().GetMeshTwo()._off_nd[fe][isubd*mysys->GetGridn()]; + else if (fe == KK) /*mlinit*/ DofObjInit_lev_PrevProcs_c[fe] += mysys->GetMLProb().GetMeshTwo()._off_el[VV][ isubd*mysys->GetGridn() + Lev_c +1 ] - mysys->GetMLProb().GetMeshTwo()._off_el[VV][isubd*mysys->GetGridn() + Lev_c]; + } + } + + //============= POSITION ========= + for (int fe=0; fe_dofmap._nvars[fe];ivar++) { + for (unsigned int i = DofObjInit_lev_PrevProcs_c[fe]; i< DofObjInit_lev_PrevProcs_c[fe] + mysys->_dofmap._DofLocLevProcFE[Lev_c][mysys->GetMLProb().GetMeshTwo()._iproc][fe]; i++) { + int dof_pos_c; + if (fe < KK) dof_pos_c = mysys->GetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_c[fe] ][ i ]; + else if (fe == KK) dof_pos_c = i; + + int irow = mysys->_dofmap.GetDof(Lev_c,fe,ivar,dof_pos_c); + + uint ncol = len[fe][i+1]-len[fe][i]; + uint noff = lenoff[fe][i+1] - lenoff[fe][i]; + pattern[irow].resize(ncol+1); //when you do resize, it puts a zero in all positions + pattern[irow][ncol] = noff; +// pattern structure (was for laspack only) + for (uint j=0; jGetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_f[fe] ][ dof_pos_lev_f ]; + else if (fe == KK) dof_pos_f = dof_pos_lev_f; + pattern[irow][j] = mysys->_dofmap.GetDof(Lev_f,fe,ivar,dof_pos_f); + } + + } + } + } //end fe loop + + + std::cout << "Printing Restrictor ===========" << std::endl; + pattern.print(); + mysys->_LinSolver[Lev_c]->_RR->update_sparsity_pattern_old(pattern); //TODO see +// _Rst[Lev_c]->close(); +// if (mysys->GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(); //there is no print function for rectangular matrices, and print_personal doesnt seem to be working... +// la print stampa il contenuto, ma io voglio solo stampare lo sparsity pattern! + //Allora cosa faccio: riempio di zeri e poi la stampo! No, di zeri no!!! devi riempirla con qualcos'altro! +//TODO how can I print the sparsity pattern in Petsc BEFORE FILLING the MATRIX ?!?! + //============================== +//========= SET VALUES ========= +//============================== + + DenseMatrix *valmat; + std::vector tmp(1); + for (int fe=0;fe_dofmap._nvars[fe];ivar++) { + for (unsigned int i = DofObjInit_lev_PrevProcs_c[fe]; i< DofObjInit_lev_PrevProcs_c[fe] + mysys->_dofmap._DofLocLevProcFE[Lev_c][mysys->GetMLProb().GetMeshTwo()._iproc][fe]; i++) { + int dof_pos_c; + if (fe < KK) dof_pos_c = mysys->GetMLProb().GetMeshTwo()._Qnode_lev_Qnode_fine[ FEXLevel_c[fe] ][ i ]; + else if (fe == KK) dof_pos_c = i; + int irow = mysys->_dofmap.GetDof(Lev_c,fe,ivar,dof_pos_c); + int irow_top = mysys->_dofmap.GetDof(mysys->GetGridn()-1,fe,ivar,dof_pos_c); + uint ncol = len[fe][i+1]-len[fe][i]; + tmp[0]=irow; + std::vector< uint> ind(pattern[irow].size()-1); +// std::cout << "\n ==== " << irow << ": "; + for (uint i1=0;i1_bcond._bc[irow_top]*Rest_val[fe][ j+len[fe][i] ]; + mysys->_LinSolver[Lev_c]->_RR->add_matrix(*valmat,tmp,ind); + delete valmat; + }// end dof loop + } // end var loop + } //end fe + + for (int fe=0;fe_LinSolver[Lev_c]->_RR->close(); +// if (mysys->GetMLProb().GetMeshTwo()._iproc==0) _Rst[Lev_c]->print_personal(std::cout); +// _Rst[Lev_c]->print_graphic(false); // TODO should pass this true or false as a parameter + + } //end levels + +#ifdef DEFAULT_PRINT_INFO + std::cout << " ReadRest(B): read Op " << name.c_str() << std::endl; +#endif + return; +} + + + + + + } //end namespace femus diff --git a/src/meshGencase/GenCase.hpp b/src/meshGencase/GenCase.hpp index 140ed3d68..d7ba36da4 100644 --- a/src/meshGencase/GenCase.hpp +++ b/src/meshGencase/GenCase.hpp @@ -15,6 +15,7 @@ #include "FemusInputParser.hpp" #include "ElemSto.hpp" #include "MultiLevelMeshTwo.hpp" +#include "SystemTwo.hpp" // libmesh #ifdef HAVE_LIBMESH @@ -45,6 +46,12 @@ class GenCase : public MultiLevelMeshTwo { void ComputeAndPrintMatrix(const std::string output_path); void ComputeAndPrintProl(const std::string output_path); void ComputeAndPrintRest(const std::string output_path); + + static void ReadMGOps(const std::string output_path, const SystemTwo * mysys); + static void ReadMatrix(const std::string& name, const SystemTwo * mysys); + static void ReadProl(const std::string& name, const SystemTwo * mysys); + static void ReadRest(const std::string& name, const SystemTwo * mysys); + void CreateMeshStructuresLevSubd(const std::string output_path); void Delete(); From a96ec87ce7a2047ba49060e4c7f1c26321018f01 Mon Sep 17 00:00:00 2001 From: Giorgio Bornia Date: Mon, 9 Mar 2015 19:40:07 -0500 Subject: [PATCH 70/91] Renamed init_unknown vars --- applications/OptimalControl/fe_test/main.cpp | 2 +- applications/OptimalControl/mhdopt/main.cpp | 2 +- applications/OptimalControl/tempopt/main.cpp | 2 +- src/equations/SystemTwo.cpp | 2 +- src/equations/SystemTwo.hpp | 8 +++----- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/applications/OptimalControl/fe_test/main.cpp b/applications/OptimalControl/fe_test/main.cpp index 681475e35..2be1a06b3 100644 --- a/applications/OptimalControl/fe_test/main.cpp +++ b/applications/OptimalControl/fe_test/main.cpp @@ -144,7 +144,7 @@ sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== - sys -> init_sys(); + sys -> init_unknown_vars(); //===================== sys -> _dofmap.ComputeMeshToDof(); //===================== diff --git a/applications/OptimalControl/mhdopt/main.cpp b/applications/OptimalControl/mhdopt/main.cpp index 0587ca1e2..3c58aa99e 100644 --- a/applications/OptimalControl/mhdopt/main.cpp +++ b/applications/OptimalControl/mhdopt/main.cpp @@ -226,7 +226,7 @@ int main(int argc, char** argv) { sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== - sys -> init_sys(); + sys -> init_unknown_vars(); //===================== sys -> _dofmap.ComputeMeshToDof(); //===================== diff --git a/applications/OptimalControl/tempopt/main.cpp b/applications/OptimalControl/tempopt/main.cpp index df8907fe0..a5a70ccc4 100644 --- a/applications/OptimalControl/tempopt/main.cpp +++ b/applications/OptimalControl/tempopt/main.cpp @@ -183,7 +183,7 @@ void GenMatRhsNS(MultiLevelProblem &ml_prob, unsigned Level, const unsigned &gr sys -> _LinSolver[0]->set_solver_type(GMRES); //if I keep PREONLY it doesn't run //===================== - sys -> init_sys(); + sys -> init_unknown_vars(); //===================== sys -> _dofmap.ComputeMeshToDof(); //===================== diff --git a/src/equations/SystemTwo.cpp b/src/equations/SystemTwo.cpp index 7b31b3f81..2e452fe47 100644 --- a/src/equations/SystemTwo.cpp +++ b/src/equations/SystemTwo.cpp @@ -57,7 +57,7 @@ SystemTwo::SystemTwo(MultiLevelProblem& e_map_in, const std::string & eqname_in, LinearImplicitSystem(e_map_in,eqname_in,number,smoother_type) { } -void SystemTwo::init_sys() { +void SystemTwo::init_unknown_vars() { //============= init n_vars================ _dofmap.initNVars(); diff --git a/src/equations/SystemTwo.hpp b/src/equations/SystemTwo.hpp index 7cf376514..72ec658ca 100644 --- a/src/equations/SystemTwo.hpp +++ b/src/equations/SystemTwo.hpp @@ -64,12 +64,10 @@ class SystemTwo : public LinearImplicitSystem { //======================================================================= //======= Quantities ========= //======================================================================= - inline const std::vector & GetUnknownQuantitiesVector() const { //MultilevelSolution// - return _UnknownQuantitiesVector; - } + inline const std::vector & GetUnknownQuantitiesVector() const { return _UnknownQuantitiesVector; }//MultilevelSolution// - void AddUnknownToSystemPDE( Quantity* qty_in) { //System// + void AddUnknownToSystemPDE( Quantity* qty_in) { //System// unsigned n = _UnknownQuantitiesVector.size(); _UnknownQuantitiesVector.resize(n+1); @@ -87,7 +85,7 @@ class SystemTwo : public LinearImplicitSystem { std::vector _refvalue; //MultilevelSolution// void initRefValues(); //MultilevelSolution// - void init_sys(); //System// //MultilevelSolution// + void init_unknown_vars(); //System// //MultilevelSolution// // ============ INITIAL CONDITIONS of the equation ====== (procs,levels) == void Initialize(); //MultilevelSolution //this uses x and fills in x_old at all levels From e8107f5a5d556a4306cbc95d11719f6fcb1baa76 Mon Sep 17 00:00:00 2001 From: eaulisa Date: Tue, 10 Mar 2015 17:13:16 -0500 Subject: [PATCH 71/91] parallel GMV write --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 6 +- .../NumPdeSpring2015/Eugenio/CMakeLists.txt | 3 + .../NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp | 252 ++++++++++-- src/algebra/PetscVector.cpp | 2 + src/solution/GMVWriter.cpp | 381 ++++++++++++++++++ src/solution/GMVWriter.hpp | 3 +- src/solution/VTKWriter.hpp | 1 - src/solution/Writer.hpp | 2 +- 8 files changed, 604 insertions(+), 46 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 63ffad318..9d0948cdf 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(XDMF); + ml_sol.SetWriter(GMV); std::vector mov_vars; mov_vars.push_back("DX"); @@ -372,8 +372,8 @@ int main(int argc,char **args) { if (!dimension2D) print_vars.push_back("W"); print_vars.push_back("P"); - ml_sol.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); - + ml_sol.GetWriter()->ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + //ml_sol.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // Destroy all the new systems ml_prob.clear(); diff --git a/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt b/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt index 482fcd056..93239845e 100644 --- a/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt +++ b/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt @@ -6,4 +6,7 @@ ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) set(EXAMPLE_NUMBER Ex2) ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) +set(EXAMPLE_NUMBER Ex3) +ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) + unset(EXAMPLE_NUMBER) diff --git a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp index cc59a3e31..8e23ab0d8 100644 --- a/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/Eugenio/Ex2/Ex2.cpp @@ -25,71 +25,128 @@ bool SetBoundaryCondition(const double &x, const double &y, const double &z,cons void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const unsigned &levelMax, const bool &assembleMatrix); +double GetErrorNorm(MultiLevelSolution *mlSol); int main(int argc, char **args) { // init Petsc-MPI communicator FemusInit mpinit(argc, args, MPI_COMM_WORLD); - - // define multilevel mesh + + + // define multilevel mesh MultiLevelMesh mlMsh; // read coarse level mesh and generate finers level meshes double scalingFactor=1.; mlMsh.ReadCoarseMesh("./input/square.neu","seventh",scalingFactor); /* "seventh" is the order of accuracy that is used in the gauss integration scheme - probably in the furure it is not going to be an argument of this function */ - unsigned numberOfUniformLevels=2; - unsigned numberOfSelectiveLevels=0; - mlMsh.RefineMesh(numberOfUniformLevels , numberOfUniformLevels + numberOfSelectiveLevels, NULL); + probably in the furure it is not going to be an argument of this function */ - // erase all the coarse mesh levels - mlMsh.EraseCoarseLevels(numberOfUniformLevels-1); + unsigned maxNumberOfMeshes = 5; + vector < vector < double > > semiNorm; + semiNorm.resize(maxNumberOfMeshes); - // print mesh info - mlMsh.PrintInfo(); + for(unsigned i = 0; i < maxNumberOfMeshes; i++){ // loop on the mesh level + + unsigned numberOfUniformLevels = i+1; + unsigned numberOfSelectiveLevels = 0; + mlMsh.RefineMesh(numberOfUniformLevels , numberOfUniformLevels + numberOfSelectiveLevels, NULL); - // define the multilevel solution and attach the mlMsh object to it - MultiLevelSolution mlSol(&mlMsh); + // erase all the coarse mesh levels + mlMsh.EraseCoarseLevels(numberOfUniformLevels-1); - // add variables to mlSol - mlSol.AddSolution("u",LAGRANGE, FIRST); - mlSol.Initialize("All"); + // print mesh info + mlMsh.PrintInfo(); - // attach the boundary condition function and generate boundary data - mlSol.AttachSetBoundaryConditionFunction(SetBoundaryCondition); - mlSol.GenerateBdc("u"); + FEOrder feOrder[3] = {FIRST, SERENDIPITY, SECOND}; + semiNorm[i].resize(3); + + for(unsigned j=0; j<3; j++){ // loop on the FE Order + // define the multilevel solution and attach the mlMsh object to it + MultiLevelSolution mlSol(&mlMsh); + + // add variables to mlSol + mlSol.AddSolution("u",LAGRANGE, feOrder[j]); + mlSol.Initialize("All"); - // define the multilevel problem attach the mlSol object to it - MultiLevelProblem mlProb(&mlSol); + // attach the boundary condition function and generate boundary data + mlSol.AttachSetBoundaryConditionFunction(SetBoundaryCondition); + mlSol.GenerateBdc("u"); - // add system Poisson in mlProb as a Linear Implicit System - LinearImplicitSystem & system = mlProb.add_system < LinearImplicitSystem > ("Poisson"); + // define the multilevel problem attach the mlSol object to it + MultiLevelProblem mlProb(&mlSol); + + // add system Poisson in mlProb as a Linear Implicit System + LinearImplicitSystem & system = mlProb.add_system < LinearImplicitSystem > ("Poisson"); - // add solution "u" to system - system.AddSolutionToSystemPDE("u"); + // add solution "u" to system + system.AddSolutionToSystemPDE("u"); - // attach the assembling function to system - system.SetAssembleFunction(AssemblePoissonProblem); + // attach the assembling function to system + system.SetAssembleFunction(AssemblePoissonProblem); - // initilaize and solve the system - system.init(); - system.solve(); + // initilaize and solve the system + system.init(); + system.solve(); - // print solutions - std::vector < std::string > variablesToBePrinted; - variablesToBePrinted.push_back("All"); + semiNorm[i][j] = GetErrorNorm(&mlSol); + // print solutions + std::vector < std::string > variablesToBePrinted; + variablesToBePrinted.push_back("All"); - VTKWriter vtkIO(&mlSol); - vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + VTKWriter vtkIO(&mlSol); + vtkIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - GMVWriter gmvIO(&mlSol); - gmvIO.SetDebugOutput(true); - gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); - + GMVWriter gmvIO(&mlSol); + gmvIO.SetDebugOutput(true); + gmvIO.write(DEFAULT_OUTPUTDIR, "biquadratic", variablesToBePrinted); + } + } + + // print the seminorm of the error and the order of convergence between different levels + std::cout< &x){ + double pi=acos(-1.); + return cos(pi*x[0])*cos(pi*x[1]); +}; + + +void GetExactSolutionGradient(const vector < double > &x, vector < double > &solGrad){ + double pi=acos(-1.); + solGrad[0] = -pi*sin(pi*x[0])*cos(pi*x[1]); + solGrad[1] = -pi*cos(pi*x[0])*sin(pi*x[1]); +}; + + +double GetExactSolutionLaplace(const vector < double > &x){ + double pi=acos(-1.); + return -pi*pi*cos(pi*x[0])*cos(pi*x[1]) - pi*pi*cos(pi*x[0])*cos(pi*x[1]); +}; + /** * This function assemble the stiffnes matrix KK and the residual vector Res * such that @@ -97,7 +154,6 @@ int main(int argc, char **args) { * and consequently * u = u0 + w satisfies KK u = F **/ - void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const unsigned &levelMax, const bool &assembleMatrix) { // ml_prob is the global object from/to where get/set all the data // level is the level of the PDE system to be assembled @@ -221,7 +277,7 @@ void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const un for(unsigned jdim=0; jdim_ml_msh->GetNumberOfLevels()-1u; + // extract pointers to the several objects that we are going to use + Mesh* msh = mlSol->_ml_msh->GetLevel(level); // pointer to the mesh (level) object + elem* el = msh->el; // pointer to the elem object in msh (level) + Solution* sol = mlSol->GetSolutionLevel(level); // pointer to the solution (level) object + + const unsigned dim = msh->GetDimension(); // get the domain dimension of the problem + unsigned iproc = msh->processor_id(); // get the process_id (for parallel computation) + + //solution variable + unsigned soluIndex; + soluIndex = mlSol->GetIndex("u"); // get the position of "u" in the ml_sol object + unsigned soluType = mlSol->GetSolutionType(soluIndex); // get the finite element type for "u" + + vector < double > solu; // local solution + + vector < vector < double > > x(dim); // local coordinates + unsigned xType = 2; // get the finite element type for "x", it is always 2 (LAGRANGE QUADRATIC) + vector phi; // local test function + vector phi_x; // local test function first order partial derivatives + vector phi_xx; // local test function second order partial derivatives + double weight; // gauss point weight + + // reserve memory for the local standar vectors + const unsigned maxSize = static_cast< unsigned > (ceil(pow(3,dim))); // conservative: based on line3, quad9, hex27 + solu.reserve(maxSize); + for(unsigned i = 0; i < dim; i++) + x[i].reserve(maxSize); + phi.reserve(maxSize); + phi_x.reserve(maxSize*dim); + unsigned dim2=(3*(dim-1)+!(dim-1)); // dim2 is the number of second order partial derivatives (1,3,6 depending on the dimension) + phi_xx.reserve(maxSize*dim2); + + double seminorm = 0.; + double l2norm = 0.; + + // element loop: each process loops only on the elements that owns + for (int iel=msh->IS_Mts2Gmt_elem_offset[iproc]; iel < msh->IS_Mts2Gmt_elem_offset[iproc+1]; iel++) { + + unsigned kel = msh->IS_Mts2Gmt_elem[iel]; // mapping between paralell dof and mesh dof + short unsigned kelGeom = el->GetElementType( kel ); // element geometry type + unsigned nDofs = el->GetElementDofNumber( kel, soluType); // number of solution element dofs + unsigned nDofs2 = el->GetElementDofNumber( kel, xType); // number of coordinate element dofs + + // resize local arrays + solu.resize(nDofs); + for(int i=0; iGetMeshDof(kel, i, soluType); // local to global solution node + unsigned solDof = msh->GetMetisDof(iNode, soluType); // global to global mapping between solution node and solution dof + solu[i] = (*sol->_Sol[soluIndex])(solDof); // global extraction and local storage for the solution + } + + // local storage of coordinates + for( unsigned i=0; iGetMeshDof(kel, i, xType); // local to global coordinates node + unsigned xDof = msh->GetMetisDof(iNode, xType); // global to global mapping between coordinates node and coordinate dof + for(unsigned jdim=0; jdim_coordinate->_Sol[jdim])(xDof); // global extraction and local storage for the element coordinates + } + } + + // *** Gauss point loop *** + for(unsigned ig=0; ig < msh->_finiteElement[kelGeom][soluType]->GetGaussPointNumber(); ig++) { + // *** get gauss point weight, test function and test function partial derivatives *** + msh->_finiteElement[kelGeom][soluType]->Jacobian(x,ig,weight,phi,phi_x,phi_xx); + + // evaluate the solution, the solution derivatives and the coordinates in the gauss point + double soluGauss = 0; + vector < double > soluGauss_x(dim,0.); + vector < double > xGauss(dim,0.); + + for(unsigned i=0; i solGrad(dim); + GetExactSolutionGradient(xGauss, solGrad); + + for (unsigned j=0;j n_processors()) { + seminorm_vec->init(msh->n_processors(), 1, false, SERIAL); + } + else { + seminorm_vec->init(msh->n_processors(), 1 , false, PARALLEL); + } + + seminorm_vec->set(iproc, seminorm); + seminorm_vec->close(); + seminorm=seminorm_vec->l1_norm(); + + delete seminorm_vec; + + //return sqrt(seminorm); + return(sqrt(l2norm)); + +} diff --git a/src/algebra/PetscVector.cpp b/src/algebra/PetscVector.cpp index b53a3f663..a854c348b 100644 --- a/src/algebra/PetscVector.cpp +++ b/src/algebra/PetscVector.cpp @@ -185,6 +185,7 @@ void PetscVector::matrix_mult(const NumericVector &vec_in,const SparseMatrix &ma A->close(); ierr = MatMult(const_cast(A)->mat(),v->_vec,_vec); CHKERRABORT(MPI_COMM_WORLD,ierr); + this->close(); return; } @@ -200,6 +201,7 @@ void PetscVector::matrix_mult_transpose(const NumericVector &vec_in,const Sparse A->close(); ierr = MatMultTranspose(const_cast(A)->mat(),v->_vec,_vec); CHKERRABORT(MPI_COMM_WORLD,ierr); + this->close(); return; } diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 6f74e72bc..5e4771736 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -329,6 +329,387 @@ void GMVWriter::write(const std::string output_path, const char order[], const s } +void GMVWriter::ParallelWrite(const std::string output_path, const char order[], const std::vector& vars, const unsigned time_step) const { + + unsigned igridn = _gridn; // aggiunta da me + + if (igridn==0) igridn=_gridn; + + unsigned igridr=(_gridr <= igridn)?_gridr:igridn; + + // ********** linear -> index==0 *** quadratic -> index==1 ********** + unsigned index=(strcmp(order,"linear"))?1:0; + + std::string filename_prefix; + if( _ml_sol != NULL ) filename_prefix = "sol"; + else filename_prefix = "mesh"; + + std::ostringstream filename; + filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." <<_iproc<<"."<< time_step << "." << order << ".gmv"; + + std::ofstream fout; + + if(_iproc!=_iproc) { + fout.rdbuf(); //redirect to dev_null + } + else { + fout.open(filename.str().c_str()); + if (fout.is_open()) { + std::cout << std::endl << " The output is printed to file " << filename.str() << " in GMV format" << std::endl; + } + else { + std::cout << std::endl << " The output file "<< filename.str() <<" cannot be opened.\n"; + abort(); + } + } + + unsigned nvt=0; + unsigned nvt_max=0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc+1] + - _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + nvt_max=( nvt_max > nvt_ig ) ? nvt_max : nvt_ig; + nvt += nvt_ig; + } + + + unsigned ghost_counter = 0; + unsigned nel=0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + nel++; + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(ii); + for(unsigned j=0; jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); + if( jnode_Metis < offset_iprc ){ + ghost_counter++; + } + } + } + } + } + + nvt_max= ( nvt_max > ghost_counter )? nvt_max : ghost_counter; + unsigned nvt0 = nvt; + nvt += ghost_counter; + + double *var_nd=new double [nvt_max+1]; //TO FIX Valgrind complaints! In reality it should be only nvt + vector Mysol(igridn); + for(unsigned ig=igridr-1u; ig<_gridn; ig++) { + Mysol[ig] = NumericVector::build().release(); + + if(n_processors()==1) { // IF SERIAL + Mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], + _ml_mesh->GetLevel(ig)->own_size[index][_nprocs],false,SERIAL); + } + else{ + Mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], + _ml_mesh->GetLevel(ig)->own_size[index][_iproc], + _ml_mesh->GetLevel(ig)->ghost_nd_mts[index][_iproc],false,GHOSTED ); + } + } + + // ********** Header ********** + char *det= new char[10]; + sprintf(det,"%s","gmvinput"); + fout.write((char *)det,sizeof(char)*8); + sprintf(det,"%s","ieeei4r8"); + fout.write((char *)det,sizeof(char)*8); + + // ********** Start printing node coordinates ********** + sprintf(det,"%s","nodes"); + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&nvt,sizeof(unsigned)); + + for (int i=0; i<3; i++) { + for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; + unsigned nvt_ig= offset_iprcp1 - offset_iprc; + for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { + unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indDXDYDZ)) ); + for (unsigned ii=0; iiGetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnode_Metis < offset_iprc ){ + var_nd[ghost_counter] = (*Mysol[ig])(jnode_Metis); + ghost_counter++; + ig_ghost_couter++; + } + } + } + } + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { + ghost_counter -= ig_ghost_couter; + Mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnode_Metis < offset_iprc ){ + var_nd[ghost_counter] += (*Mysol[ig])(jnode_Metis); + ghost_counter++; + } + } + } + } + } + } + fout.write( (char *)&var_nd[0], ghost_counter*sizeof(double) ); + + } + // ********** End printing node coordinates ********** + + // ********** Start printing cell connectivity ********** + const int eltp[2][6]= {{8,4,6,4,3,2},{20,10,15,8,6,3}}; + sprintf(det,"%s","cells"); + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&nel,sizeof(unsigned)); + + unsigned topology[27]; + unsigned offset=1; + + ghost_counter = 0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; + unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(ii); + if (ielt==0) sprintf(det,"phex%d",eltp[index][0]); + else if (ielt==1) sprintf(det,"ptet%d",eltp[index][1]); + else if (ielt==2) sprintf(det,"pprism%d",eltp[index][2]); + else if (ielt==3) { + if (eltp[index][3]==8) sprintf(det,"%dquad",eltp[index][3]); + else sprintf(det,"quad"); + } else if (ielt==4) { + if (eltp[index][4]==6) sprintf(det,"%dtri",eltp[index][4]); + else sprintf(det,"tri"); + } else if (ielt==5) { + if (eltp[index][5]==3) sprintf(det,"%dline",eltp[index][5]); + else sprintf(det,"line"); + } + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&NVE[ielt][index],sizeof(unsigned)); + for(unsigned j=0;jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); + topology[j]=(jnode_Metis >= offset_iprc )? jnode_Metis - offset_iprc + offset : nvt0 + (++ghost_counter); + } + fout.write((char *)topology,sizeof(unsigned)*NVE[ielt][index]); + } + } + offset+=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; + } + // ********** End printing cell connectivity ********** + + double *var_el=new double [nel+1]; //TO FIX Valgrind complaints! In reality it should be only nel + + // ********** Start printing Variables ********** + const unsigned zero=0u; + const unsigned one=1u; + sprintf(det,"%s","variable"); + fout.write((char *)det,sizeof(char)*8); + + // ********** Start printing Regions ********** + strcpy(det,"Regions"); + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&zero,sizeof(unsigned)); + + int icount=0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); + icount++; + } + } + } + fout.write((char *)&var_el[0],nel*sizeof(double)); + + if(_nprocs>=1){ + strcpy(det,"Reg_proc"); + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&zero,sizeof(unsigned)); + + int icount=0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->epart[ii]; + icount++; + } + } + } + fout.write((char *)&var_el[0],nel*sizeof(double)); + } + + // ********** End printing Regions ********** + + // ********** Start printing Solution ********** + if (_ml_sol != NULL) { + + bool printAll = 0; + for (unsigned ivar=0; ivar < vars.size(); ivar++){ + printAll += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); + } + + for (unsigned ivar=0; ivar< !printAll*vars.size() + printAll*_ml_sol->GetSolutionSize(); ivar++) { + unsigned i = ( printAll == 0 ) ? _ml_sol->GetIndex( vars[ivar].c_str()) : ivar; + + for(int name=0;name<4;name++){ + if (name==0){ + sprintf(det,"%s", _ml_sol->GetSolutionName(i)); + } + else if (name==1){ + sprintf(det,"%s %s","Bdc",_ml_sol->GetSolutionName(i)); + } + else if (name==2){ + sprintf(det,"%s %s","Res",_ml_sol->GetSolutionName(i)); + } + else{ + sprintf(det,"%s %s","Eps",_ml_sol->GetSolutionName(i)); + } + if(name==0 || ( _debugOutput && _ml_sol->GetSolutionLevel(igridn-1u)->_ResEpsBdcFlag[i])){ + if (_ml_sol->GetSolutionType(i)<3) { // ********** on the nodes ********** + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&one,sizeof(unsigned)); + for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); + } + else if (name==1){ + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Bdc[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); + } + else if (name==2){ + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Res[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); + } + else{ + Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Eps[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); + } + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; + unsigned nvt_ig= offset_iprcp1 - offset_iprc; + for (unsigned ii=0; iiGetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt = _ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for(unsigned j=0; j < NVE[ielt][index]; j++){ + unsigned jnode = _ml_mesh->GetLevel(ig)->el->GetMeshDof(kel, j, index); + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnode_Metis < offset_iprc ){ + var_nd[ghost_counter] = (*Mysol[ig])(jnode_Metis); + ghost_counter++; + } + } + } + } + } + fout.write( (char *)&var_nd[0], ghost_counter*sizeof(double) ); + + } + else { // ********** on the elements ********** + fout.write((char *)det,sizeof(char)*8); + fout.write((char *)&zero,sizeof(unsigned)); + int icount=0; + for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(i)); + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + if (name==0){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); + } + else if (name==1){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Bdc[i])(iel_Metis); + } + else if (name==2){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Res[i])(iel_Metis); + } + else{ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Eps[i])(iel_Metis); + } + icount++; + } + } + } + fout.write((char *)&var_el[0],nel*sizeof(double)); + } + } + } + } + + } //end _ml_sol + // ********** End printing Solution ********** + sprintf(det,"%s","endvars"); + fout.write((char *)det,sizeof(char)*8); + + // ********** End printing Variables ********** + sprintf(det,"%s","endgmv"); + fout.write((char *)det,sizeof(char)*8); + fout.close(); + // ********** End printing file ********** + + // Free memory + delete [] var_el; + delete [] var_nd; + for (unsigned ig=igridr-1u; ig & vars = std::vector < std::string > (), const unsigned time_step=0) const; + void ParallelWrite(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; + /** Set if to print or not to prind the debugging variables */ void SetDebugOutput( bool value ){ _debugOutput = value;} private: bool _debugOutput; - }; diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index b625e0818..ef0b65b08 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -52,7 +52,6 @@ class VTKWriter : public Writer { /** femus to vtk cell type map */ static short unsigned int femusToVtkCellType[3][6]; - }; /** diff --git a/src/solution/Writer.hpp b/src/solution/Writer.hpp index f58ac05b1..61ed3599a 100644 --- a/src/solution/Writer.hpp +++ b/src/solution/Writer.hpp @@ -54,7 +54,7 @@ namespace femus { /** write output function */ virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const = 0; - + virtual void ParallelWrite(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const {}; /** set moving mesh */ void SetMovingMesh(std::vector& movvars_in); From c1c5cd5b50b8870d1d21b7f5ca37624daf90e5e4 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Wed, 11 Mar 2015 06:40:59 -0500 Subject: [PATCH 72/91] fixed cmake conflict in previous commit --- applications/NumPdeSpring2015/Eugenio/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt b/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt index 93239845e..482fcd056 100644 --- a/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt +++ b/applications/NumPdeSpring2015/Eugenio/CMakeLists.txt @@ -6,7 +6,4 @@ ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) set(EXAMPLE_NUMBER Ex2) ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) -set(EXAMPLE_NUMBER Ex3) -ADD_SUBDIRECTORY(${EXAMPLE_NUMBER}) - unset(EXAMPLE_NUMBER) From b1d30fd07840fd01111dfff4c8d07d244fba4c24 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Wed, 11 Mar 2015 09:17:47 -0500 Subject: [PATCH 73/91] GMV parallel write working in AMR --- applications/Poisson_AMR/main.cpp | 2 +- src/solution/GMVWriter.cpp | 124 ++++++++++++++---------------- 2 files changed, 60 insertions(+), 66 deletions(-) diff --git a/applications/Poisson_AMR/main.cpp b/applications/Poisson_AMR/main.cpp index d1f25b794..9b23e8b9f 100644 --- a/applications/Poisson_AMR/main.cpp +++ b/applications/Poisson_AMR/main.cpp @@ -425,7 +425,7 @@ int main(int argc,char **argv) { vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); GMVWriter gmvio(&ml_sol); - gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.ParallelWrite(files.GetOutputPath(),"biquadratic",print_vars); // // XDMFWriter xdmfio(ml_sol); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 5e4771736..4c57ae622 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -349,43 +349,38 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], std::ofstream fout; - if(_iproc!=_iproc) { - fout.rdbuf(); //redirect to dev_null + fout.open(filename.str().c_str()); + if (fout.is_open()) { + std::cout << std::endl << " The output is printed to file " << filename.str() << " in GMV format" << std::endl; } else { - fout.open(filename.str().c_str()); - if (fout.is_open()) { - std::cout << std::endl << " The output is printed to file " << filename.str() << " in GMV format" << std::endl; - } - else { - std::cout << std::endl << " The output file "<< filename.str() <<" cannot be opened.\n"; - abort(); - } - } + std::cout << std::endl << " The output file "<< filename.str() <<" cannot be opened.\n"; + abort(); + } + //count the own dof nodes on all levels unsigned nvt=0; unsigned nvt_max=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc+1] - - _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + unsigned nvt_ig = _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; nvt_max=( nvt_max > nvt_ig ) ? nvt_max : nvt_ig; nvt += nvt_ig; } - + // count the ghost dof nodes and the own dof elements on all levels unsigned ghost_counter = 0; unsigned nel=0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { nel++; - short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(ii); + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0; jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); - if( jnode_Metis < offset_iprc ){ + unsigned jnode =_ml_mesh->GetLevel(ig)->el->GetMeshDof(kel, j, index); + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ //Is this a ghost node? ghost_counter++; } } @@ -395,10 +390,13 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], nvt_max= ( nvt_max > ghost_counter )? nvt_max : ghost_counter; unsigned nvt0 = nvt; - nvt += ghost_counter; + nvt += ghost_counter; // total node dofs (own + ghost) - double *var_nd=new double [nvt_max+1]; //TO FIX Valgrind complaints! In reality it should be only nvt - vector Mysol(igridn); + vector < double > var_nd; + var_nd.resize(nvt_max+1); //TO FIX Valgrind complaints! In reality it should be only nvt + vector < double > var_el; + var_el.resize(nel+1); //TO FIX Valgrind complaints! In reality it should be only nel + vector < NumericVector* > Mysol(igridn); for(unsigned ig=igridr-1u; ig<_gridn; ig++) { Mysol[ig] = NumericVector::build().release(); @@ -406,7 +404,7 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], Mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], _ml_mesh->GetLevel(ig)->own_size[index][_nprocs],false,SERIAL); } - else{ + else{ // IF PARALLEL Mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], _ml_mesh->GetLevel(ig)->own_size[index][_iproc], _ml_mesh->GetLevel(ig)->ghost_nd_mts[index][_iproc],false,GHOSTED ); @@ -431,11 +429,10 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; - unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; - unsigned nvt_ig= offset_iprcp1 - offset_iprc; + unsigned nvt_ig= _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; for (unsigned ii=0; iiGetLevel(0)->GetDimension() > i) { + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { // if moving mesh unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); Mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indDXDYDZ)) ); @@ -451,20 +448,20 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); - if( jnode_Metis < offset_iprc ){ - var_nd[ghost_counter] = (*Mysol[ig])(jnode_Metis); + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_nd[ghost_counter] = (*Mysol[ig])(jnodeMetis); ghost_counter++; ig_ghost_couter++; } } } } - if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { // if moving mesh ghost_counter -= ig_ghost_couter; Mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); @@ -475,9 +472,9 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); - if( jnode_Metis < offset_iprc ){ - var_nd[ghost_counter] += (*Mysol[ig])(jnode_Metis); + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_nd[ghost_counter] += (*Mysol[ig])(jnodeMetis); ghost_counter++; } } @@ -502,21 +499,23 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], ghost_counter = 0; for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; - unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; + unsigned nvt_ig= _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(ii); + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); if (ielt==0) sprintf(det,"phex%d",eltp[index][0]); else if (ielt==1) sprintf(det,"ptet%d",eltp[index][1]); else if (ielt==2) sprintf(det,"pprism%d",eltp[index][2]); else if (ielt==3) { if (eltp[index][3]==8) sprintf(det,"%dquad",eltp[index][3]); else sprintf(det,"quad"); - } else if (ielt==4) { + } + else if (ielt==4) { if (eltp[index][4]==6) sprintf(det,"%dtri",eltp[index][4]); else sprintf(det,"tri"); - } else if (ielt==5) { + } + else if (ielt==5) { if (eltp[index][5]==3) sprintf(det,"%dline",eltp[index][5]); else sprintf(det,"line"); } @@ -524,19 +523,17 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], fout.write((char *)&NVE[ielt][index],sizeof(unsigned)); for(unsigned j=0;jGetLevel(ig)->el->GetElementVertexIndex(ii,j)-1u; - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); - topology[j]=(jnode_Metis >= offset_iprc )? jnode_Metis - offset_iprc + offset : nvt0 + (++ghost_counter); + unsigned jnode = _ml_mesh->GetLevel(ig)->el->GetMeshDof(kel, j, index); + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); + topology[j]=(jnodeMetis >= offset_iprc )? jnodeMetis - offset_iprc + offset : nvt0 + (++ghost_counter); } fout.write((char *)topology,sizeof(unsigned)*NVE[ielt][index]); } } - offset+=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; + offset += nvt_ig;// _ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; } // ********** End printing cell connectivity ********** - - double *var_el=new double [nel+1]; //TO FIX Valgrind complaints! In reality it should be only nel - + // ********** Start printing Variables ********** const unsigned zero=0u; const unsigned one=1u; @@ -551,9 +548,9 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=_ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->el->GetElementGroup(kel); icount++; } } @@ -568,9 +565,9 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - var_el[icount]=_ml_mesh->GetLevel(ig)->epart[ii]; + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + var_el[icount]=_ml_mesh->GetLevel(ig)->epart[kel]; icount++; } } @@ -626,8 +623,7 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); } unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; - unsigned offset_iprcp1 = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc+1]; - unsigned nvt_ig= offset_iprcp1 - offset_iprc; + unsigned nvt_ig = _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; for (unsigned ii=0; iiGetLevel(ig)->el->GetElementType(kel); for(unsigned j=0; j < NVE[ielt][index]; j++){ unsigned jnode = _ml_mesh->GetLevel(ig)->el->GetMeshDof(kel, j, index); - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); - if( jnode_Metis < offset_iprc ){ - var_nd[ghost_counter] = (*Mysol[ig])(jnode_Metis); + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_nd[ghost_counter] = (*Mysol[ig])(jnodeMetis); ghost_counter++; } } @@ -660,9 +656,9 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned ii = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,_ml_sol->GetSolutionType(i)); - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(kel,_ml_sol->GetSolutionType(i)); + if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { if (name==0){ var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); } @@ -697,8 +693,6 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], // ********** End printing file ********** // Free memory - delete [] var_el; - delete [] var_nd; for (unsigned ig=igridr-1u; ig Date: Wed, 11 Mar 2015 14:15:39 -0500 Subject: [PATCH 74/91] some formatting GMV parallel write --- src/solution/GMVWriter.cpp | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 4c57ae622..4ad1951d3 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -331,21 +331,21 @@ void GMVWriter::write(const std::string output_path, const char order[], const s void GMVWriter::ParallelWrite(const std::string output_path, const char order[], const std::vector& vars, const unsigned time_step) const { - unsigned igridn = _gridn; // aggiunta da me + unsigned gridn = _gridn; // aggiunta da me - if (igridn==0) igridn=_gridn; + if ( gridn == 0 ) gridn = _gridn; - unsigned igridr=(_gridr <= igridn)?_gridr:igridn; + unsigned igridr=( _gridr <= gridn ) ? _gridr : gridn; // ********** linear -> index==0 *** quadratic -> index==1 ********** - unsigned index=(strcmp(order,"linear"))?1:0; + unsigned index=( strcmp(order, "linear") ) ? 1 : 0; std::string filename_prefix; if( _ml_sol != NULL ) filename_prefix = "sol"; else filename_prefix = "mesh"; std::ostringstream filename; - filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." <<_iproc<<"."<< time_step << "." << order << ".gmv"; + filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." <<_iproc<<"."<< time_step << "." << order << ".gmv"; std::ofstream fout; @@ -358,23 +358,23 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], abort(); } - //count the own dof nodes on all levels - unsigned nvt=0; - unsigned nvt_max=0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->own_size[index][_iproc]; nvt_max=( nvt_max > nvt_ig ) ? nvt_max : nvt_ig; nvt += nvt_ig; } - // count the ghost dof nodes and the own dof elements on all levels + // count the ghost node dofs and the own element dofs element on all levels unsigned ghost_counter = 0; unsigned nel=0; - for (unsigned ig = igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { nel++; short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0; j var_el; var_el.resize(nel+1); //TO FIX Valgrind complaints! In reality it should be only nel - vector < NumericVector* > Mysol(igridn); + vector < NumericVector* > Mysol(gridn); for(unsigned ig=igridr-1u; ig<_gridn; ig++) { Mysol[ig] = NumericVector::build().release(); @@ -424,7 +424,7 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], fout.write((char *)&nvt,sizeof(unsigned)); for (int i=0; i<3; i++) { - for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); @@ -443,12 +443,12 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], } //print ghost coordinates ghost_counter = 0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); @@ -468,7 +468,7 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0;jGetLevel(ig)->el->GetMeshDof(kel, j, index); @@ -497,12 +497,12 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], unsigned offset=1; ghost_counter = 0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; unsigned nvt_ig= _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); if (ielt==0) sprintf(det,"phex%d",eltp[index][0]); else if (ielt==1) sprintf(det,"ptet%d",eltp[index][1]); @@ -546,10 +546,10 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], fout.write((char *)&zero,sizeof(unsigned)); int icount=0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig==gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { var_el[icount]=_ml_mesh->GetLevel(ig)->el->GetElementGroup(kel); icount++; } @@ -563,10 +563,10 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], fout.write((char *)&zero,sizeof(unsigned)); int icount=0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig==gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { var_el[icount]=_ml_mesh->GetLevel(ig)->epart[kel]; icount++; } @@ -601,11 +601,11 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], else{ sprintf(det,"%s %s","Eps",_ml_sol->GetSolutionName(i)); } - if(name==0 || ( _debugOutput && _ml_sol->GetSolutionLevel(igridn-1u)->_ResEpsBdcFlag[i])){ + if(name==0 || ( _debugOutput && _ml_sol->GetSolutionLevel(gridn-1u)->_ResEpsBdcFlag[i])){ if (_ml_sol->GetSolutionType(i)<3) { // ********** on the nodes ********** fout.write((char *)det,sizeof(char)*8); fout.write((char *)&one,sizeof(unsigned)); - for (unsigned ig=igridr-1u; igmatrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[i], *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index, _ml_sol->GetSolutionType(i)) ); @@ -630,11 +630,11 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], } //print ghost dofs ghost_counter = 0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->MetisOffset[index][_iproc]; for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - if ( ig == igridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig == gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { short unsigned ielt = _ml_mesh->GetLevel(ig)->el->GetElementType(kel); for(unsigned j=0; j < NVE[ielt][index]; j++){ unsigned jnode = _ml_mesh->GetLevel(ig)->el->GetMeshDof(kel, j, index); @@ -654,11 +654,11 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], fout.write((char *)det,sizeof(char)*8); fout.write((char *)&zero,sizeof(unsigned)); int icount=0; - for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(kel,_ml_sol->GetSolutionType(i)); - if ( ig==igridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if ( ig==gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { if (name==0){ var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); } @@ -693,7 +693,7 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], // ********** End printing file ********** // Free memory - for (unsigned ig=igridr-1u; ig Date: Fri, 13 Mar 2015 08:16:49 -0500 Subject: [PATCH 75/91] paralle vtk working --- .../FSI/FSISteadyStateBenchmarks/main.cpp | 4 +- applications/Poisson/main.cpp | 10 +- applications/Poisson_AMR/main.cpp | 20 +- src/algebra/AsmPetscLinearEquationSolver.cpp | 116 +--- src/solution/GMVWriter.cpp | 32 +- src/solution/GMVWriter.hpp | 2 +- src/solution/VTKWriter.cpp | 546 ++++++++++++++++++ src/solution/VTKWriter.hpp | 4 +- src/solution/XDMFWriter.hpp | 2 +- src/utils/FemusInit.cpp | 2 +- 10 files changed, 616 insertions(+), 122 deletions(-) diff --git a/applications/FSI/FSISteadyStateBenchmarks/main.cpp b/applications/FSI/FSISteadyStateBenchmarks/main.cpp index 9d0948cdf..6ef70e28b 100644 --- a/applications/FSI/FSISteadyStateBenchmarks/main.cpp +++ b/applications/FSI/FSISteadyStateBenchmarks/main.cpp @@ -349,7 +349,7 @@ int main(int argc,char **args) { //system.SetDirichletBCsHandling(PENALTY); system.SetDirichletBCsHandling(ELIMINATION); - ml_sol.SetWriter(GMV); + ml_sol.SetWriter(VTK); std::vector mov_vars; mov_vars.push_back("DX"); @@ -373,7 +373,7 @@ int main(int argc,char **args) { print_vars.push_back("P"); ml_sol.GetWriter()->ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); - //ml_sol.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + ml_sol.GetWriter()->write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // Destroy all the new systems ml_prob.clear(); diff --git a/applications/Poisson/main.cpp b/applications/Poisson/main.cpp index d8ef8d5c8..5cb0afbc4 100644 --- a/applications/Poisson/main.cpp +++ b/applications/Poisson/main.cpp @@ -81,9 +81,9 @@ int main(int argc,char **argv) { /// Init Petsc-MPI communicator FemusInit mpinit(argc,argv,MPI_COMM_WORLD); - Files files; - files.CheckIODirectories(); - files.RedirectCout(); + //Files files; + //files.CheckIODirectories(); + //files.RedirectCout(); // input parser pointer std::auto_ptr inputparser = InputParser::build(path); @@ -255,10 +255,10 @@ int main(int argc,char **argv) { print_vars.push_back("Sol"); VTKWriter vtkio(&ml_sol); - vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); + vtkio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); GMVWriter gmvio(&ml_sol); - gmvio.write(files.GetOutputPath(),"biquadratic",print_vars); + gmvio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // // XDMFWriter xdmfio(ml_sol); // xdmfio.write(files.GetOutputPath(),"biquadratic",print_vars); diff --git a/applications/Poisson_AMR/main.cpp b/applications/Poisson_AMR/main.cpp index 9b23e8b9f..28da604c5 100644 --- a/applications/Poisson_AMR/main.cpp +++ b/applications/Poisson_AMR/main.cpp @@ -299,9 +299,9 @@ int main(int argc,char **argv) { /// Init Petsc-MPI communicator FemusInit mpinit(argc,argv,MPI_COMM_WORLD); - Files files; - files.CheckIODirectories(); - files.RedirectCout(); + //Files files; + //files.CheckIODirectories(); + //files.RedirectCout(); /// INIT MESH ================================= @@ -421,12 +421,18 @@ int main(int argc,char **argv) { std::vector print_vars; print_vars.push_back("Sol"); - VTKWriter vtkio(&ml_sol); - vtkio.write(files.GetOutputPath(),"biquadratic",print_vars); + //VTKWriter vtkio(&ml_sol); + //vtkio.ParallelWrite(files.GetOutputPath(),"biquadratic",print_vars); + + //GMVWriter gmvio(&ml_sol); + //gmvio.ParallelWrite(files.GetOutputPath(),"biquadratic",print_vars); - GMVWriter gmvio(&ml_sol); - gmvio.ParallelWrite(files.GetOutputPath(),"biquadratic",print_vars); + VTKWriter vtkio(&ml_sol); + vtkio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + //GMVWriter gmvio(&ml_sol); + //gmvio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + // // XDMFWriter xdmfio(ml_sol); // xdmfio.write("biquadratic",print_vars); diff --git a/src/algebra/AsmPetscLinearEquationSolver.cpp b/src/algebra/AsmPetscLinearEquationSolver.cpp index 22fd87ac4..ca645313d 100644 --- a/src/algebra/AsmPetscLinearEquationSolver.cpp +++ b/src/algebra/AsmPetscLinearEquationSolver.cpp @@ -151,10 +151,7 @@ namespace femus { vector < unsigned > indexb(DofOffsetSize,DofOffsetSize); vector owned(DofOffsetSize,false); - map mymap; - //map mymap_u; - //map mymap_p; - + map mymap; unsigned ElemOffset = _msh->MetisOffset[3][iproc]; unsigned ElemOffsetp1 = _msh->MetisOffset[3][iproc+1]; @@ -166,9 +163,7 @@ namespace femus { MeshASMPartitioning meshasmpartitioning(*_msh); meshasmpartitioning.DoPartition(_element_block_number, block_elements, _block_type_range); - //_msh->GenerateVankaPartitions_FSI1(_element_block_number, block_elements, _block_type_range); - - + vector ThisVaribaleIsNonSchur(_SolPdeIndex.size(),true); for (unsigned iind=variable_to_be_solved.size()-_NSchurVar; iindIS_Mts2Gmt_elem_offset[iproc] + vb_index*_element_block_number; - // for (int iel_mts=gel; iel_mtsIS_Mts2Gmt_elem_offset[iproc+1]; iel_mts++) { - for(int kel=0;kelIS_Mts2Gmt_elem[iel_mts]; - //unsigned iel = _msh->IS_Mts2Gmt_elem[block_elements[vb_index][kel]]; - for (unsigned i=0; i<_msh->el->GetElementDofNumber(iel,0); i++) { unsigned inode=_msh->el->GetElementVertexIndex(iel,i)-1u; unsigned nvei=_msh->el->GetVertexElementNumber(inode); @@ -229,39 +205,35 @@ namespace femus { indexc[jel_Metis-ElemOffset]=Csize++; //---------------------------------------------------------------------------------- //add non-schur node to be solved - - //for (unsigned iind=0; iindel->GetElementVertexAddress(jel,0); unsigned nvej=_msh->el->GetElementDofNumber(jel,SolType); for (unsigned jj=0; jjGetMetisDof(jnode,SolType); - unsigned kkdof=GetKKDof(SolPdeIndex, indexSol, jnode); - if(jnode_Metis >= _msh->MetisOffset[SolType][iproc] && - jnode_Metis < _msh->MetisOffset[SolType][iproc+1]){ - //unsigned kkdof=GetKKDof(SolPdeIndex, indexSol, jnode); - if(indexa[kkdof- DofOffset]==DofOffsetSize && owned[kkdof- DofOffset]==false) { - owned[kkdof- DofOffset]=true; - _is_loc_idx[vb_index][PAsize]=kkdof; - indexa[kkdof-DofOffset]=PAsize++; + unsigned jnode=_msh->el->GetMeshDof(jel,jj,SolType); + +// bool solidmark = _msh->el->GetNodeRegion(jnode); +// if( vb_index < _block_type_range[0] || !solidmark ){ + unsigned jnode_Metis = _msh->GetMetisDof(jnode,SolType); + unsigned kkdof=GetKKDof(SolPdeIndex, indexSol, jnode); + if(jnode_Metis >= _msh->MetisOffset[SolType][iproc] && + jnode_Metis < _msh->MetisOffset[SolType][iproc+1]){ + if(indexa[kkdof- DofOffset]==DofOffsetSize && owned[kkdof- DofOffset]==false) { + owned[kkdof- DofOffset]=true; + _is_loc_idx[vb_index][PAsize]=kkdof; + indexa[kkdof-DofOffset]=PAsize++; + } + if(indexb[kkdof- DofOffset]==DofOffsetSize) { + _is_ovl_idx[vb_index][PBsize]=kkdof; + indexb[kkdof-DofOffset]=PBsize++; + } } - if(indexb[kkdof- DofOffset]==DofOffsetSize) { - _is_ovl_idx[vb_index][PBsize]=kkdof; - indexb[kkdof-DofOffset]=PBsize++; - //_is_ovl_u_idx[vb_index][PBsize_u]=kkdof; - //PBsize_u++; + else { + mymap[kkdof]=true; } } - else { - mymap[kkdof]=true; - //mymap_u[kkdof]=true; - } - } +// } } } } @@ -271,16 +243,13 @@ namespace femus { //----------------------------------------------------------------------------------------- //Add Schur nodes (generally pressure) to be solved { - //for (unsigned iind=variable_to_be_solved.size()-_NSchurVar; iindel->GetElementVertexAddress(iel,0); unsigned nvei=_msh->el->GetElementDofNumber(iel,SolType); for (unsigned ii=0; iiel->GetMeshDof(iel,ii,SolType); unsigned inode_Metis = _msh->GetMetisDof(inode,SolType); unsigned kkdof=GetKKDof(SolPdeIndex, indexSol, inode); if(inode_Metis >= _msh->MetisOffset[SolType][iproc] && @@ -293,13 +262,10 @@ namespace femus { if(indexb[kkdof- DofOffset]==DofOffsetSize ) { _is_ovl_idx[vb_index][PBsize]=kkdof; indexb[kkdof-DofOffset]=PBsize++; - //_is_ovl_p_idx[vb_index][PBsize_p]=kkdof; - //PBsize_p++; } } else{ mymap[kkdof]=true; - //mymap_p[kkdof]=true; } } } @@ -307,7 +273,6 @@ namespace femus { } //----------------------------------------------------------------------------------------- } - // if(gel+_element_block_number <_msh->IS_Mts2Gmt_elem_offset[iproc+1] ) test_end=0; // *** re-initialize indeces(a,c,d) for (PetscInt i=0; ifirst; } - /*_is_ovl_u_idx[vb_index].resize(PBsize_u+mymap_u.size()); - i=0; - for (std::map::iterator it=mymap_u.begin(); it!=mymap_u.end(); ++it,++i){ - _is_ovl_u_idx[vb_index][PBsize_u+i]= it->first; - } - - _is_ovl_p_idx[vb_index].resize(PBsize_p+mymap_p.size()); - i=0; - for (std::map::iterator it=mymap_p.begin(); it!=mymap_p.end(); ++it,++i){ - _is_ovl_p_idx[vb_index][PBsize_p+i]= it->first; - }*/ - - - - - std::sort(_is_loc_idx[vb_index].begin(), _is_loc_idx[vb_index].end()); std::sort(_is_ovl_idx[vb_index].begin(), _is_ovl_idx[vb_index].end()); -// std::sort(_is_ovl_u_idx[vb_index].begin(), _is_ovl_u_idx[vb_index].end()); -// std::sort(_is_ovl_p_idx[vb_index].begin(), _is_ovl_p_idx[vb_index].end()); } //BEGIN Generate std::vector for vanka solve *********** _is_loc.resize(_is_loc_idx.size()); _is_ovl.resize(_is_ovl_idx.size()); - //_is_ovl_u.resize(_is_ovl_u_idx.size()); - //_is_ovl_p.resize(_is_ovl_p_idx.size()); + for(unsigned vb_index=0;vb_index<_is_loc_idx.size();vb_index++){ PetscErrorCode ierr; ierr=ISCreateGeneral(MPI_COMM_SELF,_is_loc_idx[vb_index].size(),&_is_loc_idx[vb_index][0],PETSC_USE_POINTER,&_is_loc[vb_index]); CHKERRABORT(MPI_COMM_SELF,ierr); ierr=ISCreateGeneral(MPI_COMM_SELF,_is_ovl_idx[vb_index].size(),&_is_ovl_idx[vb_index][0],PETSC_USE_POINTER,&_is_ovl[vb_index]); CHKERRABORT(MPI_COMM_SELF,ierr); - //ierr=ISCreateGeneral(MPI_COMM_SELF,_is_ovl_u_idx[vb_index].size(),&_is_ovl_u_idx[vb_index][0],PETSC_USE_POINTER,&_is_ovl_u[vb_index]); - //CHKERRABORT(MPI_COMM_SELF,ierr); - //ierr=ISCreateGeneral(MPI_COMM_SELF,_is_ovl_p_idx[vb_index].size(),&_is_ovl_p_idx[vb_index][0],PETSC_USE_POINTER,&_is_ovl_p[vb_index]); - //CHKERRABORT(MPI_COMM_SELF,ierr); } //END Generate std::vector for vanka solve *********** @@ -587,7 +527,7 @@ namespace femus { ierr = KSPSetType(_ksp, (char*) KSPCGS); CHKERRABORT(MPI_COMM_WORLD,ierr); return; case BICG: - ierr = KSPSetType(_ksp, (char*) KSPBICG); CHKERRABORT(MPI_COMM_WORLD,ierr); + ierr = KSPSetType(_ksp, (char*) KSPBICG); CHKERRABORT(MPI_COMM_WORLD,ierr); return; case TCQMR: ierr = KSPSetType(_ksp, (char*) KSPTCQMR); CHKERRABORT(MPI_COMM_WORLD,ierr); @@ -596,10 +536,10 @@ namespace femus { ierr = KSPSetType(_ksp, (char*) KSPTFQMR); CHKERRABORT(MPI_COMM_WORLD,ierr); return; case LSQR: - ierr = KSPSetType(_ksp, (char*) KSPLSQR); CHKERRABORT(MPI_COMM_WORLD,ierr); + ierr = KSPSetType(_ksp, (char*) KSPLSQR); CHKERRABORT(MPI_COMM_WORLD,ierr); return; case BICGSTAB: - ierr = KSPSetType(_ksp, (char*) KSPBCGS); CHKERRABORT(MPI_COMM_WORLD,ierr); + ierr = KSPSetType(_ksp, (char*) KSPBCGS); CHKERRABORT(MPI_COMM_WORLD,ierr); return; case MINRES: ierr = KSPSetType(_ksp, (char*) KSPMINRES); CHKERRABORT(MPI_COMM_WORLD,ierr); diff --git a/src/solution/GMVWriter.cpp b/src/solution/GMVWriter.cpp index 4ad1951d3..457ce8e04 100644 --- a/src/solution/GMVWriter.cpp +++ b/src/solution/GMVWriter.cpp @@ -656,22 +656,24 @@ void GMVWriter::ParallelWrite(const std::string output_path, const char order[], int icount=0; for (unsigned ig=igridr-1u; igGetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { - unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(kel,_ml_sol->GetSolutionType(i)); - if ( ig==gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { - if (name==0){ - var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); - } - else if (name==1){ - var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Bdc[i])(iel_Metis); - } - else if (name==2){ - var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Res[i])(iel_Metis); - } - else{ - var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Eps[i])(iel_Metis); + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(kel,_ml_sol->GetSolutionType(i)); + if ( ig==gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + if (name==0){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); + } + else if (name==1){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Bdc[i])(iel_Metis); + } + else if (name==2){ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Res[i])(iel_Metis); + } + else{ + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Eps[i])(iel_Metis); + } + icount++; } - icount++; } } } diff --git a/src/solution/GMVWriter.hpp b/src/solution/GMVWriter.hpp index c8538da54..279471244 100644 --- a/src/solution/GMVWriter.hpp +++ b/src/solution/GMVWriter.hpp @@ -46,7 +46,7 @@ namespace femus { virtual ~GMVWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; + void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; void ParallelWrite(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index a84dc5198..2d5b10efa 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -521,6 +521,552 @@ void VTKWriter::write(const std::string output_path, const char order[], const s } +void VTKWriter::ParallelWrite(const std::string output_path, const char order[], const std::vector < std::string > & vars, const unsigned time_step) const { + + bool print_all = 0; + for (unsigned ivar=0; ivar < vars.size(); ivar++){ + print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); + } + + int icount; + unsigned index=0; + if (!strcmp(order,"linear")) index=0; //linear + else if (!strcmp(order,"quadratic")) index=1; //quadratic + else if (!strcmp(order,"biquadratic"))index=2; //biquadratic + + std::string filename_prefix; + if( _ml_sol != NULL ) filename_prefix = "sol"; + else filename_prefix = "mesh"; + + std::ostringstream filename; + + filename << output_path << "/" << filename_prefix << ".level" << _gridn << "." <<_iproc<<"."<< time_step << "." << order << ".vtu"; + + std::ofstream fout; + + fout.open(filename.str().c_str()); + if (fout.is_open()) { + std::cout << std::endl << " The output is printed to file " << filename.str() << " in VTK-XML (64-based) format" << std::endl; + } + else { + std::cout << std::endl << " The output file "<< filename.str() <<" cannot be opened.\n"; + abort(); + } + + // head ************************************************ + fout<<"" << std::endl; + fout<<"" << std::endl; + fout << " " << std::endl; + //----------------------------------------------------------------------------------------------------------- + + //---------------------------------------------------------------------------------------------------------- + + //count the own node dofs on all levels + unsigned nvt = 0; + unsigned nvt_max = 0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned nvt_ig = _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; + nvt_max=( nvt_max > nvt_ig ) ? nvt_max : nvt_ig; + nvt += nvt_ig; + } + + + // count the ghost node dofs and the own element dofs element on all levels + unsigned ghost_counter = 0; + unsigned counter=0; + unsigned nel=0; + for (unsigned ig = _gridr-1u; ig<_gridn; ig++) { + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + nel++; + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for(unsigned j=0; jGetLevel(ig)->el->GetElementVertexIndex(kel,loc_vtk_conn)-1u; + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ //Is this a ghost node? + ghost_counter++; + } + } + } + } + } + + nvt_max= ( nvt_max > ghost_counter )? nvt_max : ghost_counter; + unsigned nvt0 = nvt; + nvt += ghost_counter; // total node dofs (own + ghost) + + const unsigned dim_array_coord [] = { nvt*3*sizeof(float) }; + const unsigned dim_array_conn[] = { counter*sizeof(int) }; + const unsigned dim_array_off [] = { nel*sizeof(int) }; + const unsigned dim_array_type [] = { nel*sizeof(short unsigned) }; + const unsigned dim_array_reg [] = { nel*sizeof(short unsigned) }; + const unsigned dim_array_elvar [] = { nel*sizeof(float) }; + const unsigned dim_array_ndvar [] = { nvt*sizeof(float) }; + + // initialize common buffer_void memory + unsigned buffer_size=(dim_array_coord[0]>dim_array_conn[0])? dim_array_coord[0] : dim_array_conn[0]; + void *buffer_void=new char [buffer_size]; + char *buffer_char=static_cast (buffer_void); + + size_t cch; + cch = b64::b64_encode(&buffer_char[0], buffer_size , NULL, 0); + vector enc; + enc.resize(cch); + char *pt_char; + + fout << " " << std::endl; + + //----------------------------------------------------------------------------------------------- + // print coordinates *********************************************Solu******************************************* + fout << " " << std::endl; + fout << " " << std::endl; + + + vector < NumericVector* > mysol(_gridn); + for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { + mysol[ig] = NumericVector::build().release(); + + if(n_processors()==1) { // IF SERIAL + mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], + _ml_mesh->GetLevel(ig)->own_size[index][_nprocs],false,SERIAL); + } + else{ // IF PARALLEL + mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs], + _ml_mesh->GetLevel(ig)->own_size[index][_iproc], + _ml_mesh->GetLevel(ig)->ghost_nd_mts[index][_iproc],false,GHOSTED ); + } + } + + // point pointer to common mamory area buffer of void type; + float *var_coord= static_cast(buffer_void); + unsigned offset_ig = 0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + unsigned nvt_ig = _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; + for (int i = 0; i < 3; i++) { + mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2) ); + for (unsigned ii = 0; ii < nvt_ig; ii++) { + var_coord[ offset_ig + ii*3 + i] = (*mysol[ig])(ii + offset_iprc); + } + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { // if moving mesh + unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); + mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indDXDYDZ)) ); + for (unsigned ii=0; iiGetLevel(ig)->MetisOffset[index][_iproc]; + unsigned icounter; + for (int i=0; i<3; i++) { + mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)-> _coordinate->_Sol[i], + *_ml_mesh->GetLevel(ig)-> GetQitoQjProjection(index,2) ); + icounter=0; + for (int iel = _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc]; + iel < _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(kel,index); j++) { + unsigned loc_vtk_conn = map_pr[j]; + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(kel,loc_vtk_conn)-1u; + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_coord[ offset_ig + icounter + i] = (*mysol[ig])(jnodeMetis); + icounter += 3; + } + } + } + } + if (_ml_sol != NULL && _moving_mesh && _ml_mesh->GetLevel(0)->GetDimension() > i) { // if moving mesh + unsigned indDXDYDZ=_ml_sol->GetIndex(_moving_vars[i].c_str()); + mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indDXDYDZ)) ); + icounter=0; + for (int iel = _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc]; + iel < _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(kel,index); j++) { + unsigned loc_vtk_conn = map_pr[j]; + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(kel,loc_vtk_conn)-1u; + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_coord[ offset_ig + icounter + i] += (*mysol[ig])(jnodeMetis); + icounter += 3; + } + } + } + } + } + } + offset_ig += icounter; + } + + cch = b64::b64_encode(&dim_array_coord[0], sizeof(dim_array_coord), NULL, 0); + b64::b64_encode(&dim_array_coord[0], sizeof(dim_array_coord), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + fout << " " << std::endl; + //----------------------------------------------------------------------------------------------- + + //----------------------------------------------------------------------------------------------- + // Printing of element connectivity - offset - format type * + fout << " " << std::endl; + + //----------------------------------------------------------------------------------------------- + //print connectivity + fout << " " << std::endl; + + // point pointer to common mamory area buffer of void type; + int *var_conn = static_cast (buffer_void); + icount = 0; + ghost_counter = 0; + unsigned offset_nvt=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + unsigned nvt_ig= _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(kel,index); j++) { + unsigned loc_vtk_conn = map_pr[j]; + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(kel,loc_vtk_conn)-1u; + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + var_conn[icount] = (jnodeMetis >= offset_iprc )? jnodeMetis - offset_iprc + offset_nvt : nvt0 + (ghost_counter++); + icount++; + } + } + } + offset_nvt+= nvt_ig; + } + + //print connectivity dimension + cch = b64::b64_encode(&dim_array_conn[0], sizeof(dim_array_conn), NULL, 0); + b64::b64_encode(&dim_array_conn[0], sizeof(dim_array_conn), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + //------------------------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------------------------- + //printing offset + fout << " " << std::endl; + + // point pointer to common mamory area buffer of void type; + int *var_off=static_cast (buffer_void); + icount = 0; + int offset_el=0; + //print offset array + + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + offset_el += _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(kel,index); + var_off[icount] = offset_el; + icount++; + } + } + } + + //print offset dimension + cch = b64::b64_encode(&dim_array_off[0], sizeof(dim_array_off), NULL, 0); + b64::b64_encode(&dim_array_off[0], sizeof(dim_array_off), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + //-------------------------------------------------------------------------------------------------- + + //-------------------------------------------------------------------------------------------------- + //Element format type : 23:Serendipity(8-nodes) 28:Quad9-Biquadratic + fout << " " << std::endl; + + // point pointer to common mamory area buffer of void type; + unsigned short *var_type = static_cast (buffer_void); + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { + if (ig==_gridn-1u || _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + short unsigned ielt= _ml_mesh->GetLevel(ig)->el->GetElementType(iel_Metis); + var_type[icount] = femusToVtkCellType[index][ielt]; + icount++; + } + } + } + + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt= _ml_mesh->GetLevel(ig)->el->GetElementType(kel); + var_type[icount] = femusToVtkCellType[index][ielt]; + icount++; + } + } + } + + //print element format dimension + cch = b64::b64_encode(&dim_array_type[0], sizeof(dim_array_type), NULL, 0); + b64::b64_encode(&dim_array_type[0], sizeof(dim_array_type), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + //---------------------------------------------------------------------------------------------------- +// + fout << " " << std::endl; + //-------------------------------------------------------------------------------------------------- + + // /Print Cell Data **************************************************************************** + fout << " " << std::endl; + + //-------------------------------------------------------------------------------------------- + // Print Regions + fout << " " << std::endl; + + // point pointer to common mamory area buffer of void type; + unsigned short* var_reg=static_cast (buffer_void); + + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + var_reg[icount]= _ml_mesh->GetLevel(ig)->el->GetElementGroup(kel); + icount++; + } + } + } + + //print regions dimension + cch = b64::b64_encode(&dim_array_reg[0], sizeof(dim_array_reg), NULL, 0); + b64::b64_encode(&dim_array_reg[0], sizeof(dim_array_reg), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + + //----------------------------------------------------------------------------------------------------- + // Print Metis Partitioning + fout << " " << std::endl; + + // point pointer to common mamory area buffer of void type; + unsigned short* var_proc=static_cast (buffer_void); + + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (int iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + var_proc[icount]=(unsigned short)(_ml_mesh->GetLevel(ig)->epart[kel]); + icount++; + } + } + } + + //print regions dimension + cch = b64::b64_encode(&dim_array_reg[0], sizeof(dim_array_reg), NULL, 0); + b64::b64_encode(&dim_array_reg[0], sizeof(dim_array_reg), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + + if (_ml_sol == NULL) { + delete [] var_proc; + } + + if (_ml_sol != NULL) { + //Print Solution (on element) *************************************************************** + for (unsigned i=0; i<(!print_all)*vars.size() + print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=( print_all == 0 ) ? _ml_sol->GetIndex(vars[i].c_str()):i; + if (3 <= _ml_sol->GetSolutionType(indx)) { + fout << " GetSolutionName(indx) <<"\" format=\"binary\">" << std::endl; + // point pointer to common memory area buffer of void type; + float *var_el = static_cast< float*> (buffer_void); + icount=0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + for (unsigned iel=_ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc]; iel < _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(kel,_ml_sol->GetSolutionType(i)); + var_el[icount] = (*_ml_sol->GetSolutionLevel(ig)->_Sol[i])(iel_Metis); + icount++; + } + } + } + + //print solution on element dimension + cch = b64::b64_encode(&dim_array_elvar[0], sizeof(dim_array_elvar), NULL, 0); + b64::b64_encode(&dim_array_elvar[0], sizeof(dim_array_elvar), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + //---------------------------------------------------------------------------------------------------- + } + } //end _ml_sol != NULL + } + fout << " " << std::endl; + // //------------------------------------------------------------------------------------------------ + + if (_ml_sol != NULL) { + // //------------------------------------------------------------------------------------------------ + // / Print Solution (on nodes) ******************************************************************** + fout<< " " << std::endl; + //Loop on variables + + // point pointer to common memory area buffer of void type; + float* var_nd = static_cast(buffer_void); + for (unsigned i=0; i<(!print_all)*vars.size()+ print_all*_ml_sol->GetSolutionSize(); i++) { + unsigned indx=( print_all == 0 )?_ml_sol->GetIndex(vars[i].c_str()):i; + if (_ml_sol->GetSolutionType(indx)<3) { + fout << " GetSolutionName(indx) <<"\" format=\"binary\">" << std::endl; + //print solutions on nodes dimension + cch = b64::b64_encode(&dim_array_ndvar[0], sizeof(dim_array_ndvar), NULL, 0); + b64::b64_encode(&dim_array_ndvar[0], sizeof(dim_array_ndvar), &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; iGetLevel(ig)->MetisOffset[index][_iproc]; + unsigned nvt_ig = _ml_mesh->GetLevel(ig)->own_size[index][_iproc]; + + mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indx)) ); + + for (unsigned ii = 0; ii < nvt_ig; ii++) { + var_nd[ offset_ig + ii ] = (*mysol[ig])(ii + offset_iprc); + } + offset_ig += nvt_ig; + } + unsigned icounter = 0; + for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { + unsigned offset_iprc = _ml_mesh->GetLevel(ig)->MetisOffset[index][_iproc]; + for (int iel = _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc]; + iel < _ml_mesh->GetLevel(ig)-> IS_Mts2Gmt_elem_offset[_iproc+1]; iel++) { + unsigned kel = _ml_mesh->GetLevel(ig)->IS_Mts2Gmt_elem[iel]; + if ( ig == _gridn-1u || 0 == _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(kel)) { + short unsigned ielt=_ml_mesh->GetLevel(ig)->el->GetElementType(kel); + for (unsigned j=0; j<_ml_mesh->GetLevel(ig)->el->GetElementDofNumber(kel,index); j++) { + unsigned loc_vtk_conn = map_pr[j]; + unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(kel,loc_vtk_conn)-1u; + unsigned jnodeMetis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode, index); + if( jnodeMetis < offset_iprc ){ + var_nd[ offset_ig + icounter] = (*mysol[ig])(jnodeMetis); + icounter++; + } + } + } + } + } + + cch = b64::b64_encode(&var_nd[0], dim_array_ndvar [0], NULL, 0); + b64::b64_encode(&var_nd[0], dim_array_ndvar [0], &enc[0], cch); + pt_char=&enc[0]; + for( unsigned i =0; i" << std::endl; + } //endif + } // end for sol + fout << " " << std::endl; + delete [] var_nd; + } //end _ml_sol != NULL + + //------------------------------------------------------------------------------------------------ + + fout << " " << std::endl; + fout << " " << std::endl; + fout << "" << std::endl; + fout.close(); + + //----------------------------------------------------------------------------------------------------- + //free memory + for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { + delete mysol[ig]; + } + + //-------------------------------------------------------------------------------------------------------- + return; +} + + + + + + + + } //end namespace femus diff --git a/src/solution/VTKWriter.hpp b/src/solution/VTKWriter.hpp index ef0b65b08..4005f0df6 100644 --- a/src/solution/VTKWriter.hpp +++ b/src/solution/VTKWriter.hpp @@ -46,8 +46,8 @@ class VTKWriter : public Writer { virtual ~VTKWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; - + void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; + void ParallelWrite(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step=0) const; private: /** femus to vtk cell type map */ diff --git a/src/solution/XDMFWriter.hpp b/src/solution/XDMFWriter.hpp index 0917846c7..1996d962d 100644 --- a/src/solution/XDMFWriter.hpp +++ b/src/solution/XDMFWriter.hpp @@ -45,7 +45,7 @@ class XDMFWriter : public Writer { virtual ~XDMFWriter(); /** write output function */ - virtual void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const; + void write(const std::string output_path, const char order[], const std::vector < std::string > & vars = std::vector < std::string > (), const unsigned time_step = 0) const; /** write a wrapper file for paraview to open all the files of an history together */ void write_solution_wrapper(const std::string output_path, const char type[]) const; diff --git a/src/utils/FemusInit.cpp b/src/utils/FemusInit.cpp index 319a09246..64b66d912 100644 --- a/src/utils/FemusInit.cpp +++ b/src/utils/FemusInit.cpp @@ -44,7 +44,7 @@ FemusInit::FemusInit( int i; MPI_Comm_rank(MPI_COMM_WORLD, &i); - if ( i != 0 ) { + if ( i != 1 ) { std::cout.rdbuf(NULL); } #endif From 714d40c834845477aafb1bd65781d37025343ab0 Mon Sep 17 00:00:00 2001 From: eugenio aulisa Date: Fri, 13 Mar 2015 09:18:36 -0500 Subject: [PATCH 76/91] serial vtk working --- applications/Poisson/main.cpp | 4 ++- src/solution/VTKWriter.cpp | 51 ++++++++++++++--------------------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/applications/Poisson/main.cpp b/applications/Poisson/main.cpp index 5cb0afbc4..a697be447 100644 --- a/applications/Poisson/main.cpp +++ b/applications/Poisson/main.cpp @@ -256,7 +256,9 @@ int main(int argc,char **argv) { VTKWriter vtkio(&ml_sol); vtkio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); - + vtkio.write(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); + + GMVWriter gmvio(&ml_sol); gmvio.ParallelWrite(DEFAULT_OUTPUTDIR,"biquadratic",print_vars); // diff --git a/src/solution/VTKWriter.cpp b/src/solution/VTKWriter.cpp index 2d5b10efa..82dd61f47 100644 --- a/src/solution/VTKWriter.cpp +++ b/src/solution/VTKWriter.cpp @@ -49,19 +49,11 @@ void VTKWriter::write(const std::string output_path, const char order[], const s print_all += !(vars[ivar].compare("All")) + !(vars[ivar].compare("all")) + !(vars[ivar].compare("ALL")); } - int icount; + int icount; unsigned index=0; - unsigned index_nd=0; - if (!strcmp(order,"linear")) { //linear - index=0; - index_nd=0; - } else if (!strcmp(order,"quadratic")) { //quadratic - index=1; - index_nd=1; - } else if (!strcmp(order,"biquadratic")) { //biquadratic - index=2; /// @todo why is there a 2 while XDMF has a 3? - index_nd=2; - } + if (!strcmp(order,"linear")) index=0; //linear + else if (!strcmp(order,"quadratic")) index=1; //quadratic + else if (!strcmp(order,"biquadratic")) index=2; //biquadratic std::string filename_prefix; @@ -97,7 +89,7 @@ void VTKWriter::write(const std::string output_path, const char order[], const s unsigned nvt=0; for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; nvt+=nvt_ig; } @@ -150,7 +142,7 @@ void VTKWriter::write(const std::string output_path, const char order[], const s vector mysol(_gridn); for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { mysol[ig] = NumericVector::build().release(); - mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index_nd][_iproc],true,AUTOMATIC); + mysol[ig]->init(_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs],_ml_mesh->GetLevel(ig)->own_size[index][_iproc],true,AUTOMATIC); } // point pointer to common mamory area buffer of void type; @@ -159,10 +151,10 @@ void VTKWriter::write(const std::string output_path, const char order[], const s unsigned offset_nvt3=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { std::vector v_local; - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; for(int kk=0;kk<3;kk++) { mysol[ig]->matrix_mult(*_ml_mesh->GetLevel(ig)->_coordinate->_Sol[kk], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,2)); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,2)); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; i v_local; - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; for(int kk=0;kk<_ml_mesh->GetLevel(0)->GetDimension();kk++) { mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indDXDYDZ[kk]], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indDXDYDZ[kk]))); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indDXDYDZ[kk]))); mysol[ig]->localize_to_one(v_local,0); if(_iproc==0) { for (unsigned i=0; iGetLevel(ig)->el->GetElementDofNumber(iel,index); j++) { unsigned loc_vtk_conn = map_pr[j]; unsigned jnode=_ml_mesh->GetLevel(ig)->el->GetElementVertexIndex(iel,loc_vtk_conn)-1u; - unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index_nd); + unsigned jnode_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(jnode,index); var_conn[icount] = offset_nvt+jnode_Metis; icount++; } } } - offset_nvt+=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + offset_nvt+=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; } //print connectivity dimension @@ -276,8 +268,7 @@ void VTKWriter::write(const std::string output_path, const char order[], const s for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { for (unsigned iel=0; iel<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); iel++) { if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(iel)) { - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(iel,3); - offset_el += _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel_Metis,index); + offset_el += _ml_mesh->GetLevel(ig)->el->GetElementDofNumber(iel,index); var_off[icount] = offset_el; icount++; } @@ -311,8 +302,8 @@ void VTKWriter::write(const std::string output_path, const char order[], const s for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { if (ig==_gridn-1u || _ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)==0) { - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); - short unsigned ielt= _ml_mesh->GetLevel(ig)->el->GetElementType(iel_Metis); + //unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); + short unsigned ielt= _ml_mesh->GetLevel(ig)->el->GetElementType(ii); var_type[icount] = femusToVtkCellType[index][ielt]; icount++; } @@ -351,7 +342,6 @@ void VTKWriter::write(const std::string output_path, const char order[], const s for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); var_reg[icount]= _ml_mesh->GetLevel(ig)->el->GetElementGroup(ii); icount++; } @@ -384,7 +374,6 @@ void VTKWriter::write(const std::string output_path, const char order[], const s for (unsigned ig=_gridr-1u; ig<_gridn; ig++) { for (unsigned ii=0; ii<_ml_mesh->GetLevel(ig)->GetNumberOfElements(); ii++) { if ( ig==_gridn-1u || 0==_ml_mesh->GetLevel(ig)->el->GetRefinedElementIndex(ii)) { - unsigned iel_Metis = _ml_mesh->GetLevel(ig)->GetMetisDof(ii,3); var_proc[icount]=(unsigned short)(_ml_mesh->GetLevel(ig)->epart[ii]); icount++; } @@ -474,10 +463,10 @@ void VTKWriter::write(const std::string output_path, const char order[], const s unsigned offset_nvt=0; for(unsigned ig=_gridr-1u; ig<_gridn; ig++) { mysol[ig]->matrix_mult(*_ml_sol->GetSolutionLevel(ig)->_Sol[indx], - *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index_nd,_ml_sol->GetSolutionType(indx)) ); + *_ml_mesh->GetLevel(ig)->GetQitoQjProjection(index,_ml_sol->GetSolutionType(indx)) ); vector sol_local; mysol[ig]->localize_to_one(sol_local,0); - unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index_nd][_nprocs]; + unsigned nvt_ig=_ml_mesh->GetLevel(ig)->MetisOffset[index][_nprocs]; for (unsigned ii=0; ii Date: Fri, 13 Mar 2015 14:05:38 -0500 Subject: [PATCH 77/91] added different meshes in tutorial Ex2 --- .../NumPdeSpring2015/tutorial/Ex2/Ex2.cpp | 16 +- .../tutorial/Ex2/input/gambit/square.dbs | Bin 172032 -> 0 bytes .../tutorial/Ex2/input/square.neu | 1711 ----------------- src/utils/FemusInit.cpp | 2 +- 4 files changed, 15 insertions(+), 1714 deletions(-) delete mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/square.dbs delete mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/square.neu diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp index 031b121c4..59ebbfd8b 100644 --- a/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp +++ b/applications/NumPdeSpring2015/tutorial/Ex2/Ex2.cpp @@ -19,8 +19,15 @@ using namespace femus; bool SetBoundaryCondition(const double &x, const double &y, const double &z,const char name[], double &value, const int facename, const double time) { bool dirichlet=1; //dirichlet + if(1 == facename){ + dirichlet=1; + } + else if(2 == facename){ + dirichlet=0; + } value=0.; return dirichlet; + } void AssemblePoissonProblem(MultiLevelProblem &ml_prob, unsigned level, const unsigned &levelMax, const bool &assembleMatrix); @@ -37,11 +44,16 @@ int main(int argc, char **args) { MultiLevelMesh mlMsh; // read coarse level mesh and generate finers level meshes double scalingFactor=1.; - mlMsh.ReadCoarseMesh("./input/square.neu","seventh",scalingFactor); + //mlMsh.ReadCoarseMesh("./input/square_quad.neu","fifth",scalingFactor); + //mlMsh.ReadCoarseMesh("./input/square_tri.neu","fifth",scalingFactor); + //mlMsh.ReadCoarseMesh("./input/cube_hex.neu","fifth",scalingFactor); + mlMsh.ReadCoarseMesh("./input/cube_all_shapes.neu","fifth",scalingFactor); /* "seventh" is the order of accuracy that is used in the gauss integration scheme probably in the furure it is not going to be an argument of this function */ - unsigned maxNumberOfMeshes = 5; + const unsigned dim = mlMsh.GetLevel(0)->GetDimension(); + + unsigned maxNumberOfMeshes = (dim == 2)? 7 : 4; vector < vector < double > > semiNorm; semiNorm.resize(maxNumberOfMeshes); diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/square.dbs b/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/square.dbs deleted file mode 100644 index ac2d8f2252bc428de49aa9238e2e8eadad808c8a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172032 zcmeF4349!9dH-j2l|*qa*>Mu(-WU=LA&P7#!9ZI{me!UMNxSHXzbO^+_7p|`^4zTfzj=mRXqqcj&98~zdX~t?iFk9dPVcgGVT2XnYGPp?p(F3XW#Z+ zJ9dfQz`;>ZZ%s3*uUNPC70qiydfg-Y4`c@SqqyPFfl)lMta;g*JJzjTwQOM5f!(lr z_htMwk)4BO)v~Y=XY*S+);deNEXzC2Z8PVj3GN40FWQd#f%OaOx*t94xF0(=ZClWp zrQm+*RKQ6+HW{qfR+5iE>P@BCd*136&J|}dI>|S^=AjmWS_Enls6}8YBXCO*?{5RH zPj4wgSyml$oMpq_s^d&SMV%bl0PH-1^8IXPE%fTzaE5Y}G?*-onT0kpk0~J;mtzaA24o1NauoH}dUEuq{ z>%eZX2kZs=z&LmSOo09105}L91P_5pa0omM9s!Sn$H42s<6w%RMCa0z;4DMB9$@pb zBVY!=zw8Xd+yI(ED>w{}f@1)g4F7Uu%aJX|-trkRM@lpRcq{0`3Vf`9ze4zDNR`!K z7>on>m&3mt|0^>f52&+p3gBbqDR9P5t1GB?#d<*9E5-rxD`o+8udD~1UJDe)?XG>}u*?eHb9S8rd}tXa>XJ z2q*$czbO@WhOj?Do6_3*EUe?9!`ivZaT4FK59& z&br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%XW$vtn(z0GwqceSR)6i^(L#yg_cr@Ow< zC7T0HveW#8w7>UtBFA=|Rd3v?ozmudqHgMZG50c;CC%J7*Sab*gLrDZRVUMU>K%+b zH55-X_Z3&6AIoOk72nik+OB+~OS Date: Fri, 13 Mar 2015 14:07:38 -0500 Subject: [PATCH 78/91] added mesh files in tutorial Ex2 --- .../tutorial/Ex2/input/cube_all_shapes.neu | 240 ++++++++++++++++++ .../tutorial/Ex2/input/cube_hex.neu | 205 +++++++++++++++ .../Ex2/input/gambit/cube_all_shapes.dbs | Bin 0 -> 299008 bytes .../tutorial/Ex2/input/gambit/cube_hex.dbs | Bin 0 -> 299008 bytes .../tutorial/Ex2/input/gambit/square_quad.dbs | Bin 0 -> 131072 bytes .../tutorial/Ex2/input/gambit/square_tri.dbs | Bin 0 -> 131072 bytes .../tutorial/Ex2/input/square_quad.neu | 62 +++++ .../tutorial/Ex2/input/square_tri.neu | 62 +++++ 8 files changed, 569 insertions(+) create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/cube_all_shapes.neu create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/cube_hex.neu create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_all_shapes.dbs create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_hex.dbs create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/square_quad.dbs create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/square_tri.dbs create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/square_quad.neu create mode 100644 applications/NumPdeSpring2015/tutorial/Ex2/input/square_tri.neu diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_all_shapes.neu b/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_all_shapes.neu new file mode 100644 index 000000000..948292db5 --- /dev/null +++ b/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_all_shapes.neu @@ -0,0 +1,240 @@ + CONTROL INFO 2.3.16 +** GAMBIT NEUTRAL FILE +cube_all_shapes +PROGRAM: Gambit VERSION: 2.3.16 +13 Mar 2015 13:26:17 + NUMNP NELEM NGRPS NBSETS NDFCD NDFVL + 131 20 1 2 3 3 +ENDOFSECTION + NODAL COORDINATES 2.3.16 + 1 5.00000000000e-01 0.00000000000e+00 5.00000000000e-01 + 2 0.00000000000e+00 0.00000000000e+00 5.00000000000e-01 + 3 2.50000000000e-01 0.00000000000e+00 5.00000000000e-01 + 4 0.00000000000e+00 0.00000000000e+00 0.00000000000e+00 + 5 0.00000000000e+00 0.00000000000e+00 2.50000000000e-01 + 6 5.00000000000e-01 0.00000000000e+00 0.00000000000e+00 + 7 2.50000000000e-01 0.00000000000e+00 0.00000000000e+00 + 8 5.00000000000e-01 0.00000000000e+00 2.50000000000e-01 + 9 5.00000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 10 0.00000000000e+00 -5.00000000000e-01 -5.00000000000e-01 + 11 2.50000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 12 -5.00000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 13 -5.00000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 14 -5.00000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 15 5.00000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 16 5.00000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 17 5.00000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 18 -5.00000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 19 0.00000000000e+00 5.00000000000e-01 -5.00000000000e-01 + 20 -2.50000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 21 -5.00000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 22 -5.00000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 23 -5.00000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 24 5.00000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 25 5.00000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 26 5.00000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 27 -5.00000000000e-01 5.00000000000e-01 5.00000000000e-01 + 28 -5.00000000000e-01 5.00000000000e-01 0.00000000000e+00 + 29 -5.00000000000e-01 5.00000000000e-01 2.50000000000e-01 + 30 5.00000000000e-01 5.00000000000e-01 5.00000000000e-01 + 31 5.00000000000e-01 5.00000000000e-01 0.00000000000e+00 + 32 5.00000000000e-01 5.00000000000e-01 2.50000000000e-01 + 33 0.00000000000e+00 -5.00000000000e-01 5.00000000000e-01 + 34 -2.50000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 35 -5.00000000000e-01 0.00000000000e+00 5.00000000000e-01 + 36 -5.00000000000e-01 2.50000000000e-01 5.00000000000e-01 + 37 5.00000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 38 0.00000000000e+00 5.00000000000e-01 5.00000000000e-01 + 39 2.50000000000e-01 5.00000000000e-01 5.00000000000e-01 + 40 0.00000000000e+00 5.00000000000e-01 0.00000000000e+00 + 41 0.00000000000e+00 5.00000000000e-01 -2.50000000000e-01 + 42 0.00000000000e+00 2.50000000000e-01 0.00000000000e+00 + 43 2.50000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 44 0.00000000000e+00 0.00000000000e+00 -5.00000000000e-01 + 45 0.00000000000e+00 0.00000000000e+00 -2.50000000000e-01 + 46 0.00000000000e+00 -5.00000000000e-01 0.00000000000e+00 + 47 0.00000000000e+00 -2.50000000000e-01 0.00000000000e+00 + 48 -5.00000000000e-01 0.00000000000e+00 0.00000000000e+00 + 49 -2.50000000000e-01 0.00000000000e+00 0.00000000000e+00 + 50 5.00000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 51 5.00000000000e-01 2.50000000000e-01 0.00000000000e+00 + 52 2.50000000000e-01 5.00000000000e-01 0.00000000000e+00 + 53 0.00000000000e+00 2.50000000000e-01 -5.00000000000e-01 + 54 0.00000000000e+00 5.00000000000e-01 2.50000000000e-01 + 55 5.00000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 56 0.00000000000e+00 2.50000000000e-01 5.00000000000e-01 + 57 5.00000000000e-01 2.50000000000e-01 5.00000000000e-01 + 58 -2.50000000000e-01 5.00000000000e-01 5.00000000000e-01 + 59 -5.00000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 60 -5.00000000000e-01 2.50000000000e-01 0.00000000000e+00 + 61 -2.50000000000e-01 5.00000000000e-01 0.00000000000e+00 + 62 -5.00000000000e-01 0.00000000000e+00 2.50000000000e-01 + 63 -5.00000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 64 -2.50000000000e-01 0.00000000000e+00 5.00000000000e-01 + 65 5.00000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 66 2.50000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 67 5.00000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 68 0.00000000000e+00 -5.00000000000e-01 2.50000000000e-01 + 69 2.50000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 70 0.00000000000e+00 -2.50000000000e-01 5.00000000000e-01 + 71 -2.50000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 72 0.00000000000e+00 -2.50000000000e-01 -5.00000000000e-01 + 73 -2.50000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 74 -5.00000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 75 -5.00000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 76 0.00000000000e+00 -5.00000000000e-01 -2.50000000000e-01 + 77 -5.00000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 78 -2.50000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 79 -5.00000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 80 5.00000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 81 2.50000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 82 2.50000000000e-01 0.00000000000e+00 2.50000000000e-01 + 83 0.00000000000e+00 2.50000000000e-01 2.50000000000e-01 + 84 2.50000000000e-01 2.50000000000e-01 5.00000000000e-01 + 85 2.50000000000e-01 5.00000000000e-01 2.50000000000e-01 + 86 5.00000000000e-01 2.50000000000e-01 2.50000000000e-01 + 87 2.50000000000e-01 2.50000000000e-01 0.00000000000e+00 + 88 3.22697570998e-01 2.51015938588e-01 2.50660192370e-01 + 89 4.11348785499e-01 1.25507969294e-01 3.75330096185e-01 + 90 4.11348785499e-01 3.75507969294e-01 1.25330096185e-01 + 91 4.11348785499e-01 3.75507969294e-01 3.75330096185e-01 + 92 4.11348785499e-01 1.25507969294e-01 1.25330096185e-01 + 93 1.61348785499e-01 3.75507969294e-01 1.25330096185e-01 + 94 1.61348785499e-01 1.25507969294e-01 3.75330096185e-01 + 95 2.50000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 96 5.00000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 97 0.00000000000e+00 2.50000000000e-01 -2.50000000000e-01 + 98 2.50000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 99 2.50000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 100 2.50000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 101 -2.50000000000e-01 5.00000000000e-01 2.50000000000e-01 + 102 -2.50000000000e-01 2.50000000000e-01 5.00000000000e-01 + 103 -2.50000000000e-01 2.50000000000e-01 0.00000000000e+00 + 104 -2.50000000000e-01 0.00000000000e+00 2.50000000000e-01 + 105 -5.00000000000e-01 2.50000000000e-01 2.50000000000e-01 + 106 -2.50000000000e-01 2.50000000000e-01 2.50000000000e-01 + 107 -2.50000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 108 0.00000000000e+00 -2.50000000000e-01 2.50000000000e-01 + 109 -5.00000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 110 -2.50000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 111 -2.50000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 112 -2.50000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 113 5.00000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 114 2.50000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 115 0.00000000000e+00 -2.50000000000e-01 -2.50000000000e-01 + 116 2.50000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 117 2.50000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 118 2.50000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 119 -2.50000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 120 -5.00000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 121 -2.50000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 122 -2.50000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 123 -2.50000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 124 -2.50000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 125 -2.50000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 126 -5.00000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 127 -2.50000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 128 2.50000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 129 5.00000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 130 2.50000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 131 2.50000000000e-01 -2.50000000000e-01 2.50000000000e-01 +ENDOFSECTION + ELEMENTS/CELLS 2.3.16 + 1 6 10 88 89 1 90 86 31 91 + 57 32 30 + 2 6 10 88 89 1 92 8 6 90 + 86 51 31 + 3 6 10 88 93 40 91 85 30 90 + 52 32 31 + 4 6 10 88 93 40 90 52 31 92 + 87 51 6 + 5 6 10 88 89 1 94 3 2 92 + 8 82 6 + 6 6 10 88 94 2 89 3 1 91 + 84 57 30 + 7 6 10 40 87 6 83 82 2 42 + 7 5 4 + 8 6 10 40 93 88 83 94 2 87 + 92 82 6 + 9 6 10 40 83 2 85 84 30 54 + 56 39 38 + 10 6 10 40 93 88 85 91 30 83 + 94 84 2 + 11 5 18 6 7 4 87 42 40 55 + 95 45 100 97 41 16 81 + 44 99 53 19 + 12 5 18 6 87 40 51 52 31 55 + 100 41 96 98 50 16 99 + 19 17 43 15 + 13 5 18 4 5 2 42 83 40 49 + 104 64 103 106 61 48 62 + 35 60 105 28 + 14 5 18 2 56 38 83 54 40 64 + 102 58 106 101 61 35 36 + 27 105 29 28 + 15 4 27 46 47 4 78 107 49 22 + 79 48 68 108 5 110 112 + 104 23 109 62 33 70 2 + 34 111 64 21 63 35 + 16 4 27 6 67 25 7 116 66 4 + 47 46 55 113 65 95 118 + 117 45 115 76 16 80 9 + 81 114 11 44 72 10 + 17 4 27 46 76 10 78 121 71 22 + 75 12 47 115 72 107 123 + 122 79 120 14 4 45 44 + 49 119 73 48 77 13 + 18 4 27 40 42 4 61 103 49 28 + 60 48 41 97 45 124 127 + 119 59 126 77 19 53 44 + 20 125 73 18 74 13 + 19 5 18 4 7 6 5 82 2 47 + 116 67 108 131 70 46 66 + 25 68 130 33 + 20 5 18 6 8 1 82 3 2 67 + 129 37 131 128 70 25 26 + 24 130 69 33 +ENDOFSECTION + ELEMENT GROUP 2.3.16 +GROUP: 1 ELEMENTS: 20 MATERIAL: 2 NFLAGS: 1 + 7 + 0 + 18 11 12 15 17 16 19 20 13 14 + 1 2 3 4 5 6 7 8 9 10 +ENDOFSECTION + BOUNDARY CONDITIONS 2.3.16 + 1 1 20 0 6 + 17 4 3 + 17 4 5 + 15 4 3 + 15 4 4 + 20 5 1 + 19 5 5 + 20 5 5 + 16 4 2 + 16 4 1 + 1 6 3 + 2 6 3 + 3 6 3 + 9 6 4 + 12 5 3 + 12 5 2 + 14 5 2 + 18 4 4 + 18 4 3 + 13 5 5 + 14 5 5 +ENDOFSECTION + BOUNDARY CONDITIONS 2.3.16 + 2 1 10 0 6 + 18 4 6 + 11 5 5 + 12 5 5 + 16 4 6 + 17 4 2 + 15 4 6 + 20 5 2 + 14 5 1 + 9 6 3 + 6 6 3 +ENDOFSECTION diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_hex.neu b/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_hex.neu new file mode 100644 index 000000000..618bfd4ff --- /dev/null +++ b/applications/NumPdeSpring2015/tutorial/Ex2/input/cube_hex.neu @@ -0,0 +1,205 @@ + CONTROL INFO 2.3.16 +** GAMBIT NEUTRAL FILE +cube_hex +PROGRAM: Gambit VERSION: 2.3.16 +13 Mar 2015 13:42:57 + NUMNP NELEM NGRPS NBSETS NDFCD NDFVL + 125 8 1 2 3 3 +ENDOFSECTION + NODAL COORDINATES 2.3.16 + 1 5.00000000000e-01 5.00000000000e-01 0.00000000000e+00 + 2 5.00000000000e-01 0.00000000000e+00 0.00000000000e+00 + 3 5.00000000000e-01 2.50000000000e-01 0.00000000000e+00 + 4 0.00000000000e+00 5.00000000000e-01 0.00000000000e+00 + 5 2.50000000000e-01 5.00000000000e-01 0.00000000000e+00 + 6 0.00000000000e+00 0.00000000000e+00 0.00000000000e+00 + 7 0.00000000000e+00 2.50000000000e-01 0.00000000000e+00 + 8 2.50000000000e-01 0.00000000000e+00 0.00000000000e+00 + 9 2.50000000000e-01 2.50000000000e-01 0.00000000000e+00 + 10 5.00000000000e-01 0.00000000000e+00 5.00000000000e-01 + 11 5.00000000000e-01 0.00000000000e+00 2.50000000000e-01 + 12 5.00000000000e-01 5.00000000000e-01 5.00000000000e-01 + 13 5.00000000000e-01 5.00000000000e-01 2.50000000000e-01 + 14 5.00000000000e-01 2.50000000000e-01 5.00000000000e-01 + 15 5.00000000000e-01 2.50000000000e-01 2.50000000000e-01 + 16 0.00000000000e+00 0.00000000000e+00 5.00000000000e-01 + 17 0.00000000000e+00 0.00000000000e+00 2.50000000000e-01 + 18 2.50000000000e-01 0.00000000000e+00 5.00000000000e-01 + 19 2.50000000000e-01 0.00000000000e+00 2.50000000000e-01 + 20 0.00000000000e+00 5.00000000000e-01 5.00000000000e-01 + 21 0.00000000000e+00 5.00000000000e-01 2.50000000000e-01 + 22 0.00000000000e+00 2.50000000000e-01 5.00000000000e-01 + 23 0.00000000000e+00 2.50000000000e-01 2.50000000000e-01 + 24 2.50000000000e-01 5.00000000000e-01 5.00000000000e-01 + 25 2.50000000000e-01 5.00000000000e-01 2.50000000000e-01 + 26 2.50000000000e-01 2.50000000000e-01 5.00000000000e-01 + 27 2.50000000000e-01 2.50000000000e-01 2.50000000000e-01 + 28 -5.00000000000e-01 5.00000000000e-01 0.00000000000e+00 + 29 -2.50000000000e-01 5.00000000000e-01 0.00000000000e+00 + 30 -5.00000000000e-01 0.00000000000e+00 0.00000000000e+00 + 31 -5.00000000000e-01 2.50000000000e-01 0.00000000000e+00 + 32 -2.50000000000e-01 0.00000000000e+00 0.00000000000e+00 + 33 -2.50000000000e-01 2.50000000000e-01 0.00000000000e+00 + 34 -5.00000000000e-01 0.00000000000e+00 5.00000000000e-01 + 35 -5.00000000000e-01 0.00000000000e+00 2.50000000000e-01 + 36 -2.50000000000e-01 0.00000000000e+00 5.00000000000e-01 + 37 -2.50000000000e-01 0.00000000000e+00 2.50000000000e-01 + 38 -5.00000000000e-01 5.00000000000e-01 5.00000000000e-01 + 39 -5.00000000000e-01 5.00000000000e-01 2.50000000000e-01 + 40 -2.50000000000e-01 5.00000000000e-01 5.00000000000e-01 + 41 -2.50000000000e-01 5.00000000000e-01 2.50000000000e-01 + 42 -5.00000000000e-01 2.50000000000e-01 5.00000000000e-01 + 43 -2.50000000000e-01 2.50000000000e-01 5.00000000000e-01 + 44 -5.00000000000e-01 2.50000000000e-01 2.50000000000e-01 + 45 -2.50000000000e-01 2.50000000000e-01 2.50000000000e-01 + 46 5.00000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 47 5.00000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 48 5.00000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 49 5.00000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 50 5.00000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 51 5.00000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 52 0.00000000000e+00 -5.00000000000e-01 5.00000000000e-01 + 53 0.00000000000e+00 -2.50000000000e-01 5.00000000000e-01 + 54 0.00000000000e+00 -5.00000000000e-01 0.00000000000e+00 + 55 0.00000000000e+00 -5.00000000000e-01 2.50000000000e-01 + 56 0.00000000000e+00 -2.50000000000e-01 0.00000000000e+00 + 57 0.00000000000e+00 -2.50000000000e-01 2.50000000000e-01 + 58 2.50000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 59 2.50000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 60 2.50000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 61 2.50000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 62 2.50000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 63 2.50000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 64 5.00000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 65 5.00000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 66 5.00000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 67 5.00000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 68 5.00000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 69 5.00000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 70 0.00000000000e+00 -5.00000000000e-01 -5.00000000000e-01 + 71 0.00000000000e+00 -5.00000000000e-01 -2.50000000000e-01 + 72 0.00000000000e+00 0.00000000000e+00 -5.00000000000e-01 + 73 0.00000000000e+00 0.00000000000e+00 -2.50000000000e-01 + 74 0.00000000000e+00 -2.50000000000e-01 -5.00000000000e-01 + 75 0.00000000000e+00 -2.50000000000e-01 -2.50000000000e-01 + 76 2.50000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 77 2.50000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 78 2.50000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 79 2.50000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 80 2.50000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 81 2.50000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 82 -5.00000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 83 -2.50000000000e-01 -5.00000000000e-01 0.00000000000e+00 + 84 -5.00000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 85 -2.50000000000e-01 -2.50000000000e-01 0.00000000000e+00 + 86 -5.00000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 87 -5.00000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 88 -2.50000000000e-01 0.00000000000e+00 -5.00000000000e-01 + 89 -2.50000000000e-01 0.00000000000e+00 -2.50000000000e-01 + 90 -5.00000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 91 -5.00000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 92 -2.50000000000e-01 -5.00000000000e-01 -5.00000000000e-01 + 93 -2.50000000000e-01 -5.00000000000e-01 -2.50000000000e-01 + 94 -5.00000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 95 -2.50000000000e-01 -2.50000000000e-01 -5.00000000000e-01 + 96 -5.00000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 97 -2.50000000000e-01 -2.50000000000e-01 -2.50000000000e-01 + 98 -5.00000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 99 -5.00000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 100 -5.00000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 101 -5.00000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 102 -2.50000000000e-01 -5.00000000000e-01 5.00000000000e-01 + 103 -2.50000000000e-01 -5.00000000000e-01 2.50000000000e-01 + 104 -2.50000000000e-01 -2.50000000000e-01 5.00000000000e-01 + 105 -2.50000000000e-01 -2.50000000000e-01 2.50000000000e-01 + 106 0.00000000000e+00 5.00000000000e-01 -5.00000000000e-01 + 107 0.00000000000e+00 5.00000000000e-01 -2.50000000000e-01 + 108 0.00000000000e+00 2.50000000000e-01 -5.00000000000e-01 + 109 0.00000000000e+00 2.50000000000e-01 -2.50000000000e-01 + 110 5.00000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 111 5.00000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 112 5.00000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 113 5.00000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 114 2.50000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 115 2.50000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 116 2.50000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 117 2.50000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 118 -5.00000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 119 -2.50000000000e-01 5.00000000000e-01 -5.00000000000e-01 + 120 -5.00000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 121 -2.50000000000e-01 5.00000000000e-01 -2.50000000000e-01 + 122 -5.00000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 123 -2.50000000000e-01 2.50000000000e-01 -5.00000000000e-01 + 124 -5.00000000000e-01 2.50000000000e-01 -2.50000000000e-01 + 125 -2.50000000000e-01 2.50000000000e-01 -2.50000000000e-01 +ENDOFSECTION + ELEMENTS/CELLS 2.3.16 + 1 4 27 1 3 2 13 15 11 12 + 14 10 5 9 8 25 27 + 19 24 26 18 4 7 6 + 21 23 17 20 22 16 + 2 4 27 6 7 4 32 33 29 30 + 31 28 17 23 21 37 45 + 41 35 44 39 16 22 20 + 36 43 40 34 42 38 + 3 4 27 2 8 6 47 59 56 46 + 58 54 11 19 17 51 63 + 57 50 62 55 10 18 16 + 49 61 53 48 60 52 + 4 4 27 2 8 6 65 77 73 64 + 76 72 47 59 56 69 81 + 75 68 80 74 46 58 54 + 67 79 71 66 78 70 + 5 4 27 54 71 70 83 93 92 82 + 91 90 56 75 74 85 97 + 95 84 96 94 6 73 72 + 32 89 88 30 87 86 + 6 4 27 54 83 82 55 103 99 52 + 102 98 56 85 84 57 105 + 101 53 104 100 6 32 30 + 17 37 35 16 36 34 + 7 4 27 4 7 6 107 109 73 106 + 108 72 5 9 8 116 117 + 77 114 115 76 1 3 2 + 112 113 65 110 111 64 + 8 4 27 4 7 6 29 33 32 28 + 31 30 107 109 73 121 125 + 89 120 124 87 106 108 72 + 119 123 88 118 122 86 +ENDOFSECTION + ELEMENT GROUP 2.3.16 +GROUP: 1 ELEMENTS: 8 MATERIAL: 2 NFLAGS: 1 + 7 + 0 + 8 7 6 5 4 3 2 1 +ENDOFSECTION + BOUNDARY CONDITIONS 2.3.16 + 1 1 16 0 6 + 5 4 3 + 5 4 5 + 6 4 2 + 6 4 5 + 3 4 4 + 3 4 3 + 4 4 6 + 4 4 4 + 1 4 5 + 1 4 4 + 7 4 6 + 7 4 4 + 2 4 2 + 8 4 4 + 8 4 3 + 2 4 3 +ENDOFSECTION + BOUNDARY CONDITIONS 2.3.16 + 2 1 8 0 6 + 8 4 6 + 7 4 3 + 4 4 3 + 5 4 2 + 6 4 3 + 3 4 6 + 2 4 6 + 1 4 3 +ENDOFSECTION diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_all_shapes.dbs b/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_all_shapes.dbs new file mode 100644 index 0000000000000000000000000000000000000000..3067a82e05e04eaf9053cb118e204a788f2a8b36 GIT binary patch literal 299008 zcmeFa349z!nfKp4z7&TfiW5Lk@x@ZD$DLh36Ln9A{d(D_0+Xpf9ODX-6i6}v1`IAvTpV6j-K8_T}Q*~!W&9T zHPaKCW^TcH zK~xC6q{wYHbZ0W|W-dhn)4;N~ws_lKUhYl%rE;m`cid9mk_MJEu%v+{4g7yc1FKu< z%W=CuPG~1pnZzaE1R<~tEC(yVO0WtPfV04Aa5i`WI0u{y&I5(ue6R*w04@YC1TO+F z2C`@PGq4uC1iTddId~a(IS7M`z&h{>a51<9Tna7&#o(1-J$Mzk99#iPz?GmBlmXd4 zZUmdaW^fg_8pt_w3)l)?4PFCY3tk7dfeKIwwu35A4I*F%*a>Pt6zl@mfLc%o>Ol;| z!RtW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QF{O?GPuY*}bb?4yC@C`6)*Z9l_@>k&7;9rH`4}SpuVDjnzU!r~OHZr^d zX7Ba-eHESqnto2<$!3l^%^3e>yxrkF4j-uS<_U*q9NysYR)=>v+^g^n9fzkJUhnXn z!#f<_>+rz}-#F>;T8B3}yv^Zxhxb?bUCSJvc6ip|Ee`K=cwdFXHoyvwsh6814X<-} zlf&B`-sA9r3cq{8;TeZFIK0*2T@Lpud~?U)DTmiPJm>HZhxa;su)`@KEzUib^G_WO1w{R*)1taG5h)y|9lR_UTW;AiwR4>Wn8Y@Rk+xQ;2FFFmU4 zyv6%lh4cE-`B!OqOZPR3?F#)|ygyUw=fZV)>3K`*tyP%6()uWEf2He$)?sDsboAar zyTX02((;z(uXH_DT8`rL7Ota9`$uvAEv%1Xzm(S756ap>t2DjBeb`d}jh5!G@cu*T zK3M7gR%v?0{wpl+1HJEDI!+dsqj0}*^oM2buecqI7N%F&-%8tQtMt5u^;_J}OUqH{ z=hAW%k86ePpt!t+3K0jytYF?V}Zw(ouTs zC+eAm_U-Xm06kx!Z*1zh`OXz8izA-Dwe#Em$i{N7Ohyl4xtFlcsZOX>4RK^{cE tEY%*^M_rQYag}HGox^h~cTnz=DJ#!Z>6tLSd(k=dj3tx%SzxIL{srtg^V$Fa literal 0 HcmV?d00001 diff --git a/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_hex.dbs b/applications/NumPdeSpring2015/tutorial/Ex2/input/gambit/cube_hex.dbs new file mode 100644 index 0000000000000000000000000000000000000000..5dc7ebc9a473e0273001952070b1fc305466f590 GIT binary patch literal 299008 zcmeFa2V5NIo&P_xs9?F_b|FgQtQ9*UvW-B+LP`+`RstE=4aGuAS&)Q;97$l1WF$9I z?vC>{C3lx7zD6!ru$_XFyWbI~7^f1a9B~>}8g?3SatTf)O8dXR&pb2x%m2cr!g zz0vY@(X#T*>nk>|UmvZmQRz0UT2bH8cQo4CN5ZWqj&>pmvvyO(+D$jCTG4Xw=plj{ zyQ7Xv;?99twZ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