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);
35 template <
int spacedim,
class Value>
39 inner_field_( inner_field )
41 grad_=potential.subvec(0,spacedim-1);
50 template <
int spacedim,
class Value>
53 this->r_value_ = inner_field_->value(p,elm);
55 double potential=arma::dot(grad_ , p) + zero_level_;
56 for(
unsigned int row=0; row < this->value_.n_rows(); row++)
57 for(
unsigned int col=0; col < this->value_.n_cols(); col++)
58 this->value_(row,col) += potential;
60 return this->r_value_;
68 template <
int spacedim,
class Value>
73 ASSERT( point_list.
n_rows() == spacedim && point_list.
n_cols() == 1 ).error(
"Invalid point size.\n");
74 inner_field_->value_list(point_list, elm, value_list);
75 for(
unsigned int i=0; i< point_list.
size(); i++) {
76 double potential= arma::dot(grad_ , point_list.
vec<spacedim>(i)) + zero_level_;
77 Value envelope(value_list[i]);
79 for(
unsigned int row=0; row < this->value_.n_rows(); row++)
80 for(
unsigned int col=0; col < this->value_.n_cols(); col++)
81 envelope(row,col) += potential;
85 template <
int spacedim,
class Value>
88 ASSERT_PTR(inner_field_).error(
"Null data pointer.\n");
89 return inner_field_->set_time(time);
93 template <
int spacedim,
class Value>
96 ASSERT_PTR(inner_field_).error(
"Null data pointer.\n");
97 return inner_field_->set_mesh(mesh, boundary_domain);
101 template <
int spacedim,
class Value>