Hi:
I'm trying to implement Dirichlet boundary conditions in a 1D
problem using DiffSystem. There isn't really an example to cover this,
so I just want to verify what I came up with makes sense, where two
variables "B" and "lB" should be zero at the domain boundaries x=0,1
(note, using numerical jacobians for now):
const Real penalty = 1.e10;
if (elem->contains_point(Point(0.,0.))||elem->contains_point(Point(1.,0.)))
{
for(unsigned int s=0; s<elem->n_sides(); s++)
{
if(elem->neighbor(s) == NULL)
{
Number B = side_value(B_var, s),
lB = side_value(lB_var, s);
Real B_value = 0.;
Real lB_value = 0.;
for (unsigned int i=0; i != n_B_dofs; i++)
{
F1(i) += JxW_side[s] * penalty *
(B - B_value) * phi_side[i][s];
F2(i) += JxW_side[s] * penalty *
(lB - lB_value) * phi_side[i][s];
}
}
}
}
--
Nasser Mohieddin Abukhdeir
Graduate Student (Materials Modeling Research Group)
McGill University - Department of Chemical Engineering
http://webpages.mcgill.ca/students/nabukh/web/
http://mmrg.chemeng.mcgill.ca/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users