Giter VIP home page Giter VIP logo

mudic's People

Contributors

polymerguy avatar rubsal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mudic's Issues

doc on `muDIC.vlab.rosta_speckle`

in the docstring says the dot size is int bounded by 0 and 1 but the default value is 4!!!

 Parameters
 ----------

 size : tuple
     The image size as a tuple of integers
 dot_size : int
     The size of the dots [0,1]
 density: float, int
    How packeg with dots the speckle should be
 smoothness: float, int
    The degree of smoothing applied to the binary speckle

Error matplotlib.widget.RectangleSelector with while appling mesh on image stack

Hi!
This toolkit looks amazing!

I have seen that simmilar issues have already been reported, but to support the quicker solvation of the problem I make a new issue.
I have tried to go through the quick start guide which is super nice to have, I have encountered the following error message, which is in my knowledge is due to that the used matplotlib.widget.RectangleSelector has changed and thats why it displays a problem.
Could it be the problem?
If yes, would you please solve thees problems?

Kind regards!
PS1

Possible to measure displacement at one point with µDIC?

I am a bit new to DIC and have a question if it is possible to measure the displacement at a single point on a structure. The video below show the compliant mechanism that I would like to test. I want to measure the horizontal displacement at the end of the middle section. Is this possible with µDIC (of course with a better videoJ)?

TestCompMech

Stereoscopic vision

In order to be able to observe the displacement of the sample out of plane (2D), I would like to use openCV to also work in the depth of the image. For that I think to proceed in 3 steps:

  1. Camera calibration
  2. Perform depth measurements
  3. Use these depth measurements with muDIC to determine the out-of-plane displacement of subsets in muDIC
    Do you think that is relevant ? useful?

Handling convergence issues more gracefully

Until now, lack of convergence triggers a reference update and a retry. If this does not help, the solver aborts.

We should allow for lack of convergence as this might be a temporary problem and convergence can be obtained a few frames later.

Suggestion:

  • Add a "no_convergence_action" setting which can be set to "update", "ignore" or "break".

DIC challenge data as tutorials and tests

The "DIC challenge" from the SEM (Society of Experimental Mechanics) community should be included as a demo and a part of the test suite. This could also be included as excellent tutorials.
The datasets are found here: https://sem.org/dicchallenge
And their paper with initial results are found here: https://link.springer.com/article/10.1007/s11340-017-0349-0

Suggestion:

  • Add the analyses as demo-files complete with a comparison to the "correct" values
  • Include these files as tutorials in the docs
  • Include these files as a part of the test-suite

Field displaying in the visualizer

While plotting the analysis results with the visualizer included in the toolkit neither the field nor the component selected are shown.
It would be helpful if the code could display the plotted field and component, together with the frame number.

DICAnalysis stops before the end

Hello @PolymerGuy and muDIC users !

I have written a little Python script to use muDIC's functions for my needs. I am simply following the tutorial; but I have added a way to manually define the mesh (without the GUI) and keep only desired images.

However, when I run a DICAnalysis job, it often happens that the routine stops before going through the whole image stack.

I have checked that the parameters I have given to the DICInput object are noconverge="ignore" and max_nr_im=None (default). If I understand the code correctly, when max_nr_im=None, its value should be set to the length of the image stack. So I do not understand why the DICAnalysis job stops sooner than expected.

Attached are my Python script compute_DIC.txt and its output.txt. In this example, the length of image stack was 720, but only the first 95 images were analyzed.

Note : I can not send a .py file on GitHub, so I sent a txt file. A screenshot of the first part of the script is also compute_DIC.

If you have any idea why the job stops, I would really appreciate your help.

Have a nice day

Hello blogger

Hello blogger, your results are very great. Is there any relevant video tutorial or more detailed text explanation about the use of MuDIC? Looking forward to your reply, thank you.

Faster reference updates

The reference updates are rathet slow and the scaling with respect to the number of nodes is not as good as it could have been. Usually not a problem when few contol points and higher order shape functions are used

Strain calulculation in µDIC

Continuing from here: #24 (comment).

For the sake of future development, we should decide on a baseline for how the strains are calculated in µDIC.

I propose the methodology found in this document: Strain_calulations_in_DIC.pdf

The plan is to later merge it into the documentation.

I am working on code which strictly follows this methodology and uses a minimum of "back and forth" calculations, but due to time constraints, it's not ready for review yet.

@illyasst and @diehlpk, I would love your feedback on this!

Subset support

Subsets are very handy and could realy increase the generality of the toolkit.

DIC for large strain measurements

Hi, I am currently trying to implement µDIC for determination of strain during large-deformation tests. I noticed that the vertical mesh size is constant for the entire measurement. Would there be a way to increase the mesh height or make it variable with each frame?

A fast Q4 finite element formulation

We need to have a classical Q4 finite element formulation which can handle arbitrary meshes, is very fast and easy to use.

Suggestion:

  • Q4 support only
  • Direct inversion of the shape functions when updating references
  • Should support a standard mesh format such as .msh?
  • Visualization should utilize only the data at the centre of the elements and interpolate across boundaries using splines?

Mesher didn't display the GUI

thanks u for bring this amazing DIC tools. But when I try to use the example code provided and obey all the procedures u mentioned in the tutorial, the masher GUI didn't show.

I can't interact with the GUI ,which was mentioned can use arrow-keys to add/delete the feature points .

can u please provided more guide. We will be very appreciate for u .

The example can not work properly

Hello, thanks for the contribution to this excellent tool.
I am trying to run the example code, but it can not work.
Is the reason that the version of the used python package is various? If that's true, could you share the proper version of the related python package?

image
image


LinAlgError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_23104\955196646.py in
8 settings = dic.DICInput(mesh,images)
9 job = dic.DICAnalysis(settings)
---> 10 dic_results = job.run()
11
12 fields = dic.Fields(dic_results)

D:\software\anaconda3\envs\muDIC1\lib\site-packages\muDIC\solver\correlate.py in run(self)
373
374 """
--> 375 node_x, node_y, reference_stack, Ic_stack = self.solve()
376
377 return DICOutput(node_x, node_y, self.input, ref_stack=reference_stack, Ic_stack=Ic_stack)

D:\software\anaconda3\envs\muDIC1\lib\site-packages\muDIC\solver\correlate.py in solve(self)
388 else:
389 node_position, reference_stack, Ic_Stack = correlate(self.input, correlate_img_to_ref_q4,
--> 390 generate_reference_Q4)
391
392 # TODO: Remove the need of transposing the matrices

D:\software\anaconda3\envs\muDIC1\lib\site-packages\muDIC\solver\correlate.py in correlate(inputs, correlator, reference_gen)
182 node_position_t.append(node_coords)
183
--> 184 reference = gen_ref(node_coords, mesh, images[0], settings, image_id=0)
185
186 # Correlate the image frames

D:\software\anaconda3\envs\muDIC1\lib\site-packages\muDIC\solver\reference_q4.py in generate_reference_Q4(node_coords, mesh, im, settings, norm, image_id)
139
140
--> 141 K = np.linalg.inv(K)
142
143 # TODO: Fill in the rest

<array_function internals> in inv(*args, **kwargs)

D:\software\anaconda3\envs\muDIC1\lib\site-packages\numpy\linalg\linalg.py in inv(a)
543 signature = 'D->D' if isComplexType(t) else 'd->d'
544 extobj = get_linalg_error_extobj(_raise_linalgerror_singular)
--> 545 ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
546 return wrap(ainv.astype(result_t, copy=False))
547

D:\software\anaconda3\envs\muDIC1\lib\site-packages\numpy\linalg\linalg.py in _raise_linalgerror_singular(err, flag)
86
87 def _raise_linalgerror_singular(err, flag):
---> 88 raise LinAlgError("Singular matrix")
89
90 def _raise_linalgerror_nonposdef(err, flag):

LinAlgError: Singular matrix

API documentation

Add API documentation, preferably by using the builtins of sphinx

It does not generate data

Hello,
I want to learn how to use the program. I have downloaded the notebooks and it does not give me any error,
but when doing the test with the examples, the system does not return data

image

this is the only thing it does.

It won't let me draw the mesh

Mesher not working

I tried to run the example code given for the images. But the Mesher doesnot produce any meshes.

TypeError: __init__() got an unexpected keyword argument 'drawtype'

Hello,
I have tried running this with multiple installations of Python, 3.7, 3.8, and 3.11. Every time I always get to the same point, where upon running mesh = mesher.mesh(image_stack), I get the error TypeError: __init__() got an unexpected keyword argument 'drawtype'.

Please let me know if I am doing anything wrong, or if this is a bug!

Computing the Lagrangian strain

Hello @PolymerGuy ,

First of all, thanks for the great work, this is the first global/FE DIC code that I ever found written in proper python !

I am interested in implementing the Lagrangian strain formulation to this code. I tried doing so, but I am a little bit confused by how I could do so. To determine how I could so, I have looked at the _green_strain_() static method from the Fields class (in /post/viz.py) to try to determine how you computed the Green strain but that's where I got a little bit confused.
Could you please help me understand how the computation for the Green strain works ?

    @staticmethod
    def _green_strain_(F):
        """
        Calculate Green strain tensor from F as G = 0.5*(F^T + F -I)
        :param F: Deformation gradient tensor F_ij on the form [nEl,i,j,...]
        :return: Green Lagrange strain tensor E_ij on the form [nEl,i,j,...]
        """
        E11 = 0.5 * (F[:, 0, 0, :, :, :] ** 2. + F[:, 0, 1, :, :, :] ** 2. - 1.)

        E12 = 0.5 * (F[:, 0, 0, :, :, :] * F[:, 1, 0, :, :, :] + F[:, 0, 1, :, :, :] * F[:, 1, 1, :, :, :])

        E22 = 0.5 * (F[:, 1, 0, :, :, :] ** 2. + F[:, 1, 1, :, :, :] ** 2. - 1.)

        E = np.array([[E11, E12], [E12, E22]])

        E[E == np.nan] = 0.

        return np.moveaxis(E, 2, 0)

Thank you,
ilyass

Settings for visualization of field data

Making changes to colourmaps, limit values etc. should be made much easier.

Suggestion:

  • Include **kwargs in the method for "show data" and let them propagate directly into the call to matplotlib.

  • Add the settings to the visualizer object. I suspect this will be less practical in real life...

getting singular matrix


LinAlgError Traceback (most recent call last)
in <cell line: 3>()
1 import scipy.linalg as la
2 dic_job = dic.DICAnalysis(inputs)
----> 3 results = dic_job.run()

6 frames
/usr/local/lib/python3.10/dist-packages/numpy/linalg/linalg.py in _raise_linalgerror_singular(err, flag)
87
88 def _raise_linalgerror_singular(err, flag):
---> 89 raise LinAlgError("Singular matrix")
90
91 def _raise_linalgerror_nonposdef(err, flag):

LinAlgError: Singular matrix

Installation fails on Fedora 32 due to old scipy version

Description
Installation of muDIC fails on Fedora 32 do to compilation errors of scipy 1.2.1. Using GCC version 10 a Rank mismatch in Fortran code causes an error.

System

  • Fedora 32
  • Kernel version 5.10.20-100.fc32.x86_64
  • gcc 10.2.1 20201125

Error Message

gfortran:f77: /tmp/pip-install-sc4s_4iu/scipy_1c0e5b6a7f804c2d829fb4f592fd2acd/scipy/_build_utils/src/wrap_dummy_g77_abi.f
    error: Command "/usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops -Iscipy/sparse/linalg/eigen/arpack/ARPACK/SRC -I/home/jritter/.virtualenvs/inscomex/lib/python3.8/site-packages/numpy/core/include -Ibuild/src.linux-x86_64-3.8/numpy/distutils/include -c -c scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/cnaup2.f -o build/temp.linux-x86_64-3.8/scipy/sparse/linalg/eigen/arpack/ARPACK/SRC/cnaup2.o" failed with exit status 1

This is likely thrown by following compilation erros:

Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)

Possible solution
Make use of a newer scipy version (see here).

Is it possible to just update the scipy version in setup.py?

Best
Jonas

[feature] Ability to easily save files from viz

Current behaviour:
Currently, the function viz.show is the main method provided to show contour plots of the field to the user.

Proposed behaviour:
An additional flag in viz.show can be used to save files to a specified location. This will easily allow a used to either show (None) or save (path) results depending of the value of this flag.

I will submit a PR for this feature shortly.

Region of interest coordinates selection without GUI

The Region of Interest identification without using the GUI requires the input of the specimen edges coordinates. For this purpose the point 1 (upper left) and 2 (bottom right) coordinates have to be specified while calling the mesher. The y coordinates might be inversed, meaning that the solver can successfully complete the analysis only if the relation Yc2>Yc1 is verified. This can be verified only if Yc1 is the y coordinate of the bottom right point and consequently Yc2 identifies the top left edge.
The code should identify with Yc1 the y coordinate of the upper left point and with Yc2 the y coordinate of the bottom right edge, instead of considering Yc1 the coordinate of the bottom right edge and Yc2 the coordinate of the upper left edge.

Image Format

Is it possible to use the code for .jog images?

no convergence and rule of thumbs for dic settings

Hi, first of all thanks for this awesome library. I found this library after reading your paper of 2020.

I have a couple of questions that I hope can be answered:

  • A good guess for initial mesh is 40x40 pixels. if We have a big specimen this is a very fine mesh and could take long time for computation of correlation. I suppose that of course this number actually depends on the size of the speckle pattern and the size of the specimen. I have the feeling that somehow in a finite element there should be some points of the speck, am I correct?
  • What is an indicative rule for how many images are needed? Specifically I have a movie, so I was just try to understand if I need to process one every 10 frames, 30 frames, each frame or other. I'm afraid that using lots of frames doesn't improve the accuracy of the results. Do you have any indication about that?
  • What is the general rule-of-thumb for definition of frames for reference update?
  • Is it possible to build non rectangular meshes? For instance my ROI is L shaped, up to know I am selecting one rectangle where my phenomena happens.
  • In the example I'm trying to do I never reach convergence. Each frame is computed up to the maximum number of iteration... I tried processing a huge amount of images (one frame of the movie every 5 frames, so basically 6 frames each second).
  • Is it possible to think about a parallelization of parts of the process? as far as I understand each frame is correlated with the same reference. By default this reference changes once in a while, unless update after no convergence is considered. Except for this last case a think the process can be parallelized to improve speed of computation. Do you think it may be possible?

Bests
Diego

No convergence with 10% strain

I'm unable to make a convergence using to attached images. The second image is a 110% zoom of the first one.
Small zoom values (101..103%) work perfectly and strain measurement is quite accurate!

Is the displacement / strain too big ?

0V
0V_enlarged_1 10

A more general mesher

The mesher is simplistic in it current state and a more general mesher would be handy

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.