Skip to content

Commit

Permalink
Rename transform()->redistribute()
Browse files Browse the repository at this point in the history
And document/warn about the counterintuitive/unsupported
higher-order-geometry behavior.
  • Loading branch information
roystgnr committed Apr 24, 2014
1 parent fb98d88 commit 08a3337
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions include/mesh/mesh_modification.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ void distort (MeshBase& mesh,
* Deterministically perturb the nodal locations. This function will
* move each node from it's current x/y/z coordinates to a new x/y/z
* coordinate given by the first LIBMESH_DIM components of the
* specified function.
* specified function \p mapfunc
*
* Nodes on the boundary are also moved.
*
* Currently, non-vertex nodes are moved in the same way as vertex
* nodes, according to (newx,newy,newz) = mapfunc(x,y,z). This
* behavior is often suboptimal for higher order geometries and may be
* subject to change in future libMesh versions.
*/
void transform (MeshBase& mesh,
const FunctionBase<Real> &transfunc);
void redistribute (MeshBase& mesh,
const FunctionBase<Real> &mapfunc);


/**
Expand Down
10 changes: 5 additions & 5 deletions src/mesh/mesh_modification.C
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ void MeshTools::Modification::distort (MeshBase& mesh,



void MeshTools::Modification::transform (MeshBase& mesh,
const FunctionBase<Real> &transfunc)
void MeshTools::Modification::redistribute (MeshBase& mesh,
const FunctionBase<Real> &mapfunc)
{
libmesh_assert (mesh.n_nodes());
libmesh_assert (mesh.n_elem());

START_LOG("transform()", "MeshTools::Modification");
START_LOG("redistribute()", "MeshTools::Modification");

DenseVector<Real> output_vec(LIBMESH_DIM);

// FIXME - we should thread this later.
AutoPtr<FunctionBase<Real> > myfunc = transfunc.clone();
AutoPtr<FunctionBase<Real> > myfunc = mapfunc.clone();

MeshBase::node_iterator it = mesh.nodes_begin();
const MeshBase::node_iterator end = mesh.nodes_end();
Expand All @@ -167,7 +167,7 @@ void MeshTools::Modification::transform (MeshBase& mesh,
}

// All done
STOP_LOG("transform()", "MeshTools::Modification");
STOP_LOG("redistribute()", "MeshTools::Modification");
}


Expand Down

0 comments on commit 08a3337

Please sign in to comment.