Skip to content

How to code initial condition in the "Time Dependant Problem" example ? #434

Answered by fredrikekre
Drachta asked this question in Q&A
Discussion options

You must be logged in to vote

Since the initial conditions is usually on the whole domain (not just the boundary) you would have to perform an initial solve to compute u_0(x). If you have a known function u_0(x) and need to get that into the "FE-space" you can solve something like:

which, I think, is what the weak form of the heat equation reduced to at time t = 0. Solving this would be the correct way I think.

If you just want to compute the values for the dofs exactly, then there is no easy way to do this right now in Ferrite, but it would be good to have a way to interpolate like this, I guess.

The best way I can think of now is this "hack" of creating a constraint for all nodes and applying to your dof vector:

julia

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Drachta
Comment options

You must be logged in to vote
1 reply
@termi-official
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Drachta
Comment options

@fredrikekre
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants