Skip to content

Commit 7e4d76a

Browse files
committed
FEMesher derived classes no longer take object's in their constructor. Instead, the object is passed when calling BuildMesh. This was done to solve a problem when meshers are allocated through the kernel. Also fixed bug in GTruncatedEllipsoid::Create which caused a crash.
1 parent 3cde6df commit 7e4d76a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+360
-371
lines changed

FEBioStudio/MeshPanel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class CPrimitiveMesherProps : public CObjectProps
9797
}
9898
else if ((val == 1) && (dynamic_cast<FETetGenMesher*>(mesher) == nullptr))
9999
{
100-
m_po->SetFEMesher(new FETetGenMesher(m_po));
100+
m_po->SetFEMesher(new FETetGenMesher());
101101
BuildParameterList();
102102
SetModified(true);
103103
}
@@ -147,19 +147,19 @@ class CSurfaceMesherProps : public CObjectProps
147147
int val = v.toInt();
148148
if ((val == 0) && (dynamic_cast<FETetGenMesher*>(mesher) == nullptr))
149149
{
150-
m_pso->SetFEMesher(new FETetGenMesher(m_pso));
150+
m_pso->SetFEMesher(new FETetGenMesher());
151151
BuildParamList(m_pso->GetFEMesher());
152152
SetModified(true);
153153
}
154154
else if ((val == 1) && (dynamic_cast<NetGenSTLMesher*>(mesher) == nullptr))
155155
{
156-
m_pso->SetFEMesher(new NetGenSTLMesher(m_pso));
156+
m_pso->SetFEMesher(new NetGenSTLMesher());
157157
BuildParamList(m_pso->GetFEMesher());
158158
SetModified(true);
159159
}
160160
else if (dynamic_cast<FEShellMesher*>(mesher) == nullptr)
161161
{
162-
m_pso->SetFEMesher(new FEShellMesher(m_pso));
162+
m_pso->SetFEMesher(new FEShellMesher());
163163
BuildParamList(m_pso->GetFEMesher());
164164
SetModified(true);
165165
}

GeomLib/GBox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ GBox::GBox() : GPrimitive(GBOX)
8787
AddDoubleParam(m_h, "h", "Height (Y)");
8888
AddDoubleParam(m_d, "d", "Depth (Z)" );
8989

90-
SetFEMesher(new FEBoxMesher(this));
90+
SetFEMesher(CreateDefaultMesher());
9191

9292
SetManipulator(new GBoxManipulator(*this));
9393

@@ -97,7 +97,7 @@ GBox::GBox() : GPrimitive(GBOX)
9797
//-----------------------------------------------------------------------------
9898
FEMesher* GBox::CreateDefaultMesher()
9999
{
100-
return new FEBoxMesher(this);
100+
return new FEBoxMesher();
101101
}
102102

103103
//-----------------------------------------------------------------------------

GeomLib/GBoxInBox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ GBoxInBox::GBoxInBox() : GPrimitive(GBOX_IN_BOX)
3535
AddDoubleParam(0.5, "Inner Height (Y)");
3636
AddDoubleParam(0.5, "Inner Depth (Z)");
3737

38-
SetFEMesher(new FEBoxInBox(this));
38+
SetFEMesher(CreateDefaultMesher());
3939

4040
Create();
4141
}
4242

4343
FEMesher* GBoxInBox::CreateDefaultMesher()
4444
{
45-
return new FEBoxInBox(this);
45+
return new FEBoxInBox();
4646
}
4747

4848
double GBoxInBox::OuterWidth () const { return GetFloatValue(0); }

GeomLib/GCone.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ GCone::GCone() : GPrimitive(GCONE)
7777
AddDoubleParam(m_R1, "R1", "Top radius");
7878
AddDoubleParam(m_h , "h" , "Height");
7979

80-
SetFEMesher(new FECone(this));
80+
SetFEMesher(CreateDefaultMesher());
8181
SetManipulator(new GConeManipulator(*this));
8282

8383
Create();
@@ -94,7 +94,7 @@ void GCone::SetHeight(double h) { SetFloatValue(H, h); }
9494
//-----------------------------------------------------------------------------
9595
FEMesher* GCone::CreateDefaultMesher()
9696
{
97-
return new FECone(this);
97+
return new FECone();
9898
}
9999

100100
//-----------------------------------------------------------------------------

GeomLib/GCurveObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ SOFTWARE.*/
3131

3232
GCurveObject::GCurveObject() : GObject(GCURVE_OBJECT)
3333
{
34-
SetFEMesher(new FSCurveObjectMesher(this));
34+
SetFEMesher(new FSCurveObjectMesher());
3535
}
3636

3737
GCurveObject::GCurveObject(GCurveObject* po) : GObject(GCURVE_OBJECT)
3838
{
39-
SetFEMesher(new FSCurveObjectMesher(this));
39+
SetFEMesher(new FSCurveObjectMesher());
4040

4141
// copy transform
4242
GetTransform() = po->GetTransform();

GeomLib/GCylinder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ GCylinder::GCylinder() : GPrimitive(GCYLINDER)
7171
AddDoubleParam(m_R, "R", "radius");
7272
AddDoubleParam(m_h, "h", "height");
7373

74-
SetFEMesher(new FECylinder(this));
74+
SetFEMesher(CreateDefaultMesher());
7575
SetManipulator(new GCylinderManipulator(*this));
7676

7777
Create();
@@ -86,7 +86,7 @@ void GCylinder::SetHeight(double H) { SetFloatValue(1, H); Update(); }
8686
//-----------------------------------------------------------------------------
8787
FEMesher* GCylinder::CreateDefaultMesher()
8888
{
89-
return new FECylinder(this);
89+
return new FECylinder();
9090
}
9191

9292
//-----------------------------------------------------------------------------
@@ -189,15 +189,15 @@ GCylinder2::GCylinder2() : GPrimitive(GCYLINDER2)
189189
AddDoubleParam(m_Ry, "Ry", "Y-radius");
190190
AddDoubleParam(m_h , "h" , "Height" );
191191

192-
SetFEMesher(new FECylinder2(this));
192+
SetFEMesher(CreateDefaultMesher());
193193

194194
Create();
195195
}
196196

197197
//-----------------------------------------------------------------------------
198198
FEMesher* GCylinder2::CreateDefaultMesher()
199199
{
200-
return new FECylinder2(this);
200+
return new FECylinder2();
201201
}
202202

203203
//-----------------------------------------------------------------------------

GeomLib/GCylinderInBox.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ GCylinderInBox::GCylinderInBox() : GPrimitive(GCYLINDER_IN_BOX)
104104
AddDoubleParam(m_D, "d", "depth" );
105105
AddDoubleParam(m_R, "R", "radius");
106106

107-
SetFEMesher(new FECylinderInBox(this));
107+
SetFEMesher(CreateDefaultMesher());
108+
108109
SetManipulator(new GCylinderInBoxManipulator(*this));
109110

110111

@@ -114,7 +115,7 @@ GCylinderInBox::GCylinderInBox() : GPrimitive(GCYLINDER_IN_BOX)
114115
//-----------------------------------------------------------------------------
115116
FEMesher* GCylinderInBox::CreateDefaultMesher()
116117
{
117-
return new FECylinderInBox(this);
118+
return new FECylinderInBox();
118119
}
119120

120121
//-----------------------------------------------------------------------------

GeomLib/GDisc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ GDisc::GDisc() : GShellPrimitive(GDISC)
5858
AddDoubleParam(1.0, "R", "radius");
5959

6060
// assign default mesher
61-
SetFEMesher(new FEShellDisc(this));
61+
SetFEMesher(CreateDefaultMesher());
6262

6363
SetManipulator(new GDiscManipulator(*this));
6464

@@ -72,7 +72,7 @@ void GDisc::SetRadius(double R) { SetFloatValue(RADIUS, R); }
7272
//-----------------------------------------------------------------------------
7373
FEMesher* GDisc::CreateDefaultMesher()
7474
{
75-
return new FEShellDisc(this);
75+
return new FEShellDisc();
7676
}
7777

7878
//-----------------------------------------------------------------------------

GeomLib/GHexagon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ GHexagon::GHexagon() : GPrimitive(GHEXAGON)
6464
AddDoubleParam(1.0, "R", "Radius");
6565
AddDoubleParam(1.0, "H", "Height");
6666

67-
SetFEMesher(new FETetGenMesher(this));
67+
SetFEMesher(new FETetGenMesher());
6868
SetManipulator(new GHexagonManipulator(*this));
6969

7070
Create();

GeomLib/GMultiBox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class GMultiBoxManipulator : public GObjectManipulator
6565
//! Constructor
6666
GMultiBox::GMultiBox() : GObject(GMULTI_BLOCK)
6767
{
68-
SetFEMesher(new FEMultiBlockMesher(this));
68+
SetFEMesher(new FEMultiBlockMesher());
6969

7070
SetSaveFlags(0); // this prevents the mesh from getting serialized
7171

@@ -95,7 +95,7 @@ GMultiBox::GMultiBox(GObject* po) : GObject(GMULTI_BLOCK)
9595
GItem_T<GBaseObject>::DecreaseCounter();
9696

9797
// define the default mesher
98-
FEMultiBlockMesher* mbMesher = new FEMultiBlockMesher(this);
98+
FEMultiBlockMesher* mbMesher = new FEMultiBlockMesher();
9999
SetFEMesher(mbMesher);
100100

101101
// we need the multi block mesher to pull out the multiblock geometry

0 commit comments

Comments
 (0)