- Thank you received: 0
Access Component of Vector-Valued function
- walker_tr9
- Topic Author
- Offline
- Senior Member
Less
More
2 years 7 months ago #4288
by walker_tr9
Access Component of Vector-Valued function was created by walker_tr9
This is really basic question, but if uu is a grid function, or a Trial function, or Test function, then how can I just get one of the components? I seem to have to do this: (assume uu has 3 components)
uu_0 = InnerProduct(uu, (1, 0, 0))
Is there another way?
uu_0 = InnerProduct(uu, (1, 0, 0))
Is there another way?
2 years 7 months ago #4289
by hvwahl
Replied by hvwahl on topic Access Component of Vector-Valued function
Hi,
you can do uu_0 = uu[0].
Best wishes,
Henry
you can do uu_0 = uu[0].
Best wishes,
Henry
- walker_tr9
- Topic Author
- Offline
- Senior Member
Less
More
- Thank you received: 0
2 years 7 months ago #4291
by walker_tr9
Replied by walker_tr9 on topic Access Component of Vector-Valued function
Yeah, I guess I have to do this as a separate line, and not combine with other operations. Duh.
2 years 7 months ago #4327
by joachim
Replied by joachim on topic Access Component of Vector-Valued function
you can combine component access with everything else, it is yet another node in the expression tree, try:
print (u[0])
You can't apply differential operators to components (as you can't apply for other expression), but you can do a
Grad(u)[0,:]
print (u[0])
You can't apply differential operators to components (as you can't apply for other expression), but you can do a
Grad(u)[0,:]
- walker_tr9
- Topic Author
- Offline
- Senior Member
Less
More
- Thank you received: 0
2 years 7 months ago #4328
by walker_tr9
Replied by walker_tr9 on topic Access Component of Vector-Valued function
Ok, thanks! I got what I needed working.
Time to create page: 0.097 seconds