#f = Function('f')

# generate metric related quantities
dendro.set_metric(gt)
igt = dendro.get_inverse_metric()

C1 = dendro.get_first_christoffel()
C2 = dendro.get_second_christoffel()
#what's this...tried to comment it out and python compilation fails
C2_spatial = dendro.get_complete_christoffel(chi)
R, Rt, Rphi, CalGt = dendro.compute_ricci(Gt, chi)
###################################################################
# evolution equations
###################################################################

a_rhs = l1 * dendro.lie(b, a) - 2 * a * K + 0 * dendro.kodiss(a)

#[ewh] In the had code, this is treated as an advective derivative.
#      I think this should be:
#         l2 * dendro.vec_j_del_j(b, b[i])
b_rhs = [
    S(3) / 4 * (lf0 + lf1 * a) * B[i] + l2 * dendro.vec_j_ad_j(b, b[i])
    for i in dendro.e_i
] + dendro.kodiss(b)

gt_rhs = dendro.lie(b, gt, weight) - 2 * a * At + 0 * dendro.kodiss(gt)

chi_rhs = dendro.lie(
    b, chi, weight) + Rational(2, 3) * (chi * a * K) + 0 * dendro.kodiss(chi)

AikAkj = Matrix([
Ejemplo n.º 2
0
V_pi_ij = 2 * M_dRGT_sq * a * sqrt(calgt) / 2 * V_pi_ij

V_pi_ij = V_pi_ij.reshape(3, 3)

#define energy momentum quantities
rhot = -V_alpha / 2
Sit = -V_beta_i
Sijt = -V_pi_ij / a
St = sum(
    [sum([Sijt[i, j] * igt[i, j] for i in dendro.e_i]) for j in dendro.e_i])

###################################################################
# evolution equations
###################################################################

a_rhs = l1 * dendro.lie(b, a) - 2 * a * K + 0 * dendro.kodiss(a)

gt_rhs = dendro.lie(b, gt, weight) - 2 * a * At + 0 * dendro.kodiss(gt)

chi_rhs = dendro.lie(
    b, chi, weight) + Rational(2, 3) * (chi * a * K) + 0 * dendro.kodiss(chi)

AikAkj = Matrix([
    sum([
        At[i, k] *
        sum([dendro.inv_metric[k, l] * At[l, j] for l in dendro.e_i])
        for k in dendro.e_i
    ]) for i, j in dendro.e_ij
])

At_rhs = dendro.lie(b, At, weight) + chi * dendro.trace_free(
Ejemplo n.º 3
0
#f = Function('f')

# generate metric related quantities
dendro.set_metric(gt)
igt = dendro.get_inverse_metric()

C1 = dendro.get_first_christoffel()
C2 = dendro.get_second_christoffel()
#what's this...tried to comment it out and python compilation fails
C2_spatial = dendro.get_complete_christoffel(chi)
R, Rt, Rphi, CalGt = dendro.compute_ricci(Gt, chi)
###################################################################
# evolution equations
###################################################################

a_rhs = l1*dendro.lie(b, a) - 2*a*K + 0*dendro.kodiss(a)

#[ewh] In the had code, this is treated as an advective derivative.
#      I think this should be:
#         l2 * dendro.vec_j_del_j(b, b[i])
b_rhs = [ S(3)/4 * (lf0 + lf1*a) * B[i] +
        l2 * dendro.vec_j_ad_j(b, b[i])
         for i in dendro.e_i ] + dendro.kodiss(b)

gt_rhs = dendro.lie(b, gt, weight) - 2*a*At + 0*dendro.kodiss(gt)

chi_rhs = dendro.lie(b, chi, weight) + Rational(2,3) * (chi*a*K) + 0*dendro.kodiss(chi)

AikAkj = Matrix([sum([At[i, k] * sum([dendro.inv_metric[k, l]*At[l, j] for l in dendro.e_i]) for k in dendro.e_i]) for i, j in dendro.e_ij])

#ewh2 At_rhs = dendro.lie(b, At, weight) + dendro.trace_free(chi*(dendro.DiDj(a) + a*R)) + a*(K*At - 2*AikAkj.reshape(3, 3))
Ejemplo n.º 4
0
# evolution equations
###################################################################

a_rhs = l1*dendro.lie(b, a) - 2*a*K

b_rhs = [ S(3)/4 * (lf0 + lf1*a) * B[i] +
        l2 * dendro.vec_j_ad_j(b, b[i])
         for i in dendro.e_i ]

gt_rhs = dendro.lie(b, gt, weight) - 2*a*At

chi_rhs = dendro.lie(b, chi, weight) + Rational(2,3) * (chi*a*K)

AikAkj = Matrix([sum([At[i, k] * sum([dendro.inv_metric[k, l]*At[l, j] for l in dendro.e_i]) for k in dendro.e_i]) for i, j in dendro.e_ij])

At_rhs = dendro.lie(b, At, weight) + chi*dendro.trace_free( a*R - dendro.DiDj(a)) + a*(K*At - 2*AikAkj.reshape(3, 3)) + 0*dendro.kodiss(At)

K_rhs = dendro.lie(b, K) - dendro.laplacian(a,chi) + a*(K*K/3 + dendro.sqr(At)) + 0*dendro.kodiss(K)

At_UU = dendro.up_up(At)

Gt_rhs = Matrix([sum(b[j]*ad(j,Gt[i]) for j in dendro.e_i) for i in dendro.e_i]) - \
         Matrix([sum(CalGt[j]*d(j,b[i]) for j in dendro.e_i) for i in dendro.e_i]) + \
         Rational(2,3)*Matrix([ CalGt[i] * sum(d(j,b[j]) for j in dendro.e_i)  for i in dendro.e_i ]) + \
         Matrix([sum([igt[j, k] * d2(j, k, b[i]) + igt[i, j] * d2(j, k, b[k])/3 for j, k in dendro.e_ij]) for i in dendro.e_i]) - \
         Matrix([sum([2*At_UU[i, j]*d(j, a) for j in dendro.e_i]) for i in dendro.e_i]) + \
         Matrix([sum([2*a*dendro.C2[i, j, k]*At_UU[j, k] for j,k in dendro.e_ij]) for i in dendro.e_i]) - \
         Matrix([sum([a*(3/chi*At_UU[i,j]*d(j, chi) + Rational(4,3)*dendro.inv_metric[i, j]*d(j, K)) for j in dendro.e_i]) for i in dendro.e_i])

Gt_rhs = [item for sublist in Gt_rhs.tolist() for item in sublist]