mlp6 / fem Goto Github PK
View Code? Open in Web Editor NEWFinite Element Modeling (FEM) Code: Python Tools, Field II Intensity Field Solution, LS-DYNA Pre/Post Processing
License: Other
Finite Element Modeling (FEM) Code: Python Tools, Field II Intensity Field Solution, LS-DYNA Pre/Post Processing
License: Other
instead of having to always re-run Field II when using a new mesh, we should have a function that will take an existing 3D Field II intensity output and 3D map it onto a new grid
original attempt at a test failed b/c the py.test.tmdir
fixture created a dynamic path written to the PVD file, so the filecmp.cmp()
operation would fail with the validation data. Need to change the code to not write the entire path to the PSD file, but instead simply the basename of the VTR file.
File "/dscrhome/mlp6/pkgs/fem/post/create_res_sim_mat.py", line 120, in extract_arfi_data
arfidata[j, i, t - 1] = disp_scale * zdisp[nodeid]
IndexError: index 25897041 is out of bounds for axis 0 with size 25897041
Seems to happen all the way back to versions 6.5.x. This error is happening only on a HUGE mesh, so not sure what is going on.
Generating the disp.dat
file from nodout
can take a while, and it would be nice to see progressive output status to know how many timesteps have been completed.
Branch mlp6-thermal
has two files that have hard-coded adaptations for face heating simulations: field2dynaFaceHeating.m
and makeFaceHeating.m
. These could either be incorporated into the existing field2dyna.m
and makeLoadsTemps.m
or simplified to operate as standalone components in a face heating simulation workflow for later combination with the other thermal simulations
The hard-coded transducer dimensions should be revised to read from the probe configuration file.
Extracting data . . .
Writing node positions
Traceback (most recent call last):
File "/home/mlp6/projects/fem/mesh/create_pointloads_vtk.py", line 430, in <module>
main()
File "/home/mlp6/projects/fem/mesh/create_pointloads_vtk.py", line 56, in main
create_vtu(args)
File "/home/mlp6/projects/fem/mesh/create_pointloads_vtk.py", line 136, in create_vtu
numNodes, numElems = writeNodePositions(loadout, args, 'vtu')
File "/home/mlp6/projects/fem/mesh/create_pointloads_vtk.py", line 237, in writeNodePositions
if args.numElem[0] is None:
AttributeError: 'Namespace' object has no attribute 'numElem'
The current extract_dt()
function in create_res_sim
only looks for the DATABASE_NODOUT
keywork field to find the time step increment, but some models only have DATABASE_BINARY_D3PLOT
defined. Would be good to have this be more robust. Either look for both and choose one by default, have the user specify the string to look for, or maybe allow the user to just specify it. ??
from @ndanieley
"impulseResponse":
{
"f0": 4000000.0,
"phase": 0.0,
"bw": 55.0,
"wavetype": "gaussian"
},
I don't use any of those variables in my code, and as far as I can tell, you
don't use them in the matlab code. am I missing something?
Sam discovered that the axial lens correction is also incorrectly being applied in the lateral and elevation dimensions, creating an incorrect offset for the solved fields.
The CLI syntax for this example needs to be update to reflect the explicit choice of PML (--pml
) or NONREFLECT (--nonreflect
) since the latest version does not have a default.
last time step can sometimes be incompletely written; either need to check node count and use only if full, or just ignore the last timestep
The two variables being passed into format are incorrectly put into a tuple, which creates an IndexError
:
fem/examples/tukey_gauss_qsym_pml/run.py
Line 36 in ebe9e1e
These inputs should not be in a tuple!
Attempt to accelerate the post-processing by reading each timestep from nodout
in parallel instead of serially.
examples/
are not being pulled down since they are not importable parts of the package, but then the example files are not available locally for someone to easily copy and use. Would be worth pulling these down for a normal end user to have accessible.
The method currently assumes there is a single magnitude at a single, unique node definition in the point loads file; that is not true when there are multiple load components at a node. I think this will currently overwrite an image plane location with whatever the last component magnitude is in the point loads file.
MatplotlibDeprecationWarning: Adding an axes using the same argument
s as a previous axes currently reuses the earlier instance. In a future version, a new instance will always be created and returned. Meanwhile, this w
arning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
utilize the C version of Field II Pro to run on systems w/o Matlab licenses (but don't drop Matlab support)
getting a strange class error when trying to use linear.m
in place of proprietary probe definitions
been a while since i wrote a git issue so apologies if this isn't the correct formatting
let me know if you want me to submit my version with these changes? n
scale_disp_dat.cpp
doesn't actually use the scaleFactor to scale the displacement data (uses a hard-coded value of 0.1)
In running a mesh that is half-symmetry, and not centered about lat = 0, the following error occurred when trying to create the res_sim.mat
file from disp.dat
:
In [3]: create_res_sim_mat(DYNADECK)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-a01d3b524844> in <module>()
----> 1 create_res_sim_mat(DYNADECK)
~/fem/post/create_res_sim_mat.py in run(dynadeck, disp_comp, disp_scale, ressim, nodedyn, dispout, legacynodes)
40 [snic, axes] = fem_mesh.SortNodeIDs(node_id_coords)
41
---> 42 image_plane = extract_image_plane(snic, axes, ele_pos=0.0)
43
44 header = read_header(dispout)
~/fem/post/create_res_sim_mat.py in extract_image_plane(snic, axes, ele_pos)
196
197 ele0 = np.min(np.where(axes[0] >= ele_pos))
--> 198 image_plane = np.squeeze(snic[ele0, :, :]).astype(int)
199
200 return image_plane
ValueError: Can't cast from structure to non-structure, except if the structure only has a single field.
create_res_sim
currently extracts all timesteps... would be nice to limit this if a user just needs some or a sparse set for memory concerns, etc. might be a feature to enable in combinations with issue #83
Getting the following compilation error:
$ make
gcc -I . -I /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library checkOnAxis.o checkUniform.o correctAxialLens.o dynaField.o dynaWrite.o field2dyna.o gaussPulse.o readMpn.o main.c cJSON.c /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a -lpthread -lm -O
main.c:8:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
main()
^~~~
/usr/bin/x86_64-linux-gnu-ld: field2dyna.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: gaussPulse.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: readMpn.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(field_II_main.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(transducers.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(calculations_par.o): relocation R_X86_64_32 against symbol `calc_scat_call' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(general.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(thread_lib.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(calculations.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(triangles.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: /home/mlp6/Documents/MATLAB/Field_II_Pro/c_library/lib_Field_II.a(lines.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:5: recipe for target 'main' failed
make: *** [main] Error 1
@ndanieley did you hit any errors like this?
associated with PR #51
make: *** No rule to make target create_disp_dat_wrap.c
, needed by _create_disp_dat.so
. Stop.
Need to find a way to automatically build the SWIG module... maybe setup.py
?
Time indices for Start/Stop Index are hard-coded to +/- 400 ns, causing errors for very low frequencies probes. Need to more elegantly code these limits.
Line 51 in 390797f
Some files (vf105) in the ultrasound/probes
repository use FIELD_PARAMS.focus_m
instead of FIELD_PARAMS.focus
. Change one to be in concordance with the other?
currently this method is called multiple times when different components of displacement have to be extracted; would be nice to just pass a vector of the components to extract
we don't need the full dynamic range of double-precision numbers, which are eating up a lot of extra space; will convert to single-precision floats with truncates range
@ndanieley isn't sure what this should be returning and why it appears to be returning nothing (see the fieldC
branch code review in progress)
create_disp_dat.py
can create the binary data file and the VTK-formatted displacement file from a raw nodout
file, but disp.dat
files cannot be directly converted to VTK format.
Need to add the ability to offset an excitation from the "center" (x = 0
and y = 0
) of a probe.
formatExpImpResp.c:5:28: fatal error: gsl/gsl_interp.h: No such file or directory
#include <gsl/gsl_interp.h>
This error was on durmstrang
.
Utilize a try/except
structure to attempt to import the SWIG create_disp_dat
, and default to python implementation if it fails.
Memory usage in my tests is high, even when running single-threaded, which usually is not a memory hog. This memory usage also seems to grow, so this isn't something static that is preallocated.
Need to profile this is more detail.
legacy mess of code; use common module that can then write loads or temps
Including the *DATABASE_TPRINT card in the .dyn file that controls the simulation results in temperatures at each node being output for the timestep specified. A program should be written to parse this output and export it into a .mat file. The program should have the option of selecting the entire node set temperature data for exporting, or just exporting the data associated with a desired face of the simulated volume.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.