Skip to content

Expose mid-level functions to user #37

@BenjaminRodenberg

Description

@BenjaminRodenberg

The fenics-adapter offers a very high level interface. This allows to have minimal code changes in existing examples (see heat.py), but also limits the user. The following functions can wrap preCICE functionality, while allowing the user to access preCICE at a low level:

def read_block_scalar_data(self._read_data_id, mesh, V):
    precice.read_block_scalar_data(self._read_data_id, self._n_vertices, self._vertex_ids, self._read_data)
    # read_data -> CustomExpression
    return CustomExpression

def write_block_scalar_data(self._write_data_id, u):
    # u -> write_data
    precice.write_block_scalar_data(self._write_data_id, self._n_vertices, self._vertex_ids, self._write_data)

def set_mesh(mesh, SubDomain: coupling_boundary):
    precice.setMeshEdge(...)
    precice.setMeshVertices(...)

#preprocessing

mesh = UnitSquareMesh(10, 10)
m_f = MeshFunction(size_t, mesh, 1)
subdomain.mark(m_f, marker)

def set_mesh(mesh, int: marker, m_f):
    # mesh, marker, m_f ->  coupling_mesh_vertices, n_vertices
    precice.setMeshEdge(...)
    precice.setMeshVertices(...)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions