KADATH
critic_add_eq.cpp
1 /*
2  Copyright 2017 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "headcpp.hpp"
21 #include "critic.hpp"
22 #include "system_of_eqs.hpp"
23 #include "name_tools.hpp"
24 namespace Kadath {
25 void Space_critic::add_bc_zero (System_of_eqs& sys, const char* name, int nused, Array<int>** pused) {
26  sys.add_eq_bc (0, INNER_BC, name, nused, pused) ;
27 }
28 
29 void Space_critic::add_bc_one (System_of_eqs& sys, const char* name, int nused, Array<int>** pused) {
30  sys.add_eq_bc (1, OUTER_BC, name, nused, pused) ;
31 }
32 
33 void Space_critic::add_eq_zero_mode_center (System_of_eqs& sys, const char* name, int k) {
34 
35  Index pos_cf (domains[0]->get_nbr_coefs()) ;
36  pos_cf.set(1) = k ;
37  double value = 0. ;
38  char auxi[LMAX] ;
39  trim_spaces (auxi, name) ;
40  sys.add_eq_mode (0, INNER_BC, auxi, pos_cf, value) ;
41 }}
Class that gives the position inside a multi-dimensional Array.
Definition: index.hpp:38
int & set(int i)
Read/write of the position in a given dimension.
Definition: index.hpp:72
void add_bc_one(System_of_eqs &syst, const char *eq, int nused=-1, Array< int > **pused=0x0)
Sets a boundary condition at .
void add_eq_zero_mode_center(System_of_eqs &syst, const char *f, int jtarget)
Adds an equation saying that one coefficient of a field is zero (at )
void add_bc_zero(System_of_eqs &syst, const char *eq, int nused=-1, Array< int > **pused=0x0)
Sets a boundary condition at .
Domain ** domains
Pointers on the various Domains.
Definition: space.hpp:1368
Class used to describe and solve a system of equations.
virtual void add_eq_mode(int dom, int bb, const char *eq, const Index &pos_cf, double val)
Addition of an equation prescribing the value of one coefficient of a scalar field,...
Definition: add_eq.cpp:438
virtual void add_eq_bc(int dom, int bb, const char *eq, int n_cmp=-1, Array< int > **p_cmp=nullptr)
Addition of an equation describing a boundary condition.
Definition: add_eq.cpp:168