Hi.
I re-send my question (because no enter is recognized in my previous
question)
I am currently making a code which can treat moving mesh problem.
I used GmshIO to construct mesh object, andI made a function to move
boundary nodes in one boundary, as given amount (of growth).
The thing what I want to do now is redistribute internal mesh to prevent
negative jacobian from twisted nodes after the intended movement.
In here, I want to fix the position of bounday nodes, so I just want to
redistribute internal nodes only.
I have used the MeshTools::Modification::smooth() function to redistribute
the nodes, but it seems that this use "averaged position between nodes".
So this lead the unintended movement of boundary nodes after their
intended movement (when I used smooth function)
Is there any possible way to solve this kind of problem?
More information for my case; Assume that there is a 2D rectanguler mesh
file from Gmsh. It will contain;
4 point for edge ((0,0), (1,0), (1,1), and (0,1))
4 bounadry id (left = 1, bottom = 2, right = 3, top = 4)
1 domain id (surface = 1) My object is to move the boundary nodes in
"right boundary" , and redistribute internal nodes without boundary nodes
>From the mesh file, I make mesh object by using
"GmshIO(mesh).read("meshfile_name.msh");"
and by using followed function, I write the a function, which includes
followed contents;
void Function(Mesh & mesh)
{
MeshBase::element_iterator el = mesh.level_elements_begin(0);
MeshBase::element_iterator end = mesh.level_elements_end(0);
for (; el != end; ++el)
{
const Elem* elem = *el;
std::vector<boundary_id_type> bc_ids;
for (unsigned int s = 0; s < elem->n_neighbors(); s++)
{
if (elem->neighbor(s) == NULL)
{
mesh.get_boundary_info().boundary_ids (elem, s,
bc_ids);
for (std::vector<boundary_id_type>::const_iterator b =
bc_ids.begin(0; b != bc_ids.end(); ++b)
{
const boundary id_type bc_id = *b;
if (bc_id == 3) // Right
boundary
{
std::unique_ptr<Elem> side
(elem->build_side(0));
Node* node0 =
side->get_node(0);
const unsigned int id0 =
node0->id();
Point point0 = *static_cast<const Point
*>(node0);
thickness_at_height =
Function_to_calculate_thickness_at_height(point0(1)); // This function will
return the amount of movement at each height
mesh.node(id0) =
Point(thickness_at_height, point0(1), point0(2));
}
}
}
}
}
MeshTools::Modification::smooth(mesh, 1000, 0);
}
Thanks for reading my question.
Best regards;
Seungjin Seo.
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users