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)
383 if (
m_session->GetSolverInfo(
"Driver") !=
"SteadyState")
385 cout <<
"Time-integration : " << intTime <<
"s" << endl;
392 for(i = 0; i < nfields; i++)
405 for(i = 0; i < nvariables; ++i)
448 ==
"SteadyAdvectionDiffusionReaction")
467 Array<
OneD, Array<OneD, NekDouble> > &solution1D)
477 outfile.open(
"solution1D.txt");
480 outfile << scientific << setw (17) << setprecision(16) << x[i]
481 <<
" " << solution1D[0][i] << endl;
483 outfile << endl << endl;
488 Array<
OneD, Array<OneD, NekDouble> > &physfield,
489 Array<
OneD, Array<OneD, NekDouble> > &numflux)
492 "This function is not implemented for this equation.");
496 Array<
OneD, Array<OneD, NekDouble> > &physfield,
497 Array<
OneD, Array<OneD, NekDouble> > &numfluxX,
498 Array<
OneD, Array<OneD, NekDouble> > &numfluxY )
501 "This function is not implemented for this equation.");
505 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
506 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &uflux)
510 int nvariables =
m_fields.num_elements();
511 int nqvar = uflux.num_elements();
513 Array<OneD, NekDouble > Fwd (nTraceNumPoints);
514 Array<OneD, NekDouble > Bwd (nTraceNumPoints);
515 Array<OneD, NekDouble > Vn (nTraceNumPoints, 0.0);
516 Array<OneD, NekDouble > fluxtemp(nTraceNumPoints, 0.0);
522 for (j = 0; j < nqvar; ++j)
524 for (i = 0; i < nvariables ; ++i)
527 m_fields[i]->GetFwdBwdTracePhys(ufield[i], Fwd, Bwd);
549 if(
m_fields[0]->GetBndCondExpansions().num_elements())
575 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
576 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &qfield,
577 Array<
OneD, Array<OneD, NekDouble> > &qflux)
580 int nvariables =
m_fields.num_elements();
581 int nqvar = qfield.num_elements();
584 Array<OneD, NekDouble > Fwd(nTraceNumPoints);
585 Array<OneD, NekDouble > Bwd(nTraceNumPoints);
586 Array<OneD, NekDouble > Vn (nTraceNumPoints, 0.0);
588 Array<OneD, NekDouble > qFwd (nTraceNumPoints);
589 Array<OneD, NekDouble > qBwd (nTraceNumPoints);
590 Array<OneD, NekDouble > qfluxtemp(nTraceNumPoints, 0.0);
592 Array<OneD, NekDouble > uterm(nTraceNumPoints);
596 for (
int i = 0; i < nvariables; ++i)
598 qflux[i] = Array<OneD, NekDouble> (nTraceNumPoints, 0.0);
599 for (
int j = 0; j < nqvar; ++j)
602 m_fields[i]->GetFwdBwdTracePhys(qfield[j][i],qFwd,qBwd);
626 m_fields[i]->GetFwdBwdTracePhys(ufield[i], Fwd, Bwd);
633 -1.0 * C11, uterm, 1,
643 if (
m_fields[0]->GetBndCondExpansions().num_elements())
664 if (
m_session->DefinesFunction(
"InitialConditions"))
666 for (
int i = 0; i <
m_fields.num_elements(); ++i)
671 "InitialConditions",
m_session->GetVariable(i));
677 "InitialConditions",
m_session->GetVariable(i));
679 fs::path pfilename(filename);
682 if(fs::is_directory(pfilename))
684 fs::path metafile(
"Info.xml");
685 fs::path fullpath = pfilename / metafile;
712 const Array<OneD, const NekDouble> &physfield,
713 Array<OneD, NekDouble> &penaltyflux,
716 int i, e, npoints, id1, id2;
719 int nbnd =
m_fields[var]->GetBndCondExpansions().num_elements();
724 Array<OneD, NekDouble > uplus(nTraceNumPoints);
726 m_fields[var]->ExtractTracePhys(physfield, uplus);
727 for (i = 0; i < nbnd; ++i)
731 GetBndCondExpansions()[i]->GetExpSize();
735 m_session->GetFunction(
"InitialConditions", 0);
738 GetBndCondExpansions()[i]->GetNpoints();
740 Array<OneD,NekDouble> BDphysics(npoints);
741 Array<OneD,NekDouble> x0(npoints,0.0);
742 Array<OneD,NekDouble> x1(npoints,0.0);
743 Array<OneD,NekDouble> x2(npoints,0.0);
745 m_fields[var]->GetBndCondExpansions()[i]->GetCoords(x0,x1,x2);
746 ifunc->Evaluate(x0,x1,x2,time,BDphysics);
749 for (e = 0; e < numBDEdge ; ++e)
753 GetBndCondExpansions()[i]->GetExp(e)->GetNumPoints(0);
756 GetBndCondExpansions()[i]->GetPhys_Offset(e);
760 GetBndCondTraceToGlobalTraceMap(cnt++));
763 if (
m_fields[var]->GetBndConditions()[i]->
768 &penaltyflux[id2], 1);
771 else if ((
m_fields[var]->GetBndConditions()[i])->
776 &penaltyflux[id2], 1);
790 const Array<OneD, const NekDouble> &physfield,
791 Array<OneD, NekDouble> &penaltyflux,
795 int i, e, npoints, id1, id2;
796 int nbnd =
m_fields[var]->GetBndCondExpansions().num_elements();
799 Array<OneD, NekDouble > uterm(nTraceNumPoints);
800 Array<OneD, NekDouble > qtemp(nTraceNumPoints);
803 m_fields[var]->ExtractTracePhys(physfield,qtemp);
805 for (i = 0; i < nbnd; ++i)
808 GetBndCondExpansions()[i]->GetExpSize();
812 m_session->GetFunction(
"InitialConditions", 0);
815 GetBndCondExpansions()[i]->GetNpoints();
817 Array<OneD,NekDouble> BDphysics(npoints);
818 Array<OneD,NekDouble> x0(npoints,0.0);
819 Array<OneD,NekDouble> x1(npoints,0.0);
820 Array<OneD,NekDouble> x2(npoints,0.0);
822 m_fields[var]->GetBndCondExpansions()[i]->GetCoords(x0,x1,x2);
823 ifunc->Evaluate(x0,x1,x2,time,BDphysics);
826 for (e = 0; e < numBDEdge ; ++e)
829 GetBndCondExpansions()[i]->GetExp(e)->GetNumPoints(0);
832 GetBndCondExpansions()[i]->GetPhys_Offset(e);
836 GetBndCondTraceToGlobalTraceMap(cnt++));
840 if(
m_fields[var]->GetBndConditions()[i]->
846 &penaltyflux[id2], 1);
849 else if((
m_fields[var]->GetBndConditions()[i])->
855 &penaltyflux[id2], 1);
870 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray)
882 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray)
884 ASSERTL0(
false,
"Not defined for this class");