24 #ifndef FRACTIONALSTEPTHETAPROBLEM_H_
25 #define FRACTIONALSTEPTHETAPROBLEM_H_
57 template<
typename OPTPROBLEM,
typename SPARSITYPATTERN,
typename VECTOR,
58 int dopedim,
int dealdim,
template<
int,
int>
class FE = dealii::FESystem,
59 template<
int,
int>
class DH = dealii::DoFHandler>
61 SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH>
65 PrimalTSBase<OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim,
68 fs_theta_ = 1.0 - std::sqrt(2.0) / 2.0;
69 fs_theta_prime_ = 1.0 - 2.0 * fs_theta_;
70 fs_alpha_ = (1.0 - 2.0 * fs_theta_) / (1.0 - fs_theta_);
71 fs_beta_ = 1.0 - fs_alpha_;
72 initial_problem_ = NULL;
77 if (initial_problem_ != NULL)
78 delete initial_problem_;
86 return "Fractional-Step-Theta";
92 dopedim, dealdim, FE, DH>, VECTOR, dealdim>&
95 if (initial_problem_ == NULL)
99 dopedim, dealdim, FE, DH>, VECTOR, dealdim>(*this);
101 return *initial_problem_;
113 template<
typename EDC>
116 dealii::Vector<double> &local_vector,
double scale,
double )
118 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
120 dealii::Vector<double> tmp(local_vector);
129 this->
GetProblem().ElementTimeEquation(edc, tmp, scale / (fs_theta_));
132 this->
GetProblem().ElementTimeEquationExplicit(edc, local_vector,
133 scale / (fs_theta_));
135 else if (this->
GetPart() ==
"Old_for_1st_cycle")
137 dealii::Vector<double> tmp(local_vector);
146 this->
GetProblem().ElementTimeEquation(edc, local_vector,
147 (-1) * scale / (fs_theta_));
149 else if (this->
GetPart() ==
"Old_for_3rd_cycle")
151 dealii::Vector<double> tmp(local_vector);
160 this->
GetProblem().ElementTimeEquation(edc, local_vector,
161 (-1) * scale / (fs_theta_));
163 else if (this->
GetPart() ==
"New_for_2nd_cycle")
165 dealii::Vector<double> tmp(local_vector);
174 this->
GetProblem().ElementTimeEquation(edc, tmp,
175 scale / (fs_theta_prime_));
178 this->
GetProblem().ElementTimeEquationExplicit(edc, local_vector,
179 scale / (fs_theta_prime_));
181 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
183 dealii::Vector<double> tmp(local_vector);
192 this->
GetProblem().ElementTimeEquation(edc, local_vector,
193 (-1) * scale / (fs_theta_prime_));
203 template<
typename EDC>
206 dealii::Vector<double> &local_vector,
double scale)
208 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
212 else if (this->
GetPart() ==
"Old_for_1st_cycle"
213 || this->
GetPart() ==
"Old_for_3rd_cycle")
215 this->
GetProblem().ElementRhs(edc, local_vector,
218 else if (this->
GetPart() ==
"New_for_2nd_cycle")
220 this->
GetProblem().ElementRhs(edc, local_vector,
223 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
235 const std::map<std::string,
const dealii::Vector<double>*> ¶m_values,
236 const std::map<std::string, const VECTOR*> &domain_values,
237 VECTOR& rhs_vector,
double scale)
239 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
243 else if (this->
GetPart() ==
"Old_for_1st_cycle"
244 || this->
GetPart() ==
"Old_for_3rd_cycle")
246 this->
GetProblem().PointRhs(param_values, domain_values, rhs_vector,
249 else if (this->
GetPart() ==
"New_for_2nd_cycle")
251 this->
GetProblem().PointRhs(param_values, domain_values, rhs_vector,
254 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
265 template<
typename EDC>
268 dealii::FullMatrix<double> &local_matrix)
270 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
272 dealii::FullMatrix<double> m(local_matrix);
277 local_matrix.add(1.0, m);
281 local_matrix.add(1.0 / (fs_theta_), m);
284 this->
GetProblem().ElementTimeMatrixExplicit(edc, m);
285 local_matrix.add(1.0 / (fs_theta_), m);
287 else if (this->
GetPart() ==
"New_for_2nd_cycle")
289 dealii::FullMatrix<double> m(local_matrix);
291 this->
GetProblem().ElementMatrix(edc, local_matrix,
294 local_matrix.add(1.0, m);
298 local_matrix.add(1.0 / (fs_theta_prime_), m);
301 this->
GetProblem().ElementTimeMatrixExplicit(edc, m);
302 local_matrix.add(1.0 / (fs_theta_prime_), m);
308 template<
typename FDC>
311 dealii::Vector<double> &local_vector,
double scale,
double)
313 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
315 this->
GetProblem().FaceEquation(fdc, local_vector,
320 else if ((this->
GetPart() ==
"Old_for_1st_cycle")
321 || (this->
GetPart() ==
"Old_for_3rd_cycle"))
323 this->
GetProblem().FaceEquation(fdc, local_vector,
327 else if (this->
GetPart() ==
"New_for_2nd_cycle")
329 this->
GetProblem().FaceEquation(fdc, local_vector,
333 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
335 this->
GetProblem().FaceEquation(fdc, local_vector,
348 template<
typename FDC>
351 dealii::Vector<double> &local_vector,
double scale,
354 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
356 this->
GetProblem().InterfaceEquation(fdc, local_vector,
361 else if ((this->
GetPart() ==
"Old_for_1st_cycle")
362 || (this->
GetPart() ==
"Old_for_3rd_cycle"))
364 this->
GetProblem().InterfaceEquation(fdc, local_vector,
368 else if (this->
GetPart() ==
"New_for_2nd_cycle")
370 this->
GetProblem().InterfaceEquation(fdc, local_vector,
374 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
376 this->
GetProblem().InterfaceEquation(fdc, local_vector,
389 template<
typename FDC>
392 dealii::Vector<double> &local_vector,
double scale = 1.)
400 template<
typename FDC>
403 dealii::FullMatrix<double> &local_matrix)
405 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
407 dealii::FullMatrix<double> m(local_matrix);
412 local_matrix.add(1., m);
414 else if (this->
GetPart() ==
"New_for_2nd_cycle")
416 dealii::FullMatrix<double> m(local_matrix);
421 local_matrix.add(1.0, m);
428 template<
typename FDC>
431 dealii::FullMatrix<double> &local_matrix)
433 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
435 dealii::FullMatrix<double> m(local_matrix);
440 local_matrix.add(1.0, m);
442 else if (this->
GetPart() ==
"New_for_2nd_cycle")
444 dealii::FullMatrix<double> m(local_matrix);
449 local_matrix.add(1.0, m);
456 template<
typename FDC>
459 dealii::Vector<double> &local_vector,
double scale,
double)
461 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
463 this->
GetProblem().BoundaryEquation(fdc, local_vector,
464 scale * fs_alpha_, scale);
466 else if ((this->
GetPart() ==
"Old_for_1st_cycle")
467 || (this->
GetPart() ==
"Old_for_3rd_cycle"))
469 this->
GetProblem().BoundaryEquation(fdc, local_vector,
473 else if (this->
GetPart() ==
"New_for_2nd_cycle")
475 this->
GetProblem().BoundaryEquation(fdc, local_vector,
479 else if (this->
GetPart() ==
"Old_for_2nd_cycle")
481 this->
GetProblem().BoundaryEquation(fdc, local_vector,
494 template<
typename FDC>
497 dealii::Vector<double> &local_vector,
double scale)
499 this->
GetProblem().BoundaryRhs(fdc, local_vector,
505 template<
typename FDC>
508 dealii::FullMatrix<double> &local_matrix)
510 if (this->
GetPart() ==
"New_for_1st_and_3rd_cycle")
512 dealii::FullMatrix<double> m(local_matrix);
517 local_matrix.add(1.0, m);
519 else if (this->
GetPart() ==
"New_for_2nd_cycle")
521 dealii::FullMatrix<double> m(local_matrix);
526 local_matrix.add(1.0, m);
532 double fs_theta_prime_;
538 dopedim, dealdim, FE, DH>, VECTOR, dealdim> * initial_problem_;
std::string GetName()
Definition: fractional_step_theta_problem.h:84
~FractionalStepThetaProblem()
Definition: fractional_step_theta_problem.h:75
void FaceRhs(const FDC &fdc, dealii::Vector< double > &local_vector, double scale=1.)
Definition: fractional_step_theta_problem.h:391
FractionalStepThetaProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH > & GetBaseProblem()
Definition: fractional_step_theta_problem.h:107
void BoundaryMatrix(const FDC &fdc, dealii::FullMatrix< double > &local_matrix)
Definition: fractional_step_theta_problem.h:507
void InterfaceMatrix(const FDC &fdc, dealii::FullMatrix< double > &local_matrix)
Definition: fractional_step_theta_problem.h:430
Definition: fractional_step_theta_problem.h:60
Definition: primal_ts_base.h:49
void FaceEquation(const FDC &fdc, dealii::Vector< double > &local_vector, double scale, double)
Definition: fractional_step_theta_problem.h:310
void PointRhs(const std::map< std::string, const dealii::Vector< double > * > ¶m_values, const std::map< std::string, const VECTOR * > &domain_values, VECTOR &rhs_vector, double scale)
Definition: fractional_step_theta_problem.h:234
void ElementEquation(const EDC &edc, dealii::Vector< double > &local_vector, double scale, double)
Definition: fractional_step_theta_problem.h:115
void ElementRhs(const EDC &edc, dealii::Vector< double > &local_vector, double scale)
Definition: fractional_step_theta_problem.h:205
Definition: initialproblem.h:42
InitialProblem< FractionalStepThetaProblem< OPTPROBLEM, SPARSITYPATTERN, VECTOR, dopedim, dealdim, FE, DH >, VECTOR, dealdim > & GetInitialProblem()
Definition: fractional_step_theta_problem.h:93
void InterfaceEquation(const FDC &fdc, dealii::Vector< double > &local_vector, double scale, double)
Definition: fractional_step_theta_problem.h:350
OPTPROBLEM & GetProblem()
Definition: ts_base.h:480
void BoundaryEquation(const FDC &fdc, dealii::Vector< double > &local_vector, double scale, double)
Definition: fractional_step_theta_problem.h:458
void FaceMatrix(const FDC &fdc, dealii::FullMatrix< double > &local_matrix)
Definition: fractional_step_theta_problem.h:402
FractionalStepThetaProblem(OPTPROBLEM &OP)
Definition: fractional_step_theta_problem.h:64
std::string GetPart() const
Definition: ts_base.h:493
void BoundaryRhs(const FDC &fdc, dealii::Vector< double > &local_vector, double scale)
Definition: fractional_step_theta_problem.h:496
void ElementMatrix(const EDC &edc, dealii::FullMatrix< double > &local_matrix)
Definition: fractional_step_theta_problem.h:267