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>
41 grad_=potential.subvec(0,spacedim-1);
50 template <
int spacedim,
class Value>
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;
68 template <
int spacedim,
class Value>
75 for(
unsigned int i=0; i< point_list.
size(); i++) {
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>
93 template <
int spacedim,
class Value>
101 template <
int spacedim,
class Value>
unsigned int size() const
void set_mesh(const Mesh *mesh, bool boundary_domain) override
Implements FieldAlgirithmBase::set_mesh.
bool set_time(const TimeStep &time) override
arma::vec::fixed< spacedim > grad_
Potential gradient.
Helper struct stores data for initizalize descentants of FieldAlgorithmBase.
ArmaVec< Type, nr > vec(uint mat_index) const
FieldAddPotential(const arma::vec::fixed< spacedim+1 > &potential_grad, const Input::AbstractRecord &rec, unsigned int n_comp=0)
Value::return_type r_value_
double zero_level_
Potential constant term.
virtual ~FieldAddPotential()
Value value_
Last value, prevents passing large values (vectors) by value.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
virtual void value_list(const Armor::array &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list)
Class for representation SI units of Fields.
std::shared_ptr< FieldAlgorithmBase< spacedim, Value > > inner_field_
Field to which we add linear potential.
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm)
Representation of one time step..
Space< spacedim >::Point Point
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
unsigned int n_comp() const