-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format prototypes via indentation scripts (#1213)
- Loading branch information
Showing
22 changed files
with
737 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,64 @@ | ||
#include <deal.II/base/quadrature_lib.h> | ||
#include <deal.II/base/function.h> | ||
#include <deal.II/base/quadrature_lib.h> | ||
|
||
#include <deal.II/lac/vector.h> | ||
|
||
using namespace dealii; | ||
|
||
template<int dim> | ||
template <int dim> | ||
class ExactSolutionMMS : public Function<dim> | ||
{ | ||
public: | ||
ExactSolutionMMS() : Function<dim>(3) {} | ||
virtual void vector_value(const Point<dim> &p, | ||
Vector<double> &values) const; | ||
ExactSolutionMMS() | ||
: Function<dim>(3) | ||
{} | ||
virtual void | ||
vector_value(const Point<dim> &p, Vector<double> &values) const; | ||
}; | ||
template<int dim> | ||
void ExactSolutionMMS<dim>::vector_value(const Point<dim> &p, | ||
Vector<double> &values) const | ||
template <int dim> | ||
void | ||
ExactSolutionMMS<dim>::vector_value(const Point<dim> &p, | ||
Vector<double> &values) const | ||
{ | ||
const double a = M_PI; | ||
double x = p[0]; | ||
double y = p[1]; | ||
values(0) = sin(a*x)*sin(a*x)*cos(a*y)*sin(a*y); | ||
values(1) = -cos(a*x)*sin(a*x)*sin(a*y)*sin(a*y); | ||
values(2) = -2 + x*x + y*y; | ||
const double a = M_PI; | ||
double x = p[0]; | ||
double y = p[1]; | ||
values(0) = sin(a * x) * sin(a * x) * cos(a * y) * sin(a * y); | ||
values(1) = -cos(a * x) * sin(a * x) * sin(a * y) * sin(a * y); | ||
values(2) = -2 + x * x + y * y; | ||
} | ||
|
||
template<int dim> | ||
template <int dim> | ||
class ExactSolutionTaylorCouette : public Function<dim> | ||
{ | ||
public: | ||
ExactSolutionTaylorCouette() : Function<dim>(3) | ||
{ | ||
eta_=0.25; | ||
ri_=0.25; | ||
} | ||
virtual void vector_value(const Point<dim> &p, | ||
Vector<double> &values) const; | ||
ExactSolutionTaylorCouette() | ||
: Function<dim>(3) | ||
{ | ||
eta_ = 0.25; | ||
ri_ = 0.25; | ||
} | ||
virtual void | ||
vector_value(const Point<dim> &p, Vector<double> &values) const; | ||
|
||
private: | ||
double eta_; | ||
double ri_=0.25; | ||
double eta_; | ||
double ri_ = 0.25; | ||
}; | ||
template<int dim> | ||
void ExactSolutionTaylorCouette<dim>::vector_value(const Point<dim> &p, | ||
Vector<double> &values) const | ||
template <int dim> | ||
void | ||
ExactSolutionTaylorCouette<dim>::vector_value(const Point<dim> &p, | ||
Vector<double> &values) const | ||
{ | ||
const double a = M_PI; | ||
double x = p[0]; | ||
double y = p[1]; | ||
double r= std::sqrt(x*x+y*y); | ||
double theta= std::atan2(y,x); | ||
double A= -(eta_*eta_)/(1.-eta_*eta_); | ||
double B= ri_ * ri_ / (1.-eta_*eta_); | ||
double utheta= A*r + B/r; | ||
values(0) = -std::sin(theta)*utheta; | ||
values(1) = std::cos(theta)*utheta; | ||
values(2) = 0.; | ||
const double a = M_PI; | ||
double x = p[0]; | ||
double y = p[1]; | ||
double r = std::sqrt(x * x + y * y); | ||
double theta = std::atan2(y, x); | ||
double A = -(eta_ * eta_) / (1. - eta_ * eta_); | ||
double B = ri_ * ri_ / (1. - eta_ * eta_); | ||
double utheta = A * r + B / r; | ||
values(0) = -std::sin(theta) * utheta; | ||
values(1) = std::cos(theta) * utheta; | ||
values(2) = 0.; | ||
} |
Oops, something went wrong.