Subject: [UFC-dev] Mixed elements (create_sub_element)

From: "Martin Sandve Alnæs" <[email-masked]>
Date: Fri, 12 Jan 2007 11:02:06 +0100

When sub_element(i) wasn't a factory function, this implementation was possible:

            "num_sub_elements"          : "  return 1;",
            "sub_element"               : "  return *this;",

I imagine this makes it easy to write general assembly code that
handles mixed and non-mixed elements at the same time. Making it a
factory function introduces more memory handling hassle, for what
reason?

Now I'd have to do this for non-mixed elements:
            "num_sub_elements"         : "  return 1;",
            "create_sub_element"        : "  return new my_class_name();",
I can't return this, because the assembler would probably delete me twice then.

martin

---

From: Anders Logg <[email-masked]>
Date: Fri, 12 Jan 2007 11:28:13 +0100

> I can't return this, because the assembler would probably delete me twice then.

The assembler should not need to call the *sub_element* functions at
all. It only needs to work through the given finite_element.

/Anders