#include "maxwell_interface.h" void electromagnetic_field::resize(size_t p_num_dofs) { Ex = vecxd::Zero(p_num_dofs); Ey = vecxd::Zero(p_num_dofs); Ez = vecxd::Zero(p_num_dofs); Hx = vecxd::Zero(p_num_dofs); Hy = vecxd::Zero(p_num_dofs); Hz = vecxd::Zero(p_num_dofs); num_dofs = p_num_dofs; } void electromagnetic_field_gpu::zero() { Ex.zero(); Ey.zero(); Ez.zero(); Hx.zero(); Hy.zero(); Hz.zero(); } void electromagnetic_field_gpu::resize(size_t p_num_dofs) { Ex.resize(p_num_dofs); Ey.resize(p_num_dofs); Ez.resize(p_num_dofs); Hx.resize(p_num_dofs); Hy.resize(p_num_dofs); Hz.resize(p_num_dofs); num_dofs = p_num_dofs; } electromagnetic_field_gpu::raw_ptrs electromagnetic_field_gpu::data(void) { raw_ptrs ret; ret.num_dofs = num_dofs; ret.Ex = Ex.data(); ret.Ey = Ey.data(); ret.Ez = Ez.data(); ret.Hx = Hx.data(); ret.Hy = Hy.data(); ret.Hz = Hz.data(); return ret; } void electromagnetic_field_gpu::copyin(const electromagnetic_field& emf) { Ex.copyin(emf.Ex.data(), emf.Ex.size()); Ey.copyin(emf.Ey.data(), emf.Ey.size()); Ez.copyin(emf.Ez.data(), emf.Ez.size()); Hx.copyin(emf.Hx.data(), emf.Hx.size()); Hy.copyin(emf.Hy.data(), emf.Hy.size()); Hz.copyin(emf.Hz.data(), emf.Hz.size()); } void electromagnetic_field_gpu::copyout(electromagnetic_field& emf) { if (num_dofs != emf.num_dofs) emf.resize(num_dofs); Ex.copyout(emf.Ex.data()); Ey.copyout(emf.Ey.data()); Ez.copyout(emf.Ez.data()); Hx.copyout(emf.Hx.data()); Hy.copyout(emf.Hy.data()); Hz.copyout(emf.Hz.data()); }