Dendro  5.01
Dendro in Greek language means tree. The Dendro library is a large scale (262K cores on ORNL's Titan) distributed memory adaptive octree framework. The main goal of Dendro is to perform large scale multiphysics simulations efficeiently in mordern supercomputers. Dendro consists of efficient parallel data structures and algorithms to perform variational ( finite element) methods and finite difference mthods on 2:1 balanced arbitary adaptive octrees which enables the users to perform simulations raning from black holes (binary black hole mergers) to blood flow in human body, where applications ranging from relativity, astrophysics to biomedical engineering.
Functions | Variables
dendro Namespace Reference

Constains profile parameters for Dendro performance measurements. More...

Functions

def d2 (i, j, a)
 
def scalar (name, idx)
 variable initialization functions More...
 
def vec3 (name, idx)
 
def sym_3x3 (name, idx)
 
def mat_3x3 (name, idx)
 
def set_first_derivative (g)
 derivative related functions More...
 
def set_second_derivative (g)
 
def set_advective_derivative (g)
 
def set_kreiss_oliger_dissipation (g)
 
def DiDj (a)
 
def up_up (A)
 
def up_down (A)
 
def lie (b, a, weight=0)
 
def kodiss (a)
 
def laplacian (a, chi)
 
def laplacian_conformal (a)
 
def sqr (a)
 
def trace_free (x)
 
def vec_j_del_j (b, a)
 
def vec_j_ad_j (b, f)
 
def set_metric (g)
 metric related functions More...
 
def get_inverse_metric ()
 
def get_first_christoffel ()
 
def get_second_christoffel ()
 
def get_complete_christoffel (chi)
 
def compute_ricci (Gt, chi)
 
def construct_cse (ex, vnames, idx)
 code generation function
 
def generate_cpu (ex, vnames, idx)
 
def generate_fpcore (ex, vnames, idx)
 
def generate_avx (ex, vnames, idx)
 
def change_deriv_names (str)
 
def generate_separate (ex, vnames, idx, prefix="")
 
def replace_pow (exp_in)
 
def generate_debug (ex, vnames)
 
def vec_print_str (tv, pdvars)
 
def gen_vector_code (ex, vsym, vlist, oper, prevdefvars, idx)
 

Variables

 undef = symbols('undefined')
 
 metric = undef
 
 inv_metric = undef
 
 C1 = undef
 
 C2 = undef
 
 C3 = undef
 
 d = undef
 
 d2s = undef
 
 ad = undef
 
 kod = undef
 
 one = symbols('one_')
 
 negone = symbols('negone_')
 
list e_i = [0, 1, 2]
 
list e_ij = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)]
 
 Ricci = undef
 

Detailed Description

Constains profile parameters for Dendro performance measurements.

Author
Milinda Fernando School of Computing, University of Utah

Function Documentation

◆ compute_ricci()

def dendro.compute_ricci (   Gt,
  chi 
)
Computes the Ricci tensor. e.g.,

dendro.set_metric(gt)

R = dendro.compute_ricci(Gt, chi)

or

dendro.compute_ricci(Gt, chi)

and use

dendro.ricci

The conformal connection coefficient and the conformal variable needs to be supplied.

◆ DiDj()

def dendro.DiDj (   a)
Defines the covariant derivative for a scalar a with respect to the full metric.
[ewh] Actually this defines two covariant derivatives acting on a scalar.
The derivative in this case is built from the full (non-conformal) metric.
Thus C3 is built from the full metric.  This object is symmetric in both
indices.

◆ gen_vector_code()

def dendro.gen_vector_code (   ex,
  vsym,
  vlist,
  oper,
  prevdefvars,
  idx 
)
create vectorized code from an expression.
options:
    ex:               expression
    vsym:             numbered symbols
    vlist:            an empty list that is used to process the tree. on return
                      this list contains the name of the variable with the final
                      result
    oper:             dictionary for '+' and '*' operators
    prevdefvars:      an empty set used to identify previously defined temporary variables.
    idx:              name of index for accessing arrays, i.e., alpha[idx].

◆ generate_cpu()

def dendro.generate_cpu (   ex,
  vnames,
  idx 
)
Generate the C++ code by simplifying the expressions.

◆ generate_debug()

def dendro.generate_debug (   ex,
  vnames 
)
Generate the C++ code by simplifying the expressions.

◆ generate_fpcore()

def dendro.generate_fpcore (   ex,
  vnames,
  idx 
)
Generate the FPCore code, 

◆ generate_separate()

def dendro.generate_separate (   ex,
  vnames,
  idx,
  prefix = "" 
)
Generate the C++ code by simplifying the expressions.

◆ get_complete_christoffel()

def dendro.get_complete_christoffel (   chi)
Computes and returns the second Christoffel Symbols. Assumes the metric has been set. Will compute the first/second
Christoffel if not already computed. e.g.,

dendro.set_metric(gt);

C2_spatial = dendro.get_complete_christoffel();

◆ get_first_christoffel()

def dendro.get_first_christoffel ( )
Computes and returns the first Christoffel Symbols. Assumes the metric has been set. e.g.,

dendro.set_metric(gt);

C1 = dendro.get_first_christoffel();

◆ get_inverse_metric()

def dendro.get_inverse_metric ( )
Computes and returns the inverse metric. The variables need for be defined in advance. e.g.,

gt = dendro.sym_3x3("gt")
dendro.set_metric(gt)
igt = dendro.get_inverse_metric()

◆ get_second_christoffel()

def dendro.get_second_christoffel ( )
Computes and returns the second Christoffel Symbols. Assumes the metric has been set. Will compute the first
Christoffel if not already computed. e.g.,

dendro.set_metric(gt);

C2 = dendro.get_second_christoffel();

◆ kodiss()

def dendro.kodiss (   a)
Kreiss-Oliger dissipation operator

◆ laplacian()

def dendro.laplacian (   a,
  chi 
)
Computes the laplacian of a scalar function with respect to the 3D metric
gamma_ij.  Assumes that the conformally rescaled metric (called gt in
various places) and the conformal factor (chi) is set.  Note that C3 is
built from the same 3D metric.  The only place that this laplacian is
used in the bssn equations is in the evolution equation for K and is
the laplacian of alpha (the lapse).

◆ laplacian_conformal()

def dendro.laplacian_conformal (   a)
Computes the (conformal) laplacian of a scalar function with respect
to the tilded or conformally rescaled metric (called gt in various
places).  We assume the rescaled metric is set as well the conformal
factor, chi.  Note that C2 is built from the conformally rescaled
metrci.  This (conformal) laplacian is only used in the definition of
Ricci that shows up in the evolution equation for At (under the trace
free operation), and even then only in the part that multiplies the
metric and which will drop out on taking the trace free part.  So, in
fact, the code could be written to completely ignore this operation
in the evolution equations themselves.  However, if the constraints
are included or the full Ricci is needed for another reason, this
would be needed.

◆ lie()

def dendro.lie (   b,
  a,
  weight = 0 
)
Computes the Lie derivative of a field, a, along the vector b.  Assumes
the metric has been set.  An optional weight for the field can be
specified.

b must be of type dendro.vec3
a can be scalar, vec3 or sym_3x3

Computes L_b(v)

◆ mat_3x3()

def dendro.mat_3x3 (   name,
  idx 
)
Create a 3x3 matrix variables with the corresponding name. The 'name' will be during code generation, so
should match the variable name used in the C++ code. The returned variable can be indexed(0,1,2)^2, i.e.,

gt = dendro.sym_3x3("gt")
gt[0,2] = x^2

◆ replace_pow()

def dendro.replace_pow (   exp_in)
Convert integer powers in an expression to Muls, like a**2 => a*a
:param exp_in: the input expression,
:return: the output expression with only Muls

◆ scalar()

def dendro.scalar (   name,
  idx 
)

variable initialization functions

Create a scalar variable with the corresponding name. The 'name' will be during code generation, so should match the
variable name used in the C++ code.

◆ set_advective_derivative()

def dendro.set_advective_derivative (   g)
Set how the stencil for the second derivative will be called. Here g is a string

Typically,

ad_i u =  g(i, u)

◆ set_first_derivative()

def dendro.set_first_derivative (   g)

derivative related functions

Set how the stencil for the first derivative will be called. Here g is a string

Typically,

d_i u =  g(i, u)

◆ set_kreiss_oliger_dissipation()

def dendro.set_kreiss_oliger_dissipation (   g)
Set how the stencil for Kreiss-Oliger dissipation will be called. Here g is a string.

Typically,

kod_i u = g(i, u)

◆ set_metric()

def dendro.set_metric (   g)

metric related functions

sets the metric variable, so that dendro knows how to compute the derived variables. This should be done fairly
early on. e.g.,

gt = dendro.sym_3x3("gt")
dendro.set_metric(gt)

◆ set_second_derivative()

def dendro.set_second_derivative (   g)
Set how the stencil for the second derivative will be called. Here g is a string

Typically,

d_ij u =  g(i, j, u)

◆ sqr()

def dendro.sqr (   a)
Computes the square of the matrix. Assumes metric is set.

◆ sym_3x3()

def dendro.sym_3x3 (   name,
  idx 
)
Create a symmetric 3x3 matrix variables with the corresponding name. The 'name' will be during code generation, so
should match the variable name used in the C++ code. The returned variable can be indexed(0,1,2)^2, i.e.,

gt = dendro.sym_3x3("gt")
gt[0,2] = x^2

◆ trace_free()

def dendro.trace_free (   x)
makes the operator trace-free

◆ up_down()

def dendro.up_down (   A)
raises one index of A, i.e., A_{ij} --> A^i_j

◆ up_up()

def dendro.up_up (   A)
raises both the indices of A, i.e., A_{ij} --> A^{ij}

◆ vec3()

def dendro.vec3 (   name,
  idx 
)
Create a 3D vector variable with the corresponding name. The 'name' will be during code generation, so should match
the variable name used in the C++ code. The returned variable can be indexed(0,1,2), i.e.,

b = dendro.vec3("beta")
b[1] = x^2

◆ vec_j_ad_j()

def dendro.vec_j_ad_j (   b,
  f 
)
expands to  $\beta^i\partial_i f$

◆ vec_j_del_j()

def dendro.vec_j_del_j (   b,
  a 
)
expands to  $\beta^i\partial_i \alpha$

◆ vec_print_str()

def dendro.vec_print_str (   tv,
  pdvars 
)
This returns a string that will be used to print a line of code. If the
variable tv has not yet been used before, then the declaration of this
variable must be included in the string. pdvars is the list of variables
that have been previously defined.

    tv:          new temporary variable
    pdvars:      list of previously declared variables.