MAXWtFld on ComponentNeBEM3d

Hello,

I was simulating a MWPC with crossed wire planes using the ComponentNeBEM3d and realized there was a coded limit on the number of weighting fields (#define MAXWtFld 11 in neBEM.h). Is there an underlying reason for this other than performance issues, or can I safely increase this number? It would be very helpful I were able to use something other than a FEM solver for this particular application.

Sincerely,
Gabriel

I guess @hschindl can help you.

Hi, sorry for the late reply! You can safely increase the value, it will just increase the memory footprint a bit.

Thank you for your answer, I’m very glad to hear that.

I tried increasing the number but now I’m getting segmentation faults when MAXWtFld > 56, even though there doesn’t seem to be a large memory allocation involved when MAXWtFld == 56. I rebuilt Garfield with the -g flag and the debugger tells me that the segfault comes from incrementing the m_wfields std::map:

ComponentNeBem3d::Initialise:
    Prepared weighting field for readout group "wire0".
1625          m_wfields[label] = id;
(gdb) 

Thread 1 "forum" received signal SIGSEGV, Segmentation fault.
0x00007ffff52c658e in std::_Rb_tree_decrement(std::_Rb_tree_node_base*) () from /lib/x86_64-linux-gnu/libstdc++.so.6

I’ve attached a short example that reproduces the error for me after editing the neBEM.h header. The segfault occurs for me even if there is only one labeled primitive (size_t nWire = 1). Please let me know if you can’t reproduce it.

forum.cpp (1.7 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.