Hi,
I am trying to solve Poisson's equation for electric potential including
dielectric boundaries.
Incidenting charges are sticked and accumulated on the dielectric surfaces and
applied to Neumann boundary condition to normal direction.
In this case, accumulated charge density on the dielectric nodes in the
previous timestep have to be recorded.
For ions, ion flux into dielectric boundary is dependent on electric field
which is gradient of electric potential, so that iteration for the elements is
required.
Next is my code for ion flux calculation.
MeshBase::const_element_iterator el = mesh.local_elements_begin();
const MeshBase::const_element_iterator end_el = mesh.local_elements_end();
for(;el!=end_el;++el){
const Elem* elem = *el;
dof_map.dof_indices (elem, dof_indices);
fe->reinit(elem);
for(unsigned int s=0;s<elem->n_sides();s++)
if(elem->neighbor(s)==NULL){
fe_face->reinit(elem, s);
for(unsigned int qp=0;qp<qface->n_points();qp++){
for(unsigned int id=0;id<n_dielectric;++id)
if(is_inside_segment(qface_point[qp], dielectric[id])){
Number ni = 0.;
Number mu = mu_i();
Gradient E_field = 0.;
for (unsigned int l=0; l<psi.size(); l++){
ni += psi[l][qp]*ion_system.old_solution (dof_indices[l]);
E_field.add_scaled(-dpsi[l][qp],
poisson_system.current_solution(dof_indices[l]));
}
for(unsigned int k=0;k<dielectric[id].sigma.size();++k)
for(unsigned int j=0;j<psi.size();++j)
if(dof_indices[j]==dielectric[id].dof_indices[k]){
dielectric[id].sigma[k] += 1.e6*dt*e_charge*psi[j][qp]*mu*ni
*((normal[qp]*E_field)>0?sqrt(E_field*E_field):0.);
}
}
}
}
}
It works well in serial computation, however, does not in parallel.
Element iterations are maybe automatically parallelized.
I want to use parallel mesh for fast computation, but do not for boundary
setting.
Is there any way for not parallelized computing for element iteration?
Thanks
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users