- Thank you received: 0
ZeroCoefficientFunction
- jameslowman
- Topic Author
- Offline
- New Member
Less
More
2 years 9 months ago #4185
by jameslowman
ZeroCoefficientFunction was created by jameslowman
I am writing some code to read boundary conditions as coefficient functions from other files, and to generalize the application of said boundary conditions into the weak form later. To do so, I load all the coefficient functions into a dictionary and have a for loop in my linear form that will apply them.
I have an issue when I assign a zero vector boundary condition (a velocity at a wall, for instance). Because the boundary conditions are being applied for every coefficient function in the for loop, when I try something like an "OuterProduct" on the zero vector, it will give a dimension error. The vector coefficient function of zeros has been replaced with something called "ZeroCoefficientFunction". I am guessing this is to aid in assembly for sparsity.
My question is -- how can I identify a 'ZeroCoefficientFunction' in code? I can't seem to figure out how to check for them, as their dimensions seem the same as a non zero CF... Attached is some code to show this error. I understand that the code is fairly useless (trying to calculate the outer product of a zero vector), but I hope the explanation above shows why this might occur sometimes.
James
I have an issue when I assign a zero vector boundary condition (a velocity at a wall, for instance). Because the boundary conditions are being applied for every coefficient function in the for loop, when I try something like an "OuterProduct" on the zero vector, it will give a dimension error. The vector coefficient function of zeros has been replaced with something called "ZeroCoefficientFunction". I am guessing this is to aid in assembly for sparsity.
My question is -- how can I identify a 'ZeroCoefficientFunction' in code? I can't seem to figure out how to check for them, as their dimensions seem the same as a non zero CF... Attached is some code to show this error. I understand that the code is fairly useless (trying to calculate the outer product of a zero vector), but I hope the explanation above shows why this might occur sometimes.
James
Attachments:
2 years 9 months ago #4186
by joachim
Replied by joachim on topic ZeroCoefficientFunction
Hi James,
there was a bug in the dimension of the ZeroCoefficientFunction,
your test-case works with very recent nightly versions.
Joachim
there was a bug in the dimension of the ZeroCoefficientFunction,
your test-case works with very recent nightly versions.
Joachim
The following user(s) said Thank You: jameslowman
- jameslowman
- Topic Author
- Offline
- New Member
Less
More
- Thank you received: 0
2 years 9 months ago #4187
by jameslowman
Replied by jameslowman on topic ZeroCoefficientFunction
Thanks so much for the quick reply Joachim. Updated and it worked!
Time to create page: 0.100 seconds