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

Implementing proper treatment of vector valued data #32

Closed
wants to merge 7 commits into from

Conversation

BenjaminRodenberg
Copy link
Member

For testing of the functionality use the structure-structure coupling tutorial proposed in precice/tutorials#27. This PR closes #26 if merged.

What we currently have

Do RBF interpolation on every component of vector field.

elif self.isVectorValues():
f = Rbf(self._coords_x, self._coords_y, self._vals[:,dim_no].flatten()) # extract dim_no element of each vector

called in eval

def eval(self, value, x): # overloaded function
"""
Overrides UserExpression.eval(). Called by Expression(x_coord). handles
scalar- and vector-valued functions evaluation.
"""
for i in range(self._vals.ndim):
value[i] = self.rbf_interpol(x,i)

Check case SCALAR and VECTOR

New functions implemented. Can be used to determine whether vector or scalar data has to be communicated via preCICE

if self.function_type(write_field) is FunctionType.SCALAR: #write_field.value_rank() == 0:
self._interface.write_block_scalar_data(self._write_data_id, self._n_vertices, self._vertex_ids, self._write_data)
elif self.function_type(write_field) is FunctionType.VECTOR:
self._interface.write_block_vector_data(self._write_data_id, self._n_vertices, self._vertex_ids, self._write_data.ravel())

Tested read_block_vector_data and write_block_vector_data

Open ToDo's

@BenjaminRodenberg BenjaminRodenberg added enhancement New feature or request student labels Apr 10, 2019
@BenjaminRodenberg BenjaminRodenberg self-assigned this Apr 10, 2019
@BenjaminRodenberg
Copy link
Member Author

BenjaminRodenberg commented Oct 18, 2019

I think that this PR is pretty much addressed by the current featureset on master. @IshaanDesai can you check it and close the PR (and issue #26), if everything is fine?

@IshaanDesai
Copy link
Member

Implementation of treatment of vector valued data is already being handled in #47 and #46 according to the newer code design of the adapter. Merging this PR is of no significance due to significant changes in the adapter design. Tutorial case: precice/tutorials#27 will be handled at a later point of time as indicated in the comments there.

@BenjaminRodenberg BenjaminRodenberg deleted the vector branch October 24, 2019 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request student
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of vector-valued coupling data
3 participants