18 #ifndef FIELD_ADD_POTENTIAL_IMPL_HH_
19 #define FIELD_ADD_POTENTIAL_IMPL_HH_
24 template <
int spacedim,
class Value>
29 grad_=potential.subvec(0,spacedim-1);
38 template <
int spacedim,
class Value>
41 this->r_value_ = inner_field_->value(p,elm);
43 double potential=arma::dot(grad_ , p) + zero_level_;
44 for(
unsigned int row=0; row < this->value_.n_rows(); row++)
45 for(
unsigned int col=0; col < this->value_.n_cols(); col++)
46 this->value_(row,col) += potential;
48 return this->r_value_;
56 template <
int spacedim,
class Value>
60 ASSERT_EQ( point_list.size(), value_list.size() ).error();
61 inner_field_->value_list(point_list, elm, value_list);
62 for(
unsigned int i=0; i< point_list.size(); i++) {
63 double potential= arma::dot(grad_ , point_list[i]) + zero_level_;
64 Value envelope(value_list[i]);
66 for(
unsigned int row=0; row < this->value_.n_rows(); row++)
67 for(
unsigned int col=0; col < this->value_.n_cols(); col++)
68 envelope(row,col) += potential;
72 template <
int spacedim,
class Value>
75 ASSERT_PTR(inner_field_).error(
"Null data pointer.\n");
76 return inner_field_->set_time(time);
80 template <
int spacedim,
class Value>
83 ASSERT_PTR(inner_field_).error(
"Null data pointer.\n");
84 return inner_field_->set_mesh(mesh, boundary_domain);
88 template <
int spacedim,
class Value>