20 #include "system_of_eqs.hpp"
23 #include "tensor_impl.hpp"
26 Equation(zedom, dd, ozers.get_size(1)+1, nused, pused), bound (bb),
27 other_doms(ozers.get_size(1)), other_bounds(ozers.get_size(1)), which_points(0x0) {
29 for (
int i=0 ; i<
n_ope-1 ; i++) {
63 for (
int i=0 ; i<
n_ope ; i++)
64 assert (residus[i]->get_type_data()==TERM_T) ;
65 assert (residus[conte+1]->get_type_data()==TERM_T) ;
67 Tensor copie (residus[conte]->get_val_t()) ;
73 for (
int comp=0 ; comp<
n_comp ; comp++) {
77 for (
int j=0 ; j<(*n_cond)(comp) ; j++) {
79 sec.
set(pos_res) = (copie(ind)(
ndom).check_if_zero()) ? 0. : (*copie(ind)(
ndom).c)(*
which_points[pos_res-start]) ;
93 bool found = zedom->
is_in(absol, 1e-5) ;
97 (residus[conte+num_other+1]->get_val_t()(ind)(
other_doms(num_other))) ;
107 if (num_other>=
n_ope-1)
112 cerr << absol << endl ;
113 cerr <<
"not found in Eq_matching_non_std::export_val" << endl ;
125 for (
int j=0 ; j<(*n_cond)(comp) ; j++) {
142 bool found = zedom->
is_in(absol, 1e-5) ;
155 if (num_other>=
n_ope-1)
159 cerr << absol << endl ;
160 cerr <<
"not found in Eq_matching_non_std::export_val" << endl ;
173 for (
int i=0 ; i<
n_ope ; i++)
174 assert (residus[i]->get_type_data()==TERM_T) ;
175 assert (residus[conte+1]->get_type_data()==TERM_T) ;
177 Tensor copie (residus[conte]->get_der_t()) ;
180 int start = pos_res ;
183 for (
int comp=0 ; comp<
n_comp ; comp++) {
187 for (
int j=0 ; j<(*n_cond)(comp) ; j++) {
189 sec.
set(pos_res) = (copie(ind)(
ndom).check_if_zero()) ? 0. : (*copie(ind)(
ndom).c)(*
which_points[pos_res-start]) ;
203 bool found = zedom->
is_in(absol, 1e-3) ;
207 (residus[conte+num_other+1]->get_der_t()(ind)(
other_doms(num_other))) ;
216 if (num_other>=
n_ope-1)
220 cerr << absol << endl ;
221 cerr <<
"not found in Eq_matching_non_std::export_der" << endl ;
233 for (
int j=0 ; j<(*n_cond)(comp) ; j++) {
250 bool found = zedom->
is_in(absol, 1e-3) ;
263 if (num_other>=
n_ope-1)
267 cerr << absol << endl ;
268 cerr <<
"not found in Eq_matching_non_std::export_der" << endl ;
282 bool res = (target==
ndom) ?
true :
false ;
283 for (
int i=0 ; i<
n_ope-1 ; i++)
291 int old_conte = conte ;
292 for (
int i=0 ; i<
n_ope ; i++) {
294 *res[conte] =
parts[i]->action() ;
298 assert (res[conte]->get_type_data()==TERM_T) ;
303 Tensor copie (res[old_conte]->get_val_t()) ;
317 for (
int comp=0 ; comp<
n_comp ; comp++) {
321 start += (*n_cond)(comp) ;
327 start += (*n_cond)(comp) ;
reference set(const Index &pos)
Read/write of an element.
int get_size(int i) const
Returns the size of a given dimension.
Class for storing the basis of decompositions of a field.
double summation(const Point &num, const Array< double > &tab) const
Computes the spectral summation.
Abstract class that implements the fonctionnalities common to all the type of domains.
int get_ndim() const
Returns the number of dimensions.
Val_domain const & get_absol(int i) const
Returns the absolute coordinates.
virtual int nbr_points_boundary(int bound, const Base_spectral &base) const
Computes the number of relevant collocation points on a boundary.
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
virtual const Point absol_to_num_bound(const Point &xxx, int bound) const
Computes the numerical coordinates from the physical ones for a point lying on a boundary.
virtual void do_which_points_boundary(int bound, const Base_spectral &base, Index **ind, int start) const
Lists all the indices corresponding to true collocation points on a boundary.
void export_val(int &, Term_eq **, Array< double > &, int &) const override
Generates the discretized errors, from the various Term_eq computed by the equation.
Array< int > do_nbr_conditions(const Tensor &tt) const override
Computes the number of conditions associated with the equation.
virtual ~Eq_matching_non_std()
Destructor.
Array< int > other_bounds
Names of the boundary, as seen in the other domains.
void do_which_points(const Base_spectral &base, int start)
Computes the collocation points used.
Array< int > other_doms
Array containing the number of the domains being on the other side of the surface.
int bound
Name of the boundary in the domain of the equation.
Eq_matching_non_std(const Domain *dom, int nd, int bb, const Array< int > &ozers, int n_cmp=-1, Array< int > **p_cmp=nullptr)
Constructor.
void apply(int &, Term_eq **) override
Computes the terms involved in computing the residual of the equations.
void export_der(int &, Term_eq **, Array< double > &, int &) const override
Generates the discretized variations, from the various Term_eq computed by the equation.
bool take_into_account(int) const override
Check whether the variation of the residual has to be taken into account when computing a given colum...
Index ** which_points
Lists the collocation points on the boundary (probably...)
Class implementing an equation.
bool called
Indicator checking whther the result has been computed already once.
const Domain * dom
Pointer on the Domain where the equation is defined.
Array< int > ** p_cmp_used
Array of pointer on the indices of the used components.
int ndom
Number of the domain.
int n_cmp_used
Number of components used (by default the same thing as n_comp).
int n_ope
Number of terms involved in the equation (one for bulk, two or more fot matching.....
int n_comp
Number of components of the residual (1 for a scalar, 6 for a symmetric rank-2 tensor etc).
Array< int > * n_cond
Number of discretized equations, component by component.
MMPtr_array< Ope_eq > parts
Array of pointers on the various terms.
int n_cond_tot
Total number of discretized equations (essentially the number of all coefficients of the residual).
Class that gives the position inside a multi-dimensional Array.
The class Point is used to store the coordinates of a point.
double & set(int i)
Read/write of a coordinate.
Val_domain & set_domain(int)
Read/write of a particular Val_domain.
const Domain * get_domain(int i) const
returns a pointer on the domain.
Memory_mapped_array< Scalar * > cmp
Array of size n_comp of pointers onto the components.
Scalar & set(const Array< int > &ind)
Returns the value of a component (read/write version).
int get_n_comp() const
Returns the number of stored components.
virtual Array< int > indices(int pos) const
Gives the values of the indices corresponding to a location in the array used for storage of the comp...
const Space & espace
The Space.
This class is intended to describe the manage objects appearing in the equations.
Tensor const & get_val_t() const
Tensor const & get_der_t() const
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Base_spectral base
Spectral basis of the field.
bool check_if_zero() const
Check whether the logical state is zero or not.
Array< double > * cf
Pointer on the Array of the values in the coefficients space.
void coef_i() const
Computes the values in the configuration space.
void coef() const
Computes the coefficients.
Array< double > * c
Pointer on the Array of the values in the configuration space.