Hi, I can run the COMSOL examples from garfield++ official website. But then i try to load myself build mesh/field from COMSOL. It failed and with the error as titled.
Hi @spencer2023,
thanks for reaching out! It is not clear to me whether your issue is ROOT related or not, can you provide a small code snipped of what you’re trying to do?
Cheers,
Monica
Hi,
there should be some more output from ComponentComsol preceding this error message. Can you post the full log?
@hschindl @mdessole
I just try to verify the loading process. See the code as below.
#include
#include
#include
#include <TApplication.h>
#include <TCanvas.h>
#include <TH1F.h>
#include “Garfield/ComponentComsol.hh”
#include “Garfield/ViewField.hh”
#include “Garfield/ViewFEMesh.hh”
#include “Garfield/MediumMagboltz.hh”
#include “Garfield/Sensor.hh”
#include “Garfield/AvalancheMicroscopic.hh”
#include “Garfield/AvalancheMC.hh”
#include “Garfield/Random.hh”
using namespace Garfield;
int main(int argc, char * argv) {
TApplication app(“app”, &argc, argv);
// Load the field map.
ComponentComsol fm;
fm.Initialise(“mesh.mphtxt”, “dielectrics.dat”, “field.txt”, “mm”);
fm.EnableMirrorPeriodicityX();
fm.EnableMirrorPeriodicityY();
fm.PrintRange();
}
Full log:
ComponentComsol::Initialise: 13004 nodes.
ComponentComsol::Initialise:
Error parsing mesh.mphtxt.
ComponentComsol::UpdatePeriodicityCommon:
Field map not yet initialised.
ComponentComsol::UpdatePeriodicityCommon:
Field map not yet initialised.
ComponentComsol::PrintRange:
Dimensions of the elementary block
0 < x < 0 cm,
0 < y < 0 cm,
0 < z < 0 cm,
0 < V < 0 V.
Periodicities
x: mirror with length 0 cm
y: mirror with length 0 cm
z: none
Looks like ComponentComsol encountered a problem reading your mesh.mphtxt file. Maybe it’s in a different format than the one expected by ComponentComsol (second-order tetrahedra)?
@djjansse have you come across this Comsol error message (“Undefined material property ‘epsilon’ …”)?
Dear @spencer2023,
On the point of relative permittivity, I believe I have reproduced your case, showing me the same message. You need to provide a relative permittivity to all your materials to be able to solve the system. An example is given in the attached image.
As @hschindl mentioned, the mesh needs to be comprised of second-order tetrahedral elements. Depending on the version of COMSOL you are using, exporting the mesh can be done by right-clicking the mesh object and selecting the export option. Then, you must enable the “export as second-order elements” before writing the .mphtxt file.
I hope this helps.
Kind regards,
Djunes
Yes. I did find similar case and follow that instruction. But it does not work.
All relative permittivity value have been filled. But not help. Version is 6.2. Build 290

