Skip to content

Accessing array of unknown dofs #848

Discussion options

You must be logged in to vote

This should work

dres_dt = res.derivative("udofs") @ function.Argument('dudtdofs', ns.basis.shape)

Alternatively you can define u as u0 + t dudt and take the derivative to t:

ns = Namespace()
ns.x = geom
ns.define_for('x', gradient='∇', normal='n', jacobians=('dV', 'dS'))
ns.basis = domain.basis(btype, degree=degree)
ns.add_field(('u0', 'dudt', 'v'), ns.basis)
ns.add_field('t')
ns.u = 'u0 + t dudt'

res = domain.integral('∇_i(v) ∇_i(u) dV' @ ns, degree=degree*2)
res -= domain.boundary['right'].integral('v cos(1) cosh(x_1) dS' @ ns, degree=degree*2)

dres_dt = res.derivative('t')
'''

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TomvanSluijs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants