### Integration with position vectors

40

views

2

Hello everyone,

I'm trying to solve some 3D magnetic field problems and stuck trying to code the following integral:

$A\left(r\right)=\frac{\mu}{4\pi}\int\int\int\frac{M\left(r'\right)\times\left(r-r'\right)}{\left|r-r'\right|^3}dV'$`A`(`r`)=`μ`4π ∫∫∫`M`(`r`')×(`r`−`r`')|`r`−`r`'|^{3} `d``V`'

A, M, r and r' are vectors. M is constant over one of the subdomains and zero anywhere else. r is the general position vector and r' the one that is being integrated. I'm especially confused about how to access the vector r'. Is there a way to implement this integral in FEniCS syntax? I'm a complete novice to FEniCS, so I'd be greatful for any answer that could help me out.

Thanks in advance!

Community: FEniCS Project

Please login to add an answer/comment or follow this question.