43 #ifndef EPOT_PROBLEM_HPP
44 #define EPOT_PROBLEM_HPP 1
71 #define PLASMA_INITIAL PLASMA_PEXP_INITIAL
159 Node2DoF() : _size(0), _n2d(0) {}
160 Node2DoF(
Int3D size ) : _size(size) {
161 _n2d =
new int32_t[_size[0]*_size[1]*_size[2]];
163 ~Node2DoF() {
delete _n2d; }
165 void resize(
Int3D size ) {
169 _n2d =
new int32_t[_size[0]*_size[1]*_size[2]];
172 int32_t &operator()(
int i )
173 {
return( _n2d[i] ); }
174 int32_t &operator()(
int i,
int j )
175 {
return( _n2d[i+j*_size[0]] ); }
176 int32_t &operator()(
int i,
int j,
int k )
177 {
return( _n2d[i+j*_size[0]+k*_size[0]*_size[1]] ); }
179 const int32_t &operator()(
int i )
const
180 {
return( _n2d[i] ); }
181 const int32_t &operator()(
int i,
int j )
const
182 {
return( _n2d[i+j*_size[0]] ); }
183 const int32_t &operator()(
int i,
int j,
int k )
const
184 {
return( _n2d[i+j*_size[0]+k*_size[0]*_size[1]] ); }
202 int32_t _neumann_order;
211 std::vector<double> _rhoi;
213 std::vector<double> _Ei;
218 bool (*_force_pot_func)(double,double,double);
219 bool (*_init_plasma_func)(double,double,double);
225 int32_t a, int32_t b,
double val );
227 void add_initial_plasma( int32_t i, int32_t j, int32_t k,
230 void add_forced_pot( int32_t i, int32_t j, int32_t k,
233 void add_vacuum_node( int32_t i, int32_t j, int32_t k,
236 void add_neumann_node(
signed char a, int32_t i, int32_t j, int32_t k,
239 void add_solid_edge_node(
signed char a, int32_t i, int32_t j, int32_t k,
242 void clear_problem(
void );
286 bool (*force_pot_func)(
double,
double,
double) );
293 bool (*plasma_func)(
double,
double,
double) );
324 std::vector<double> rhoi, std::vector<double> Ei );
369 bool linear(
void )
const;
385 void save( std::ostream &s )
const;
Definition: epot_problem.hpp:68
void enable_smooth_solids(bool enable)
Enable smooth solid edges.
void solve(ScalarField &epot, const ScalarField &scharge) const
Solve the problem.
Compressed row sparse matrix class.
Definition: crowmatrix.hpp:76
void debug_print(std::ostream &os) const
Print debugging information to os.
Dense math vector class.
Definition: mvector.hpp:68
Abstract base class for linear/non-linear problem, which can be described by a non-linear system of e...
Definition: problem.hpp:54
Definition: epot_problem.hpp:69
void set_initial_plasma(double Up, bool(*plasma_func)(double, double, double))
Define initial plasma to the problem.
Class for constructing the linear/nonlinear problem for the solver.
Definition: epot_problem.hpp:142
Three dimensional vectors.
~EpotProblem()
Destructor for problem.
void set_nsimp_plasma(double rhop, double Ep, std::vector< double > rhoi, std::vector< double > Ei)
Enable plasma model for negative ion extraction problem.
Geometry defining class.
Definition: geometry.hpp:131
void get_vecmat(const Matrix **A, const Vector **B) const
Return const pointers to the matrix A and vector B of the linear problem.
void set_pexp_plasma(double rhoe, double Te, double Up)
Enable plasma model for positive ion extraction problem.
void set_nsimp_initial_plasma(bool(*plasma_func)(double, double, double))
Define initial plasma boundary location to negative ion extraction problem.
int get_dof(void) const
Get degrees of freedom.
Definition: epot_problem.hpp:377
void set_neumann_order(int32_t order)
Set Neumann boundary order.
Base matrix class.
Definition: matrix.hpp:76
bool linear(void) const
Return true if problem is linear.
3D Integer vector class.
Definition: vec3d.hpp:289
void set_solver(Solver &s)
Set solver to be used for the problem.
Abstract base class for solving linear and nonlinear problems. Different implementation may exist...
Definition: solver.hpp:57
void save(std::ostream &s) const
Saves problem data to stream.
void get_resjac(const Matrix **J, const Vector **R, const Vector &X) const
Return const pointers to jacobian matrix and residual vector of the problem to J and R at X...
EpotProblem()
Default constructor.
Definition: epot_problem.hpp:68
void construct(const Geometry &g)
Construct matrix form of the problem.
plasma_mode_e
Plasma modes.
Definition: epot_problem.hpp:68
Scalar field class.
Definition: scalarfield.hpp:70
void set_forced_potential_volume(double force_pot, bool(*force_pot_func)(double, double, double))
Define forced potential volume.
Definition: epot_problem.hpp:68
Definition: epot_problem.hpp:69