Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying Per-Material Fields Using Blueprint? #93

Closed
xjrc opened this issue Nov 12, 2016 · 6 comments
Closed

Specifying Per-Material Fields Using Blueprint? #93

xjrc opened this issue Nov 12, 2016 · 6 comments
Labels

Comments

@xjrc
Copy link
Member

xjrc commented Nov 12, 2016

I'd like to use Blueprint to describe a mesh that has multiple materials in a single zone, where each material has its own value for a particular field (e.g. density). Does Blueprint have any mechanism for describing such a field? If not, what would be the best way to utilize Blueprint's existing schema to describe such a field? Thanks in advance!

@xjrc xjrc added the question label Nov 12, 2016
@cyrush
Copy link
Member

cyrush commented Nov 17, 2016

these would simply be mcarrays named in a way that would allow us to understand they are density for each material

for example, if I have 3 materials, we could have an mcarray:

per_material_density:
{
den_mat_1: vals
den_mat_2: vals
den_mat_3: vals
}

and associated:

vol_fracs:
{
mat_1_vf:
mat_2_vf:
mat_3_vf:
}

of course in the future, we need to support sparse representations -- and would share indices across these type of mcarray reps

beyond this we can think about grouping via a hierarchy, having a special treatment for material fields

{
volume_fractions: { }
fields: {}
}

@xjrc
Copy link
Member Author

xjrc commented Nov 17, 2016

Storing per-material fields as an mcarray seems very sensible to me, and I like the idea of interpreting materials as a special type of field in Blueprint.

Given this information, I'd imagine that a Blueprint mesh with per-material fields would look like this:

mesh: {
  domain0: {
    /* coordsets, topologies */
    fields: {
      /* material is a reserved field name */
      material: {
        type: "scalar",
        association: "element",
        topology: "topology0",
        values: {
          material0: [ /* volume fractions for material 0 */ ],
          ...
          materialN: [ /* volume fractions for material N */ ],
        }
      },
      field0: {
        type: "scalar",
        association: "element",
        topology: "topology0",
        values: {
          material0: [ /* per-material field values for material 0 */ ],
          ...
          materialN: [ /* per-material field values for material N */ ],
        }
      },
      /* other fields */
    }
  },
  /* other domains */
}

Does this interpretation of Blueprint with materials seem correct, or is there something I'm missing? Thanks again for your help and I'm sorry if I'm missing anything obvious!

@cyrush
Copy link
Member

cyrush commented Nov 17, 2016

yes -- close to what I am thinking, lets chat in person to discuss using high bandwidth.

@xjrc
Copy link
Member Author

xjrc commented Dec 1, 2016

Based on our discussion, it seems like preliminary support for materials and per-material fields will look something like the following:

mesh: {
  domain0: {
    /* coordsets, topologies */
    materials: {
      association: "element",
      topology: "topology0",
      volume_fractions: {
        material0: [ /* volume fractions for material 0 */ ],
        ...
        materialN: [ /* volume fractions for material N */ ],
      }
    },
    fields: {
      field0: {
        type: "scalar",
        association: "element",
        topology: "topology0",
        values: {
          material0: [ /* per-material field values for material 0 */ ],
          ...
          materialN: [ /* per-material field values for material N */ ],
        }
      },
      /* other fields */
    }
  },
  /* other domains */
}

I'm going to close this issue for now, but we can reopen it when we refine the material and per-material field specifications in Blueprint.

@xjrc xjrc closed this as completed Dec 1, 2016
@cyrush
Copy link
Member

cyrush commented Dec 1, 2016

that sounds good, I would just add that under "materials" we will want to have a name -- to support the possibility of multiple material volume fraction sets

@xjrc
Copy link
Member Author

xjrc commented Jan 11, 2017

Just a few quick examples for reference:

Multi-Material, Single-Component Fields

{
  "coordsets": 
  {
    "domain0": 
    {
      "type": "explicit",
      "values": 
      {
        "x": [0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0],
        "y": [0.0, 0.0, 0.0, 0.0, 0.333333343267441, 0.333333343267441, 0.333333343267441, 0.333333343267441, 0.666666686534882, 0.666666686534882, 0.666666686534882, 0.666666686534882, 1.0, 1.0, 1.0, 1.0]
      }
    }
  },
  "topologies": 
  {
    "domain0": 
    {
      "type": "unstructured",
      "coordset": "domain0",
      "elements": 
      {
        "shape": "quad",
        "connectivity": [0, 1, 4, 5, 1, 2, 5, 6, 2, 3, 6, 7, 4, 5, 8, 9, 5, 6, 9, 10, 6, 7, 10, 11, 8, 9, 12, 13, 9, 10, 13, 14, 10, 11, 14, 15]
      }
    }
  },
  "materials": 
  {
    "LL": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [1.0, 0.5, 0.0, 0.5, 0.25, 0.0, 0.0, 0.0, 0.0]
    },
    "LR": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [0.0, 0.5, 1.0, 0.0, 0.25, 0.5, 0.0, 0.0, 0.0]
    },
    "UL": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [0.0, 0.0, 0.0, 0.5, 0.25, 0.0, 1.0, 0.5, 0.0]
    },
    "UR": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [0.0, 0.0, 0.0, 0.0, 0.25, 0.5, 0.0, 0.5, 1.0]
    }
  },
  "fields": 
  {
    "temp": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": 
      {
        "LL": [15.0, 15.0, 0.0, 15.0, 15.0, 0.0, 0.0, 0.0, 0.0],
        "LR": [0.0, 5.0, 5.0, 0.0, 5.0, 5.0, 0.0, 0.0, 0.0],
        "UL": [-0.0, -0.0, -0.0, -5.0, -5.0, -0.0, -5.0, -5.0, -0.0],
        "UR": [-0.0, -0.0, -0.0, -0.0, -15.0, -15.0, -0.0, -15.0, -15.0]
      }
    }
  }
}

Multi-Material, Multi-Component Fields

{
  "coordsets": 
  {
    "domain0": 
    {
      "type": "explicit",
      "values": 
      {
        "x": [0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0, 0.0, 0.333333343267441, 0.666666686534882, 1.0],
        "y": [0.0, 0.0, 0.0, 0.0, 0.333333343267441, 0.333333343267441, 0.333333343267441, 0.333333343267441, 0.666666686534882, 0.666666686534882, 0.666666686534882, 0.666666686534882, 1.0, 1.0, 1.0, 1.0]
      }
    }
  },
  "topologies": 
  {
    "domain0": 
    {
      "type": "unstructured",
      "coordset": "domain0",
      "elements": 
      {
        "shape": "quad",
        "connectivity": [0, 1, 4, 5, 1, 2, 5, 6, 2, 3, 6, 7, 4, 5, 8, 9, 5, 6, 9, 10, 6, 7, 10, 11, 8, 9, 12, 13, 9, 10, 13, 14, 10, 11, 14, 15]
      }
    }
  },
  "materials": 
  {
    "L": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [0.0, 0.5, 1.0, 0.0, 0.5, 1.0, 0.0, 0.5, 1.0]
    },
    "R": 
    {
      "type": "scalar",
      "association": "element",
      "topology": "domain0",
      "values": [1.0, 0.5, 0.0, 1.0, 0.5, 0.0, 1.0, 0.5, 0.0]
    }
  },
  "fields": 
  {
    "velo": 
    {
      "type": "vector",
      "association": "element",
      "topology": "domain0",
      "values": 
      {
        "L": 
        {
          "x": [2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0],
          "y": [-2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0]
        },
        "R": 
        {
          "x": [4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0],
          "y": [-4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0]
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants