PRISMS-PF  v2.1
vectorBCFunction.cc
Go to the documentation of this file.
1 /*
2  * vectorBCFunction.cc
3  *
4  * Created on: Feb 22, 2017
5  * Author: stephendewitt
6  */
7 
8 #include <deal.II/base/function.h>
9 #include <deal.II/lac/parallel_vector.h>
10 #include "../../include/vectorBCFunction.h"
11 
12 template <int dim>
13 vectorBCFunction<dim>::vectorBCFunction(std::vector<double> input_values) : dealii::Function<dim>(dim), BC_values (input_values) {}
14 
15 template <int dim>
16 void vectorBCFunction<dim>::vector_value(const dealii::Point<dim> &p, dealii::Vector<double> &values) const {
17 
18  for (unsigned int i=0; i<dim; i++) {
19  values(i) = BC_values[i];
20  }
21 }
22 
23 template <int dim>
24 void vectorBCFunction<dim>::vector_value_list (const std::vector<dealii::Point<dim> > &points, std::vector<dealii::Vector<double> > &value_list) const{
25  const unsigned int n_points = points.size();
26  for (unsigned int p=0; p<n_points; ++p)
27  vectorBCFunction<dim>::vector_value(points[p],value_list[p]);
28 }
29 
30 
31 template class vectorBCFunction<1>;
32 template class vectorBCFunction<2>;
33 template class vectorBCFunction<3>;
virtual void vector_value_list(const std::vector< dealii::Point< dim > > &points, std::vector< dealii::Vector< double > > &value_list) const
virtual void vector_value(const dealii::Point< dim > &p, dealii::Vector< double > &values) const
vectorBCFunction(const std::vector< double > BC_values)