8000 Model direct access and just-in-time mapping in schema · Issue #31 · precice/preeco-orga · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Model direct access and just-in-time mapping in schema #31
Open
@uekerman

Description

@uekerman

There are (now) two distinct ways how to interact with meshes and data in preCICE: provide coordinates or directly access received meshes (potentially via just-in-time mapping).

<participant name="P">
  <receive-mesh name="Received-Mesh" from="OtherP" direct-access="true" />
  <write-data name="Write-Data" mesh="Received-Mesh" />
  <provide-mesh name="Provided-Mesh" />
  <read-data name="Read-Data" mesh="Provided-Mesh" />
</participant>

We are currently discussing to rename direct-access to api-access.

We also need a way to distinguish both options in adapter code.

Either:

vertex_ids = participant.set_mesh_vertices("Provided-Mesh", locations)
data = participant.read_data("Provided-Mesh", "Read-Data", vertex_ids, dt)
participant.write_data("Provided-Mesh", "Write-Data", vertex_ids, data)

Or:

precice.set_mesh_access_region("Received-Mesh", bounding_b
5CAD
ox);
precice.get_mesh_vertex_ids_and_coordinates("Received-Mesh", vertex_ids, coordinates);
data = participant.read_data("Received-Mesh", "Read-Data", vertex_ids, dt)
participant.map_and_write_data("Received-Mesh", "Write-Data", vertex_ids, data, location)

There are different ways we could do this:

1. With an is_received option in the adapter config defaulting to "false":

  "interfaces": [
    {
      "mesh_name": "Received-Mesh",
      "is_received": true,  
      "read_data_names": [ ... ],
      "write_data_names": [ ... ]      
    },
    {
      "mesh_name": "Provided-Mesh",
      "read_data_names": [ ... ],
      "write_data_names": [ ... ]      
    },
  ]

Instead of is_received, we could, obviously, do is_provided.

Or some enum: mesh_locations = {received or provided}. We use location currently to distinguish between nodes/centers or surface/volume. Is there a better name?

2. With a new API function:

  • participant.is_mesh_received("Mesh") or
  • participant.is_mesh_access_region_required("Mesh") or
  • participant.requiresCoordinates("Mesh")

Metadata

Metadata

Assignees

Labels

schemaRelated to the adapter config schema

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0