81 m_session->MatchSolverInfo(
"DIFFUSIONADVANCEMENT",
"Explicit",
83 m_session->MatchSolverInfo(
"ADVECTIONADVANCEMENT",
"Explicit",
85 m_session->MatchSolverInfo(
"REACTIONADVANCEMENT",
"Explicit",
89 if (
m_session->DefinesSolverInfo(
"TIMEINTEGRATIONMETHOD"))
93 "TIMEINTEGRATIONMETHOD"));
101 boost::lexical_cast<std::string>(
m_time);
108 LibUtilities::FilterMap::const_iterator x;
110 for (x = f.begin(); x != f.end(); ++x)
137 TimeStability = 2.784;
156 "No CFL control implementation for this time"
157 "integration scheme");
160 return TimeStability;
173 int nfields =
m_fields.num_elements();
177 for (i = 0; i < nfields; ++i)
181 nvariables = nfields;
191 for(i = 0; i < nfields; ++i)
201 Array<OneD, Array<OneD, NekDouble> > fields(nvariables);
202 Array<OneD, Array<OneD, NekDouble> > tmp (nvariables);
205 for(i = 0; i < nvariables; ++i)
227 "Final condition not unique: "
228 "fintime > 0.0 and Nsteps > 0");
232 "Timestep not unique: timestep > 0.0 & CFL > 0.0");
239 "Only one of IO_CheckTime and IO_CheckSteps "
243 bool doCheckTime =
false;
289 if (
m_session->GetComm()->GetRank() == 0 &&
292 cout <<
"Steps: " << setw(8) << left << step+1 <<
" "
293 <<
"Time: " << setw(12) << left <<
m_time;
297 cout <<
" Time-step: " << setw(12)
302 ss << cpuTime <<
"s";
303 cout <<
" CPU Time: " << setw(8) << left
316 for (i = 0; i < nvariables; ++i)
338 vector<bool> transformed(nfields,
false);
339 for(i = 0; i < nfields; i++)
347 transformed[i] =
true;
351 for(i = 0; i < nfields; i++)
375 if (
m_session->GetComm()->GetRank() == 0)
382 cout <<
"Time-integration : " << intTime <<
"s" << endl;
388 for(i = 0; i < nfields; i++)
401 for(i = 0; i < nvariables; ++i)
444 ==
"SteadyAdvectionDiffusionReaction")
463 Array<
OneD, Array<OneD, NekDouble> > &solution1D)
473 outfile.open(
"solution1D.txt");
476 outfile << scientific << setw (17) << setprecision(16) << x[i]
477 <<
" " << solution1D[0][i] << endl;
479 outfile << endl << endl;
484 Array<
OneD, Array<OneD, NekDouble> > &physfield,
485 Array<
OneD, Array<OneD, NekDouble> > &numflux)
488 "This function is not implemented for this equation.");
492 Array<
OneD, Array<OneD, NekDouble> > &physfield,
493 Array<
OneD, Array<OneD, NekDouble> > &numfluxX,
494 Array<
OneD, Array<OneD, NekDouble> > &numfluxY )
497 "This function is not implemented for this equation.");
501 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
502 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &uflux)
506 int nvariables =
m_fields.num_elements();
507 int nqvar = uflux.num_elements();
509 Array<OneD, NekDouble > Fwd (nTraceNumPoints);
510 Array<OneD, NekDouble > Bwd (nTraceNumPoints);
511 Array<OneD, NekDouble > Vn (nTraceNumPoints, 0.0);
512 Array<OneD, NekDouble > fluxtemp(nTraceNumPoints, 0.0);
518 for (j = 0; j < nqvar; ++j)
520 for (i = 0; i < nvariables ; ++i)
523 m_fields[i]->GetFwdBwdTracePhys(ufield[i], Fwd, Bwd);
545 if(
m_fields[0]->GetBndCondExpansions().num_elements())
571 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
572 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &qfield,
573 Array<
OneD, Array<OneD, NekDouble> > &qflux)
576 int nvariables =
m_fields.num_elements();
577 int nqvar = qfield.num_elements();
580 Array<OneD, NekDouble > Fwd(nTraceNumPoints);
581 Array<OneD, NekDouble > Bwd(nTraceNumPoints);
582 Array<OneD, NekDouble > Vn (nTraceNumPoints, 0.0);
584 Array<OneD, NekDouble > qFwd (nTraceNumPoints);
585 Array<OneD, NekDouble > qBwd (nTraceNumPoints);
586 Array<OneD, NekDouble > qfluxtemp(nTraceNumPoints, 0.0);
588 Array<OneD, NekDouble > uterm(nTraceNumPoints);
592 for (
int i = 0; i < nvariables; ++i)
594 qflux[i] = Array<OneD, NekDouble> (nTraceNumPoints, 0.0);
595 for (
int j = 0; j < nqvar; ++j)
598 m_fields[i]->GetFwdBwdTracePhys(qfield[j][i],qFwd,qBwd);
622 m_fields[i]->GetFwdBwdTracePhys(ufield[i], Fwd, Bwd);
629 -1.0 * C11, uterm, 1,
639 if (
m_fields[0]->GetBndCondExpansions().num_elements())
660 if (
m_session->DefinesFunction(
"InitialConditions"))
662 for (
int i = 0; i <
m_fields.num_elements(); ++i)
667 "InitialConditions",
m_session->GetVariable(i));
673 "InitialConditions",
m_session->GetVariable(i));
675 fs::path pfilename(filename);
678 if(fs::is_directory(pfilename))
680 fs::path metafile(
"Info.xml");
681 fs::path fullpath = pfilename / metafile;
708 const Array<OneD, const NekDouble> &physfield,
709 Array<OneD, NekDouble> &penaltyflux,
712 int i, e, npoints, id1, id2;
715 int nbnd =
m_fields[var]->GetBndCondExpansions().num_elements();
720 Array<OneD, NekDouble > uplus(nTraceNumPoints);
722 m_fields[var]->ExtractTracePhys(physfield, uplus);
723 for (i = 0; i < nbnd; ++i)
727 GetBndCondExpansions()[i]->GetExpSize();
731 m_session->GetFunction(
"InitialConditions", 0);
734 GetBndCondExpansions()[i]->GetNpoints();
736 Array<OneD,NekDouble> BDphysics(npoints);
737 Array<OneD,NekDouble> x0(npoints,0.0);
738 Array<OneD,NekDouble> x1(npoints,0.0);
739 Array<OneD,NekDouble> x2(npoints,0.0);
741 m_fields[var]->GetBndCondExpansions()[i]->GetCoords(x0,x1,x2);
742 ifunc->Evaluate(x0,x1,x2,time,BDphysics);
745 for (e = 0; e < numBDEdge ; ++e)
749 GetBndCondExpansions()[i]->GetExp(e)->GetNumPoints(0);
752 GetBndCondExpansions()[i]->GetPhys_Offset(e);
756 GetBndCondTraceToGlobalTraceMap(cnt++));
759 if (
m_fields[var]->GetBndConditions()[i]->
764 &penaltyflux[id2], 1);
767 else if ((
m_fields[var]->GetBndConditions()[i])->
772 &penaltyflux[id2], 1);
786 const Array<OneD, const NekDouble> &physfield,
787 Array<OneD, NekDouble> &penaltyflux,
791 int i, e, npoints, id1, id2;
792 int nbnd =
m_fields[var]->GetBndCondExpansions().num_elements();
795 Array<OneD, NekDouble > uterm(nTraceNumPoints);
796 Array<OneD, NekDouble > qtemp(nTraceNumPoints);
799 m_fields[var]->ExtractTracePhys(physfield,qtemp);
801 for (i = 0; i < nbnd; ++i)
804 GetBndCondExpansions()[i]->GetExpSize();
808 m_session->GetFunction(
"InitialConditions", 0);
811 GetBndCondExpansions()[i]->GetNpoints();
813 Array<OneD,NekDouble> BDphysics(npoints);
814 Array<OneD,NekDouble> x0(npoints,0.0);
815 Array<OneD,NekDouble> x1(npoints,0.0);
816 Array<OneD,NekDouble> x2(npoints,0.0);
818 m_fields[var]->GetBndCondExpansions()[i]->GetCoords(x0,x1,x2);
819 ifunc->Evaluate(x0,x1,x2,time,BDphysics);
822 for (e = 0; e < numBDEdge ; ++e)
825 GetBndCondExpansions()[i]->GetExp(e)->GetNumPoints(0);
828 GetBndCondExpansions()[i]->GetPhys_Offset(e);
832 GetBndCondTraceToGlobalTraceMap(cnt++));
836 if(
m_fields[var]->GetBndConditions()[i]->
842 &penaltyflux[id2], 1);
845 else if((
m_fields[var]->GetBndConditions()[i])->
851 &penaltyflux[id2], 1);
866 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray)
878 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray)
880 ASSERTL0(
false,
"Not defined for this class");