### Integration with position vectors

40
views
2
5 weeks ago by

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')×(rr')|rr'|3 dV'

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.