MADNESS 0.10.1
funcdefaults.h
Go to the documentation of this file.
1/*
2 This file is part of MADNESS.
3
4 Copyright (C) 2007,2010 Oak Ridge National Laboratory
5
6 This program 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 2 of the License, or
9 (at your option) any later version.
10
11 This program 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 this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
20 For more information please contact:
21
22 Robert J. Harrison
23 Oak Ridge National Laboratory
24 One Bethel Valley Road
25 P.O. Box 2008, MS-6367
26
27 email: harrisonrj@ornl.gov
28 tel: 865-241-3937
29 fax: 865-572-0680
30*/
31
32#ifndef MADNESS_MRA_FUNCDEFAULTS_H__INCLUDED
33#define MADNESS_MRA_FUNCDEFAULTS_H__INCLUDED
34
35
36/// \file funcdefaults.h
37/// \brief Provides FunctionDefaults and utilities for coordinate transformation
38/// \ingroup mrabcext
39
45#include <madness/mra/bc.h>
46#include <madness/mra/key.h>
47
48#include <optional>
49
50namespace madness {
51 template <typename T, std::size_t NDIM> class FunctionImpl;
52
53 /// The maximum wavelet order presently supported
54 static const int MAXK = 30;
55
56 /// The maximum depth of refinement possible
57 static const int MAXLEVEL = 8*sizeof(Translation)-2;
58
59 enum TreeState {
60 reconstructed, ///< s coeffs at the leaves only
61 compressed, ///< d coeffs in internal nodes, s and d coeffs at the root
62 nonstandard, ///< s and d coeffs in internal nodes
63 nonstandard_with_leaves, ///< like nonstandard, with s coeffs at the leaves
64 nonstandard_after_apply, ///< s and d coeffs, state after operator application
65 redundant, ///< s coeffs everywhere
66 redundant_after_merge, ///< s coeffs everywhere, must be summed up to yield the result
67 on_demand, ///< no coeffs anywhere, but a functor providing if necessary
69 };
70
71 template<std::size_t NDIM=1>
72 std::ostream& operator<<(std::ostream& os, const TreeState treestate) {
73 if (treestate==reconstructed) os << "reconstructed";
74 else if (treestate==compressed) os << "compressed";
75 else if (treestate==nonstandard) os << "nonstandard";
76 else if (treestate==nonstandard_with_leaves) os << "nonstandard_with_leaves";
77 else if (treestate==nonstandard_after_apply) os << "nonstandard_after_apply";
78 else if (treestate==redundant) os << "redundant";
79 else if (treestate==redundant_after_merge) os << "redundant_after_merge";
80 else if (treestate==on_demand) os << "on_demand";
81 else if (treestate==unknown) os << "unknown";
82 else {
83 MADNESS_EXCEPTION("unknown treestate",1);
84 }
85 return os;
86 }
87
88 /// FunctionDefaults holds default paramaters as static class members
89
90 /// Declared and initialized in mra.cc and/or funcimpl::initialize.
91 ///
92 /// Currently all functions of the same dimension share the same cell dimensions
93 /// since they are stored inside FunctionDefaults ... if you change the
94 /// cell dimensions *all* functions of that dimension are affected.
95 ///
96 /// N.B. Ultimately, we may need to make these defaults specific to each
97 /// world, as should be all global state.
98 /// \ingroup mra
99 template <std::size_t NDIM>
102 MADNESS_PRAGMA_CLANG(diagnostic ignored "-Wundefined-var-template")
103
104 private:
105 static int k; ///< Wavelet order
106 static double thresh; ///< Truncation threshold
107 static int initial_level; ///< Initial level for fine scale projection
108 static int special_level; ///< Minimum level for fine scale projection of special boxes
109 static int max_refine_level; ///< Level at which to stop refinement
110 static int truncate_mode; ///< Truncation method
111 static bool refine; ///< Whether to refine new functions
112 static bool autorefine; ///< Whether to autorefine in multiplication, etc.
113 static bool debug; ///< Controls output of debug info
114 static bool truncate_on_project; ///< If true initial projection inserts at n-1 not n
115 static bool apply_randomize; ///< If true use randomization for load balancing in apply integral operator
116 static bool project_randomize; ///< If true use randomization for load balancing in project/refine
117 static std::optional<BoundaryConditions<NDIM>> bc; ///< Default boundary conditions, not initialized by default and must be set explicitly before use
118 static Tensor<double> cell ; ///< cell[NDIM][2] Simulation cell, cell(0,0)=xlo, cell(0,1)=xhi, ...
119 static Tensor<double> cell_width;///< Width of simulation cell in each dimension
120 static Tensor<double> rcell_width; ///< Reciprocal of width
121 static double cell_volume; ///< Volume of simulation cell
122 static double cell_min_width; ///< Size of smallest dimension
123 static TensorType tt; ///< structure of the tensor in FunctionNode
124 static std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > > pmap; ///< Default mapping of keys to processes
125 static int pmap_nproc; ///< Number of processes assumed by pmap, -1 indicates uninitialized pmap
126
128 if (NDIM) {
130 cell(_, 1) = 1.0;
131 return cell;
132 } else
133 return {};
134 }
135
137 if (NDIM) {
139 cell(_) = 1.0;
140 return cell;
141 } else
142 return {};
143 }
144
145 static void recompute_cell_info() {
146 MADNESS_ASSERT(cell.dim(0)==NDIM && cell.dim(1)==2 && cell.ndim()==2);
147 cell_width = cell(_,1)-cell(_,0);
151 for (std::size_t i=0; i<NDIM; ++i) rcell_width(i) = 1.0/rcell_width(i);
152 }
153
154 public:
155
156
157 /// Used to set defaults to k=7, thresh=1-5, for a unit cube [0,1].
158 /// @warning does not reset the boundary conditions if they are already set
159 static void set_defaults(World& world);
160
161 static void print();
162
163 /// Returns the default wavelet order
164 static int get_k() {
165 return k;
166 }
167
168 /// Sets the default wavelet order
169
170 /// Existing functions are unaffacted.
171 static void set_k(int value) {
172 k=value;
173 MADNESS_ASSERT(k>0 && k<=MAXK);
174 }
175
176 /// Returns the default threshold
177 static const double& get_thresh() {
178 return thresh;
179 }
180
181 /// Sets the default threshold
182
183 /// Existing functions are unaffected
184 static void set_thresh(double value) {
185 thresh=value;
186 }
187
188 /// Returns the default initial projection level
189 static int get_initial_level() {
190 return initial_level;
191 }
192
193 /// Returns the default projection level for special boxes
194 static int get_special_level() {
195 return special_level;
196 }
197
198 /// Sets the default initial projection level
199
200 /// Existing functions are unaffected
201 static void set_initial_level(int value) {
202 initial_level=value;
203 MADNESS_ASSERT(value>0 && value<MAXLEVEL);
204 }
205
206 /// Existing functions are unaffected
207 static void set_special_level(int value) {
208 special_level=value;
209 MADNESS_ASSERT(value>=0 && value<MAXLEVEL);
211 }
212
213 /// Gets the default maximum adaptive refinement level
214 static int get_max_refine_level() {
215 return max_refine_level;
216 }
217
218 /// Sets the default maximum adaptive refinement level
219
220 /// Existing functions are unaffected
227
228 /// Gets the default truncation mode
229 static int get_truncate_mode() {
230 return truncate_mode;
231 }
232
233 /// Sets the default truncation mode
234
235 /// Existing functions are unaffected
236 static void set_truncate_mode(int value) {
237 truncate_mode=value;
238 MADNESS_ASSERT(value>=0 && value<4);
239 }
240
241 /// Gets the default adaptive refinement flag
242 static bool get_refine() {
243 return refine;
244 }
245
246 /// Sets the default adaptive refinement flag
247
248 /// Existing functions are unaffected
249 static void set_refine(bool value) {
250 refine=value;
251 }
252
253 /// Gets the default adaptive autorefinement flag
254 static bool get_autorefine() {
255 return autorefine;
256 }
257
258 /// Sets the default adaptive autorefinement flag
259
260 /// Existing functions are unaffected
261 static void set_autorefine(bool value) {
262 autorefine=value;
263 }
264
265 /// Gets the default debug flag (is this used anymore?)
266 static bool get_debug() {
267 return debug;
268 }
269
270 /// Sets the default debug flag (is this used anymore?)
271
272 /// Not sure if this does anything useful
273 static void set_debug(bool value) {
274 debug=value;
275 }
276
277 /// Gets the default truncate on project flag
279 return truncate_on_project;
280 }
281
282 /// Sets the default truncate on project flag
283
284 /// Existing functions are unaffected
285 static void set_truncate_on_project(bool value) {
287 }
288
289 /// Gets the random load balancing for integral operators flag
290 static bool get_apply_randomize() {
291 return apply_randomize;
292 }
293
294 /// Sets the random load balancing for integral operators flag
295 static void set_apply_randomize(bool value) {
296 apply_randomize=value;
297 }
298
299
300 /// Gets the random load balancing for projection flag
301 static bool get_project_randomize() {
302 return project_randomize;
303 }
304
305 /// Sets the random load balancing for projection flag
306 static void set_project_randomize(bool value) {
307 project_randomize=value;
308 }
309
310 /// Returns the default boundary conditions
312 if (!bc.has_value()) {
313 const std::string msg = "FunctionDefaults<" + std::to_string(NDIM) + ">::get_bc: must initialize boundary conditions by set_bc or set_defaults or startup";
314 MADNESS_EXCEPTION(msg.c_str(), 1);
315 }
316 return bc.value();
317 }
318
319 /// Sets the default boundary conditions
320 static void set_bc(const BoundaryConditions<NDIM>& value) {
321 bc=value;
322 }
323
324 /// Returns the default tensor type
326 return tt;
327 }
328
329 /// Sets the default tensor type
330 static void set_tensor_type(const TensorType& t) {
331#if HAVE_GENTENSOR
332 tt=t;
333#else
334 tt=TT_FULL;
335#endif
336 }
337
338 /// adapt the special level to resolve the smallest length scale
339 static int set_length_scale(const double lo,const size_t k=get_k()) {
340 const double dk = (double) k;
342 double lo_sim=lo/Lmax; // lo in simulation coordinates;
343 const int special_level=Level(-log2(lo_sim*dk));
344 return special_level;
345 }
346
347 /// Gets the user cell for the simulation
348 static const Tensor<double>& get_cell() {
349 return cell;
350 }
351
352 /// Gets the user cell for the simulation
353
354 /// Existing functions are probably rendered useless
355 static void set_cell(const Tensor<double>& value) {
356 cell=copy(value);
358 }
359
360 /// Sets the user cell to be cubic with each dimension having range \c [lo,hi]
361
362 /// Existing functions are probably rendered useless
363 static void set_cubic_cell(double lo, double hi) {
364 cell(_,0)=lo;
365 cell(_,1)=hi;
367 }
368
369 /// Returns the width of each user cell dimension
371 return cell_width;
372 }
373
374 /// Returns the reciprocal of the width of each user cell dimension
376 return rcell_width;
377 }
378
379 /// Returns the minimum width of any user cell dimension
380 static double get_cell_min_width() {
381 return cell_min_width;
382 }
383
384 /// Returns the volume of the user cell
385 static double get_cell_volume() {
386 return cell_volume;
387 }
388
389 /// Returns the default process map that was last initialized via set_default_pmap()
390 static std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > >& get_pmap() {
391 if (pmap)
392 return pmap;
393 else { // try to initialize to default, if not yet
394 if (initialized()) {
396 return pmap;
397 }
398 else
399 return pmap; // null ptr if uninitialized
400 }
401 }
402
403 /// Returns number of the default processes returned by get_pmap()
404 static int get_pmap_nproc() {
405 return pmap_nproc;
406 }
407
408 /// Returns the default process map that can be used with the given world
409 static std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > > get_pmap(World& world) {
410 if (get_pmap_nproc() == world.nproc()) {
411 return get_pmap();
412 }
413 else {
414 return make_default_pmap(world);
415 }
416 }
417
418 /// Sets the default process map (does \em not redistribute existing functions)
419
420 /// Existing functions are probably rendered useless
421 static void set_pmap(const std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > >& value) {
422 pmap = value;
423 }
424
425 /// Makes a default process map for the given \p world
426 static std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > > make_default_pmap(World& world);
427
428 /// Sets the default process map for the use with WorldObjects in \p world
429 /// @note sets default pmap to `make_default_pmap(world)`
430 static void set_default_pmap(World& world);
431
432 /// Sets the default process map and redistributes all functions using the old map
433 static void redistribute(World& world, const std::shared_ptr< WorldDCPmapInterface< Key<NDIM> > >& newpmap) {
434 pmap->redistribute(world,newpmap);
435 pmap = newpmap;
436 }
437
439
440 };
441
442 /// Convert user coords (cell[][]) to simulation coords ([0,1]^ndim)
443 template <std::size_t NDIM>
445 for (std::size_t i=0; i<NDIM; ++i)
447 }
448
449 /// Returns the box at level n that contains the given point in simulation coordinates
450 /// @param[in] pt point in simulation coordinates
451 /// @param[in] n the level of the box
452 template <typename T, std::size_t NDIM>
453 static inline Key<NDIM> simpt2key(const Vector<T,NDIM>& pt, Level n){
455 double twon = std::pow(2.0, double(n));
456 for (std::size_t i=0; i<NDIM; ++i) {
457 l[i] = Translation(twon*pt[i]);
458 }
459 return Key<NDIM>(n,l);
460 }
461
462 /// Convert simulation coords ([0,1]^ndim) to user coords (FunctionDefaults<NDIM>::get_cell())
463 template <std::size_t NDIM>
465 for (std::size_t i=0; i<NDIM; ++i)
467 }
468
469
470}
471#endif // MADNESS_MRA_FUNCDEFAULTS_H__INCLUDED
This header should include pretty much everything needed for the parallel runtime.
Provides BoundaryConditions.
long dim(int i) const
Returns the size of dimension i.
Definition basetensor.h:147
long ndim() const
Returns the number of dimensions in the tensor.
Definition basetensor.h:144
This class is used to specify boundary conditions for all operators.
Definition bc.h:72
FunctionDefaults holds default paramaters as static class members.
Definition funcdefaults.h:100
static int get_special_level()
Returns the default projection level for special boxes.
Definition funcdefaults.h:194
static Tensor< double > make_default_cell_width()
Definition funcdefaults.h:136
static void set_tensor_type(const TensorType &t)
Sets the default tensor type.
Definition funcdefaults.h:330
static int get_k()
Returns the default wavelet order.
Definition funcdefaults.h:164
static void set_apply_randomize(bool value)
Sets the random load balancing for integral operators flag.
Definition funcdefaults.h:295
static bool get_project_randomize()
Gets the random load balancing for projection flag.
Definition funcdefaults.h:301
static std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > make_default_pmap(World &world)
Makes a default process map for the given world.
Definition mraimpl.h:3555
static bool truncate_on_project
If true initial projection inserts at n-1 not n.
Definition funcdefaults.h:114
static int get_truncate_mode()
Gets the default truncation mode.
Definition funcdefaults.h:229
static void set_truncate_mode(int value)
Sets the default truncation mode.
Definition funcdefaults.h:236
static bool apply_randomize
If true use randomization for load balancing in apply integral operator.
Definition funcdefaults.h:115
static void set_truncate_on_project(bool value)
Sets the default truncate on project flag.
Definition funcdefaults.h:285
static void set_thresh(double value)
Sets the default threshold.
Definition funcdefaults.h:184
static double cell_volume
Volume of simulation cell.
Definition funcdefaults.h:121
static void set_special_level(int value)
Existing functions are unaffected.
Definition funcdefaults.h:207
static void set_k(int value)
Sets the default wavelet order.
Definition funcdefaults.h:171
static void redistribute(World &world, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &newpmap)
Sets the default process map and redistributes all functions using the old map.
Definition funcdefaults.h:433
static const double & get_thresh()
Returns the default threshold.
Definition funcdefaults.h:177
static int k
Wavelet order.
Definition funcdefaults.h:105
static double get_cell_volume()
Returns the volume of the user cell.
Definition funcdefaults.h:385
static int get_max_refine_level()
Gets the default maximum adaptive refinement level.
Definition funcdefaults.h:214
static bool get_debug()
Gets the default debug flag (is this used anymore?)
Definition funcdefaults.h:266
static void set_debug(bool value)
Sets the default debug flag (is this used anymore?)
Definition funcdefaults.h:273
static int truncate_mode
Truncation method.
Definition funcdefaults.h:110
static void set_default_pmap(World &world)
Definition mraimpl.h:3562
static int pmap_nproc
Number of processes assumed by pmap, -1 indicates uninitialized pmap.
Definition funcdefaults.h:125
static bool get_refine()
Gets the default adaptive refinement flag.
Definition funcdefaults.h:242
static Tensor< double > cell_width
Width of simulation cell in each dimension.
Definition funcdefaults.h:119
static void set_autorefine(bool value)
Sets the default adaptive autorefinement flag.
Definition funcdefaults.h:261
static double thresh
Truncation threshold.
Definition funcdefaults.h:106
static void set_bc(const BoundaryConditions< NDIM > &value)
Sets the default boundary conditions.
Definition funcdefaults.h:320
static void set_project_randomize(bool value)
Sets the random load balancing for projection flag.
Definition funcdefaults.h:306
static int get_pmap_nproc()
Returns number of the default processes returned by get_pmap()
Definition funcdefaults.h:404
static bool get_autorefine()
Gets the default adaptive autorefinement flag.
Definition funcdefaults.h:254
static bool debug
Controls output of debug info.
Definition funcdefaults.h:113
static int special_level
Minimum level for fine scale projection of special boxes.
Definition funcdefaults.h:108
static double cell_min_width
Size of smallest dimension.
Definition funcdefaults.h:122
static std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > pmap
Default mapping of keys to processes.
Definition funcdefaults.h:124
static TensorType get_tensor_type()
Returns the default tensor type.
Definition funcdefaults.h:325
static const Tensor< double > & get_cell_width()
Returns the width of each user cell dimension.
Definition funcdefaults.h:370
static std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > & get_pmap()
Returns the default process map that was last initialized via set_default_pmap()
Definition funcdefaults.h:390
static void set_initial_level(int value)
Sets the default initial projection level.
Definition funcdefaults.h:201
static void set_cubic_cell(double lo, double hi)
Sets the user cell to be cubic with each dimension having range [lo,hi].
Definition funcdefaults.h:363
static void set_refine(bool value)
Sets the default adaptive refinement flag.
Definition funcdefaults.h:249
static void set_max_refine_level(int value)
Sets the default maximum adaptive refinement level.
Definition funcdefaults.h:221
static const BoundaryConditions< NDIM > & get_bc()
Returns the default boundary conditions.
Definition funcdefaults.h:311
static Tensor< double > cell
cell[NDIM][2] Simulation cell, cell(0,0)=xlo, cell(0,1)=xhi, ...
Definition funcdefaults.h:118
static void set_cell(const Tensor< double > &value)
Gets the user cell for the simulation.
Definition funcdefaults.h:355
static void set_pmap(const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &value)
Sets the default process map (does not redistribute existing functions)
Definition funcdefaults.h:421
static int initial_level
Initial level for fine scale projection.
Definition funcdefaults.h:107
static bool autorefine
Whether to autorefine in multiplication, etc.
Definition funcdefaults.h:112
static const Tensor< double > & get_rcell_width()
Returns the reciprocal of the width of each user cell dimension.
Definition funcdefaults.h:375
static Tensor< double > make_default_cell()
Definition funcdefaults.h:127
static std::optional< BoundaryConditions< NDIM > > bc
Default boundary conditions, not initialized by default and must be set explicitly before use.
Definition funcdefaults.h:117
static int set_length_scale(const double lo, const size_t k=get_k())
adapt the special level to resolve the smallest length scale
Definition funcdefaults.h:339
static void print()
Definition mraimpl.h:3569
static std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > get_pmap(World &world)
Returns the default process map that can be used with the given world.
Definition funcdefaults.h:409
static Tensor< double > rcell_width
Reciprocal of width.
Definition funcdefaults.h:120
static bool get_apply_randomize()
Gets the random load balancing for integral operators flag.
Definition funcdefaults.h:290
static double get_cell_min_width()
Returns the minimum width of any user cell dimension.
Definition funcdefaults.h:380
static void recompute_cell_info()
Definition funcdefaults.h:145
static bool project_randomize
If true use randomization for load balancing in project/refine.
Definition funcdefaults.h:116
static const Tensor< double > & get_cell()
Gets the user cell for the simulation.
Definition funcdefaults.h:348
static void set_defaults(World &world)
Definition mraimpl.h:3534
static int max_refine_level
Level at which to stop refinement.
Definition funcdefaults.h:109
static TensorType tt
structure of the tensor in FunctionNode
Definition funcdefaults.h:123
static int get_initial_level()
Returns the default initial projection level.
Definition funcdefaults.h:189
static bool get_truncate_on_project()
Gets the default truncate on project flag.
Definition funcdefaults.h:278
static bool refine
Whether to refine new functions.
Definition funcdefaults.h:111
Key is the index for a node of the 2^NDIM-tree.
Definition key.h:69
A tensor is a multidimensional array.
Definition tensor.h:317
T max(long *ind=0) const
Return the maximum value (and if ind is non-null, its index) in the Tensor.
Definition tensor.h:1703
T product() const
Return the product of all elements of the tensor.
Definition tensor.h:1676
T min(long *ind=0) const
Return the minimum value (and if ind is non-null, its index) in the Tensor.
Definition tensor.h:1683
A simple, fixed dimension vector.
Definition vector.h:64
Interface to be provided by any process map.
Definition worlddc.h:122
A parallel world class.
Definition world.h:132
static World & get_default()
Default World object accessor.
Definition world.h:260
ProcessID nproc() const
Returns the number of processes in this World (same as MPI_Comm_size()).
Definition world.h:325
static double lo
Definition dirac-hatom.cc:23
Multidimension Key for MRA tree and associated iterators.
#define MADNESS_PRAGMA_CLANG(x)
Definition madness_config.h:200
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
std::ostream & operator<<(std::ostream &os, const particle< PDIM > &p)
Definition lowrankfunction.h:401
static Key< NDIM > simpt2key(const Vector< T, NDIM > &pt, Level n)
Definition funcdefaults.h:453
TreeState
Definition funcdefaults.h:59
@ nonstandard_after_apply
s and d coeffs, state after operator application
Definition funcdefaults.h:64
@ on_demand
no coeffs anywhere, but a functor providing if necessary
Definition funcdefaults.h:67
@ redundant_after_merge
s coeffs everywhere, must be summed up to yield the result
Definition funcdefaults.h:66
@ reconstructed
s coeffs at the leaves only
Definition funcdefaults.h:60
@ nonstandard
s and d coeffs in internal nodes
Definition funcdefaults.h:62
@ unknown
Definition funcdefaults.h:68
@ compressed
d coeffs in internal nodes, s and d coeffs at the root
Definition funcdefaults.h:61
@ redundant
s coeffs everywhere
Definition funcdefaults.h:65
@ nonstandard_with_leaves
like nonstandard, with s coeffs at the leaves
Definition funcdefaults.h:63
static void user_to_sim(const Vector< double, NDIM > &xuser, Vector< double, NDIM > &xsim)
Convert user coords (cell[][]) to simulation coords ([0,1]^ndim)
Definition funcdefaults.h:444
int64_t Translation
Definition key.h:57
static void sim_to_user(const Vector< double, NDIM > &xsim, Vector< double, NDIM > &xuser)
Convert simulation coords ([0,1]^ndim) to user coords (FunctionDefaults<NDIM>::get_cell())
Definition funcdefaults.h:464
static const int MAXLEVEL
The maximum depth of refinement possible.
Definition funcdefaults.h:57
static const Slice _(0,-1, 1)
int Level
Definition key.h:58
bool initialized()
Check if the MADNESS runtime has been initialized (and not subsequently finalized).
Definition world.cc:74
static double pop(std::vector< double > &v)
Definition SCF.cc:115
TensorType
low rank representations of tensors (see gentensor.h)
Definition gentensor.h:120
@ TT_FULL
Definition gentensor.h:120
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:371
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition mra.h:2096
static const int MAXK
The maximum wavelet order presently supported.
Definition funcdefaults.h:54
Defines and implements most of Tensor.
constexpr std::size_t NDIM
Definition testgconv.cc:54
Implement the madness:Vector class, an extension of std::array that supports some mathematical operat...
Implements WorldContainer.