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

Fixed DOF 0 bug & removed useless memcpy #104

Merged
merged 1 commit into from
Sep 26, 2022
Merged

Fixed DOF 0 bug & removed useless memcpy #104

merged 1 commit into from
Sep 26, 2022

Conversation

boris-martin
Copy link
Collaborator

@boris-martin boris-martin commented Aug 10, 2022

Content

This PR seems to fix #86
Following a suggestion from Matthias Freimuth, I removed a memcpy statement that seems to fixe the bug. Extensive testing is needed to ensure nothing else is broken. For the record, I am absolutely clueless as to 1) why removing this line fixes the bug 2) what was the purpose of it at first. So, mostly empirical stuff.

In my opinion, three things should be checked:

@KyleDavisSA any idea what's happening here ?

Checklist

On my side:

Fixing the bug?

Non-regression

  • Does the perpendicular flap work as before ?
  • Does the heat exchanger work as before ?
  • Does the elastic-tube-3d work as before ?
  • Does the flow over heated plate work as before ?
  • Does the partitioned beam work as before ?

Memory checks

Nothing done so far.

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't understand what this line is for. I suspect it was a leftover from early development, more of a "safety measure" before replacing the vold values in the upcoming read. It does look useless to me with my very limited understanding. I assume that something is wrong with the sizes, and I would not be surprised if this is a Fortran/C interoperability issue (in Fortran, indices start from 1, in C from 0). memcpy is very unsafe, but I don't think we have better options here.

Running the perpendicular flap case does seem to trigger this part of the code (I added a printf to quickly check), and the result files are identical.

I would say let's merge and wait for complaints. And definitely inform the people that reported this before (also on Discourse).

I found the same operation commented-out on line 3934:

That one was there since the beginning, and commented-out by @KyleDavisSA when he upgraded to v2.16: git blame old state (line 960), git blame new state (line 1190). I understand that then he moved it to https://github.com/precice/calculix-adapter/blame/a02ff512d12f5ceb57a39aaca3c839258547600b/nonlingeo_precice.c#L3457 (but I may misunderstand this step of the adapter evolution).

@MakisH
Copy link
Member

MakisH commented Sep 23, 2022

@MatthiasFreimuth could you please help us understand this bugfix?

@boris-martin the "Does the partitioned beam work as before ?" box is still unticked. Does this mean you still want to test it, or that you saw issues?

If you say that this already fixed some known cases and it does not break others, let's merge it.

@boris-martin
Copy link
Collaborator Author

I didn't test it yet. But given the good results on other cases I don't expect any issue.

@boris-martin boris-martin merged commit 0bbf2f0 into develop Sep 26, 2022
boris-martin added a commit that referenced this pull request Nov 17, 2022
* Improved error message (for missing mesh) (#88)

* Added error message for missing faces mesh
* Improved error message for missing nodes mesh

* 2D simulations major overhaul (#92)

Fixed 2D simulations being unusable with Temperature BC. Arbitrary number of elements on the Z-axis is now allowed and handled assuming data independant of the Z-axis.

* Added Pressure ExchangeData, hexaedral elements and Modal Dynamic Modus (#91)

* Added Pressure ExchangeData, hexaedral elements and Modal Dynamic Modus

* Update dyna_precice.c

Co-authored-by: Matthias Freimuth <matzefreim@gmail.com>
Co-authored-by: Boris Martin <84379125+boris-martin@users.noreply.github.com>

* format

* Added warning of broken implicit coupling when using modal dynamic simulations

* Fixed mesh configuration 2D coupling with Face meshes (#94)

* Fixed mesh config for face mesh

* Removed dead code

* Fixed missing include

* Fixed crash when using face meshes and element IDs don't start to 0 (#95)

* Fixed crashing simulation when using face meshes and element IDs don't start to 0

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Update adapter/CCXHelpers.h

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* format

* reverted fallow-argument-mismatch

* format

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Revert "Fixed crash when using face meshes and element IDs don't start to 0 (#95)" (#96)

This reverts commit 9cfc0cf.

* Update packaging script to Ubuntu 22.04 LTS (#98)

* added ubuntu 22.04 to the list of OSes in Github action

* updated to 2 Ubuntu LTS only, added fflags

* fixed wrong distribution name

* added preivous Ubuntu non-LTS

* fixd missing os

* typo

* removed non LTS

* Fixed face mesh config(correct PR) (#97)

* Fixed crashing simulation when using face meshes and element IDs don't start to 0

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Typo

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* Update adapter/CCXHelpers.h

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>

* format

* format

* restored script

* Fixed implicit coupling in modal dynamic simulation. (#99)

* Fixed missing checkpointing

* fixed extra output in implicit coupling

* removed deprecated warnings

* Fixed crash when freeing unused pointers (#102)

* init NULL pointers

* Enable Static Step for FSI (#101)

* Update ccx_2.19.c

Enable basic Static Step

* Update ccx_2.19.c

* Update ccx_2.19.c

* Add error messages when reading invalid data in modal dynamic simulations (#103)

* registering modal dynamic

* added forbidden reading types to modal dynamic sims

* added actual error

* Update adapter/PreciceInterface.c

Co-authored-by: Gerasimos Chourdakis <makishourdakis@gmail.com>

* Update adapter/PreciceInterface.h

Co-authored-by: Gerasimos Chourdakis <makishourdakis@gmail.com>

Co-authored-by: Gerasimos Chourdakis <makishourdakis@gmail.com>

* basic infrastructure for proper checkpointingin dyna_precice

* seemingly working implict + subcycling modal dynamic simulations

* Prototype output buffer

* added C API

* added missing function

* improved Buffer

* Actual usage of the buffer, seemingly working

* added short description of the buffer mechanism

* cleanup

* refactoring

* format

* removed dead code

* renamed for consistency

* no longer asking for length when loading data

* cleanup

* documentation

* removed apparently useless memcpy (#104)

* Make read/write data name parsing consistent (#108)

* Update for CalculiX v2.20 (#109)

Co-authored-by: Boris Martin <84379125+boris-martin@users.noreply.github.com>
Co-authored-by: MatthiasFreimuth <34025080+MatthiasFreimuth@users.noreply.github.com>
Co-authored-by: Matthias Freimuth <matzefreim@gmail.com>
Co-authored-by: Boris Martin <boris.martin.be@gmail.com>
Co-authored-by: Ishaan Desai <ishaandesai@gmail.com>
Co-authored-by: Kyle Davis <kyle.davis@ipvs.uni-stuttgart.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants