← Back to team overview

dolfin team mailing list archive

Re: Mesh Refinement

 

Jehanzeb Hameed wrote:
Thanks. That makes mesh refinement work, but not equivalent to uniform
refinement, i.e. it doesnt refine every triangle (for 2d case) into 4
equivalent triangles. Any way to do that?

Not now. MeshData update is not implemented in uniform refinement.
UniformRefinement and LocalRefinement use completely different algorithms.

You can try to call mesh.refine(markers) function many times. After 2-4 times result is usually very similar to the uniform refinement.

cheers,




-Jehanzeb

On Wed, Jun 17, 2009 at 11:07 AM, Bartosz Sawicki<sawickib@xxxxxxxxxxxxx> wrote:
I'm a little bit confused. This functionality was committed in March, so  it
should be included in Dolfin 0.9.2 which was released in April.

Wait .... I've just realize the problem. You are using refine() which calls
UniformRefinement, which is simplified version.
You should to call :
void refine (MeshFunction< bool > &cell_markers)

For uniform refinement it should be similar to:
MeshFunction<bool> markers(mesh,3);
markers = true;
mesh.refine(markers);

cheers,
BArtek


Jehanzeb Hameed wrote:
I dont get that output. I get this:

"No cells marked for refinement, assuming uniform mesh refinement."

I followed the instructions for Jaunty on
http://www.fenics.org/wiki/Download. Could I have an older version? If
so, whats the best course of action...download the latest source and
compile it?

-Jehanzeb

On Tue, Jun 16, 2009 at 5:20 PM, Bartosz Sawicki<sawickib@xxxxxxxxxxxxx>
wrote:
Jehanzeb Hameed wrote:
I cant get the material indicators to update, as well as boundary
markers. For example,

MeshFunction<dolfin::uint> *materialFunc =
mesh.data().mesh_function("material indicators");

gives materialFunc  = 0 after mesh refinement (it works fine before
mesh refinement). I am refining my mesh by

mesh.refine();

Am I missing something?
Looks fine, but what is on output? You should see following messages:

 Refining simplicial mesh by recursive Rivara bisection.
 MeshData MeshFunction "material indicators" transformed.
 MeshData "boundary indicators" transformed.

cheers,
BArtek


-Jehanzeb



On Mon, Jun 15, 2009 at 10:46 AM, Bartosz
Sawicki<sawickib@xxxxxxxxxxxxx>
wrote:
Jehanzeb Hameed wrote:
I am still struggling with this....

I am trying to store subdomain identifiers in meshdata object, so that
they get updated when the mesh is refined. To do this, I have a file,
mesh.xml. In that file, there is a tag named "data". The "data" tag
has a child "array" with name = "material indicators". So, now when I
create mesh, will my meshdata have this array?
Not really. Tag <data> can contain arrays, meshfunctions and mappings..
"material indicators" has to be stored in meshfunction.

I'll send you example of xml mesh file with material data directly on
your
email.


And how do I create cell dependent functions. The example in Dolfin
user manual seems outdated. I think I need to use UFCfunction, but
what do I pass as Function arguement to its constructor (if
UFCfunction is indeed the correct way to go).
Maybe you can use UFCFunction to initialize MeshFunction, but for me
more
natural is using MeshFunction constructors.


http://www.fenics.org/pub/documents/dolfin/dolfin-progr-reference/d0/d94/classdolfin_1_1MeshFunction.html

For example if want to have meshfunction defined over tetrahedral:
MeshFunction meshfunction(mesh, 3);

cheers,
BArtek



-Jehanzeb

On Thu, Jun 11, 2009 at 11:55 AM, Bartosz
Sawicki<sawickib@xxxxxxxxxxxxx>
wrote:
Jehanzeb Hameed wrote:
Hello,

I am new to Dolfin, and was wondering how subdomains are supported
as
regards to mesh reading and refinement. In my case, I will have a
mesh, with 2 subdomains. Each cell has an identifier indicating
which
domain it belongs to. Looking at the examples, it seems I will need
to
store domain identifiers in a separate xml file. Is that correct?
Subdomain identifiers can be stored in different ways, as a separate
MeshFunction, or in the MeshData structure.
I prefer MeshData, because it is directly included in the Mesh
object..
You can also store boundary indicators using MeshData structure, see
demo/pde/bcs.

With regard to mesh refinement, I assume I will be able to define
subdomains for each domain based on cell identifiers. Now, when I
refine the mesh, will the subdomains also be updated (i.e. will
dolfin
know what domain the new cells belong to) ?
If you name your MeshFunction "material indicators" it will be
transformed
to follow refined mesh. Arrays which store boundary indicators will
be
updated too.
See LocalMeshRefinement::transformMeshData()

Also, is there a way to read archives of this list?
Yes, there is http://www.fenics.org/pipermail/dolfin-dev/

regrds.
BArtek


Thanks,
-Jehanzeb
_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




References