Giter Club home page Giter Club logo

Comments (6)

uekerman avatar uekerman commented on August 12, 2024

I changed the name of the issue. Did I get it right, is that what you want to do?

What do you mean by?

... but actually there is no difference in the body of these functions, hence it does not help.

from fenics-adapter.

RafalKulaga avatar RafalKulaga commented on August 12, 2024

Yes.

I should now refer to precice.pyx functions and not PySolverInterface due to #25. I just mean that simple changing from e.g. write_block_scalar_data() to write_block_vector_data() in fenicsadapter.py does not help. Using vector-valued functions yields the same error in both cases. This is understandable as the implementation of "scalar" and "vector" version of read and write does not differ (it is the same code). Please compare
https://github.com/precice/precice/blob/develop/src/precice/bindings/python/precice.pyx#L259-L281 and https://github.com/precice/precice/blob/develop/src/precice/bindings/python/precice.pyx#L300-L322

I will push the draft of structural solver, so the error (TypeError: only size-1 arrays can be converted to Python scalars) can be reproduced.

from fenics-adapter.

uekerman avatar uekerman commented on August 12, 2024

This is understandable as the implementation of "scalar" and "vector" version of read and write does not differ (it is the same code)

Well, it does call two different preCICE methods that do different things. Probably, I understand better what you mean when you push the draft of the structural solver.

Also for the vector-valued case: len(value_indices) != len(values).

Still values needs to be one-dimensional array (of size numberOfVertices times dimensions). Maybe you are looking for the method ravel ?

from fenics-adapter.

RafalKulaga avatar RafalKulaga commented on August 12, 2024

@uekerman Thanks, I did not know that it must be one-dim array. Using ravel helped, but just to make sure: from [ [u1, v1], [u2, v2] ...] form we want [ u1, v1, u2, v2, ...] and not [ u1, u2, ... v1, v2, ... ], right?

The issue cannot be closed yet though, there are further modifications in fenicsadapter.py required.

from fenics-adapter.

uekerman avatar uekerman commented on August 12, 2024

but just to make sure: from [ [u1, v1], [u2, v2] ...] form we want [ u1, v1, u2, v2, ...] and not [ u1, u2, ... v1, v2, ... ], right?

Exactly! See also the API documentation

from fenics-adapter.

BenjaminRodenberg avatar BenjaminRodenberg commented on August 12, 2024

Closed. Vector valued data is supported since #38 has been merged.

from fenics-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.