2010/1/21 <[email protected]>:
------------------------------------------------------------ revno: 1502 committer: Marie E. Rognes <[email protected]> branch nick: ffc-unstable timestamp: Thu 2010-01-21 15:13:40 +0100 message: Fixes for covariant piola. Marie finally remembered why it should be (j, i) instead of (i, j).
Cool, I guess this means that the indices is based on some theory after all :) Kristian
modified: ffc/evaluatedof.py ffc/interpolatevertexvalues.py -- lp:~ffc-core/ffc/dev https://code.launchpad.net/~ffc-core/ffc/dev You are subscribed to branch lp:~ffc-core/ffc/dev. To unsubscribe from this branch go to https://code.launchpad.net/~ffc-core/ffc/dev/+edit-subscription. === modified file 'ffc/evaluatedof.py' --- ffc/evaluatedof.py 2010-01-18 20:24:30 +0000 +++ ffc/evaluatedof.py 2010-01-21 14:13:40 +0000 @@ -199,7 +199,7 @@ 'covariant piola' mapping for g: - G(X) = J g(x) i.e G_i(X) = J_ij g_j(x) + G(X) = J^T g(x) i.e G_i(X) = J^T_ij g(x) = J_ji g_j(x) """ # meg: Various mappings must be handled both here and in @@ -223,9 +223,9 @@ # covariant piola values = [] for i in range(dim): - jacobian_row = [J(i, j) for j in range(dim)] + jacobian_column = [J(j, i) for j in range(dim)] components = [component("vals", j + offset) for j in range(dim)] - values += [inner(jacobian_row, components)] + values += [inner(jacobian_column, components)] return values else: raise Exception, "The mapping (%s) is not allowed" % mapping === modified file 'ffc/interpolatevertexvalues.py' --- ffc/interpolatevertexvalues.py 2010-01-15 16:38:25 +0000 +++ ffc/interpolatevertexvalues.py 2010-01-21 14:13:40 +0000 @@ -4,7 +4,7 @@ __copyright__ = "Copyright (C) 2009" __license__ = "GNU GPL version 3 or any later version" -# Last changed: 2010-01-15 +# Last changed: 2010-01-21 from ffc.codesnippets import jacobian from ffc.cpp import format, remove_unused @@ -120,7 +120,7 @@ 'covariant piola' mapping for f: - g(x) = K G(X) i.e g_i(x) = K_ij G_j(X) + g(x) = K^T G(X) i.e g_i(x) = K^T_ij G_j(X) = K_ji G_j(X) """ if mapping is "affine": @@ -130,7 +130,7 @@ [G[j][index] for j in range(dim)])]) for index in range(space_dim)] elif mapping == "covariant piola": - change_of_variables = lambda G, i: [inner([Jinv(i, j) for j in range(dim)], + change_of_variables = lambda G, i: [inner([Jinv(j, i) for j in range(dim)], [G[j][index] for j in range(dim)]) for index in range(space_dim)] else:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mailing list: https://launchpad.net/~ffc Post to : [email protected] Unsubscribe : https://launchpad.net/~ffc More help : https://help.launchpad.net/ListHelp

