← Back to team overview

dolfin team mailing list archive

Re: [Question #150226]: Using mesher region information/ tags

 

Question #150226 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/150226

Johan Hake proposed the following answer:
It looks like abacus supports writing of Meshfunctions for materials and
such.

Look in:

  site-packages/dolfin/mesh/meshconverter.py

  ...
  def _abaqus(...):
    ...
    handler.start_meshfunction("material", 3, num_entities)
    # Each material is associated with a number of element sets
    for i, matname in enumerate(materials):
        try: elsetids = material2elsetids[matname]
        except KeyError:
            # No elements for this material
            continue
        # For each element set associated with this material
        elsets = []
        for eid in elsetids:
            try: elsets.append(eid2elset[eid])
            except KeyError:
                handler.error("Material '%s' is assigned to undefined element 
"
                        "set '%s'" % (matname, eid))
        for elset in elsets:
            for elemid in elset:
                handler.add_entity_meshfunction(elemids.index(elemid), i)
    handler.end_meshfunction()


I guess something like this needs to be added to the 

  def gmsh2xml

function.

Johan

On Wednesday March 23 2011 15:59:05 Neilen Marais wrote:
> Question #150226 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/150226
> 
> Neilen Marais posted a new comment:
> Anders,
> 
> I think I could cook up a patch, but I have searched (in vain) for a
> description of the dolfin xml format. If you could point me in the right
> direction I'm sure I could have a patch done in no time!
> 
> Thanks
> Neilen

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.