16 #include <deal.II/base/tensor.h> 17 #include <deal.II/base/point.h> 18 #include <deal.II/base/function_lib.h> 19 #include <deal.II/lac/vector.h> 23 DEAL_II_NAMESPACE_OPEN
31 const unsigned int n_components,
32 const unsigned int select)
61 const unsigned int n_components,
62 const unsigned int select)
71 const unsigned int component)
const 75 component==this->selected)
76 return ((this->center.
distance(p)<this->radius) ? 1. : 0.);
84 std::vector<double> &values,
85 const unsigned int component)
const 87 Assert (values.size() == points.size(),
89 Assert (component < this->n_components,
95 component==this->selected)
96 for (
unsigned int k=0; k<values.size(); ++k)
97 values[k] = (this->center.
distance(points[k])<this->radius) ? 1. : 0.;
99 std::fill (values.begin(), values.end(), 0.);
109 Assert (values.size() == points.size(),
112 for (
unsigned int k=0; k<values.size(); ++k)
115 val = (this->center.
distance(points[k])<this->radius) ? 1. : 0.;
121 values[k](this->selected) = val;
130 const unsigned int n_components,
131 const unsigned int select)
140 const unsigned int component)
const 144 component==this->selected)
146 const double d = this->center.
distance(p);
147 return ((d<this->radius) ? (this->radius-d) : 0.);
156 std::vector<double> &values,
157 const unsigned int component)
const 159 Assert (values.size() == points.size(),
164 component==this->selected)
165 for (
unsigned int i=0; i<values.size(); ++i)
167 const double d = this->center.
distance(points[i]);
168 values[i] = ((d<this->radius) ? (this->radius-d) : 0.);
171 std::fill (values.begin(), values.end(), 0.);
182 Assert (values.size() == points.size(),
185 for (
unsigned int k=0; k<values.size(); ++k)
187 const double d = this->center.
distance(points[k]);
189 val = (d<this->radius) ? (this->radius-d) : 0.;
195 values[k](this->selected) = val;
204 const unsigned int n_components,
205 const unsigned int select)
214 const unsigned int component)
const 218 component==this->selected)
220 const double d = this->center.
distance(p);
221 const double r = this->radius;
224 const double e = -r*r/(r*r-d*d);
234 std::vector<double> &values,
235 const unsigned int component)
const 237 Assert (values.size() == points.size(),
240 const double r = this->radius;
244 component==this->selected)
245 for (
unsigned int i=0; i<values.size(); ++i)
247 const double d = this->center.
distance(points[i]);
254 const double e = -r*r/(r*r-d*d);
255 values[i] = (e<-50) ? 0. :
numbers::E * exp(e);
259 std::fill (values.begin(), values.end(), 0.);
269 Assert (values.size() == points.size(),
272 for (
unsigned int k=0; k<values.size(); ++k)
274 const double d = this->center.
distance(points[k]);
275 const double r = this->radius;
279 const double e = -r*r/(r*r-d*d);
289 values[k](this->selected) = val;
299 const unsigned int)
const 301 const double d = this->center.
distance(p);
302 const double r = this->radius;
305 const double e = -d*d/(r-d)/(r+d);
308 (p-this->center)/d*(-2.0*r*r/pow(-r*r+d*d,2.0)*d*exp(e)));
326 DEAL_II_NAMESPACE_CLOSE
virtual Tensor< 1, dim > gradient(const Point< dim > &p, const unsigned int component=0) const
virtual void vector_value_list(const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
CutOffFunctionLinfty(const double radius=1., const Point< dim >=Point< dim >(), const unsigned int n_components=1, const unsigned int select=CutOffFunctionBase< dim >::no_component)
virtual void vector_value_list(const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
virtual double value(const Point< dim > &p, const unsigned int component=0) const
void new_center(const Point< dim > &p)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
CutOffFunctionBase(const double radius=1., const Point< dim >=Point< dim >(), const unsigned int n_components=1, const unsigned int select=CutOffFunctionBase< dim >::no_component)
virtual void value_list(const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const
numbers::NumberTraits< Number >::real_type distance(const Point< dim, Number > &p) const
virtual void vector_value_list(const std::vector< Point< dim > > &points, std::vector< Vector< double > > &values) const
virtual void value_list(const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const
virtual double value(const Point< dim > &p, const unsigned int component=0) const
virtual void value_list(const std::vector< Point< dim > > &points, std::vector< double > &values, const unsigned int component=0) const
CutOffFunctionCinfty(const double radius=1., const Point< dim >=Point< dim >(), const unsigned int n_components=1, const unsigned int select=CutOffFunctionBase< dim >::no_component)
CutOffFunctionW1(const double radius=1., const Point< dim >=Point< dim >(), const unsigned int n_components=1, const unsigned int select=CutOffFunctionBase< dim >::no_component)
void new_radius(const double r)
virtual double value(const Point< dim > &p, const unsigned int component=0) const