Skip to content

Commit 03c04ce

Browse files
committed
Merge branch 'develop' of https://github.com/febiosoftware/FEBio into develop
2 parents 5502cf3 + 67b5054 commit 03c04ce

28 files changed

Lines changed: 178 additions & 119 deletions

FEAMR/FEHexRefine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ SOFTWARE.*/
3636
#include <FECore/FEMeshAdaptorCriterion.h>
3737
#include <FECore/log.h>
3838
#include <FECore/FEModel.h>
39+
#include <stdexcept>
3940

4041
BEGIN_FECORE_CLASS(FEHexRefine, FERefineMesh)
4142
ADD_PARAMETER(m_elemRefine, "max_elem_refine");

FEAMR/FEHexRefine2D.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ SOFTWARE.*/
3535
#include <FECore/FEMeshAdaptorCriterion.h>
3636
#include <FECore/FESurface.h>
3737
#include <FECore/log.h>
38+
#include <stdexcept>
3839

3940
BEGIN_FECORE_CLASS(FEHexRefine2D, FERefineMesh)
4041
ADD_PARAMETER(m_elemRefine, "max_elem_refine");

FEAMR/FEMMGRemesh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ SOFTWARE.*/
4040
#include "FEDomainShapeInterpolator.h"
4141
#include <FECore/FECoreKernel.h>
4242
#include <FECore/FEMaterial.h>
43+
#include <stdexcept>
4344
#ifdef HAS_MMG
4445
#include "mmg/mmg3d/libmmg3d.h"
4546

FEAMR/FERefineMesh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ SOFTWARE.*/
4444
#include "FELeastSquaresInterpolator.h"
4545
#include "FEMeshShapeInterpolator.h"
4646
#include "FEDomainShapeInterpolator.h"
47+
#include <stdexcept>
4748

4849
BEGIN_FECORE_CLASS(FERefineMesh, FEMeshAdaptor)
4950
ADD_PARAMETER(m_maxiter, "max_iters");

FEAMR/FETestRefine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SOFTWARE.*/
3131
#include <FECore/FESurface.h>
3232
#include <FECore/FEModel.h>
3333
#include <FECore/log.h>
34+
#include <stdexcept>
3435

3536
BEGIN_FECORE_CLASS(FETestRefine, FERefineMesh)
3637
END_FECORE_CLASS();

FEAMR/FETetRefine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ SOFTWARE.*/
3131
#include <FECore/FESurface.h>
3232
#include <FECore/FEModel.h>
3333
#include <FECore/log.h>
34+
#include <stdexcept>
3435

3536
BEGIN_FECORE_CLASS(FETetRefine, FERefineMesh)
3637
END_FECORE_CLASS();

FEBioMech/FEUncoupledViscoElasticDamage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include "FEUncoupledViscoElasticDamage.h"
2929
#include <FECore/log.h>
3030
#include <FECore/FEModel.h>
31-
31+
#include <stdexcept>
3232

3333
//-----------------------------------------------------------------------------
3434
BEGIN_FECORE_CLASS(FEUncoupledViscoElasticDamage, FEUncoupledMaterial)

FEBioMech/FEViscoElasticDamage.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "FEViscoElasticDamage.h"
2929
#include <FECore/log.h>
3030
#include <FECore/FEModel.h>
31+
#include <stdexcept>
3132

3233

3334
//-----------------------------------------------------------------------------

FEBioMech/ObjectDataRecord.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,21 @@ ObjectDataRecord::ObjectDataRecord(FEModel* pfem) : DataRecord(pfem, FE_DATA_RB)
4141
//-----------------------------------------------------------------------------
4242
void ObjectDataRecord::SetData(const char* szexpr)
4343
{
44-
std::vector<DataRecordItem> data = ProcessDataString(szexpr);
45-
if (data.empty()) throw UnknownDataField(szexpr);
44+
std::vector<std::string> strings = SplitDataString(szexpr);
45+
if (strings.empty()) throw UnknownDataField(szexpr);
4646

4747
m_Data.clear();
4848
m_data = szexpr;
49-
for (int i=0; i<data.size(); ++i)
49+
for (int i=0; i<strings.size(); ++i)
5050
{
51-
FELogObjectData* pdata = fecore_new<FELogObjectData>(data[i].name.c_str(), GetFEModel());
52-
if (pdata == nullptr) throw UnknownDataField(data[i].name);
51+
DataRecordItem it = ProcessDataString(strings[i].c_str());
52+
if (!it.isValid()) throw UnknownDataField(strings[i]);
53+
FELogObjectData* pdata = fecore_new<FELogObjectData>(it.name.c_str(), GetFEModel());
54+
if (pdata == nullptr) throw UnknownDataField(it.name);
5355
m_Data.push_back(pdata);
5456

55-
if (!ApplyDataRecordItem(*pdata, data[i]))
56-
throw UnknownDataField(data[i].name);
57+
if (!ApplyDataRecordItem(*pdata, it))
58+
throw UnknownDataField(strings[i]);
5759
}
5860
}
5961

FEBioMix/FEBiphasicSolidDomain.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ BEGIN_FECORE_CLASS(FEBiphasicSolidDomain, FESolidDomain)
4141
ADD_PARAMETER(m_secant_stress, "secant_stress");
4242
ADD_PARAMETER(m_secant_tangent, "secant_tangent");
4343
ADD_PARAMETER(m_secant_perm_tangent, "secant_permeability_tangent");
44-
ADD_PARAMETER(m_auto_pressure_stab, "auto_pressure_stabilization");
44+
ADD_PARAMETER(m_auto_pressure_stab, "auto_pressure_stabilization")->setEnums("off\0on\0adaptive\0");
4545
END_FECORE_CLASS();
4646

4747
//-----------------------------------------------------------------------------
@@ -51,7 +51,7 @@ FEBiphasicSolidDomain::FEBiphasicSolidDomain(FEModel* pfem) : FESolidDomain(pfem
5151
m_secant_stress = false;
5252
m_secant_tangent = false;
5353
m_secant_perm_tangent = false;
54-
m_auto_pressure_stab = false;
54+
m_auto_pressure_stab = 0;
5555

5656
if (pfem)
5757
{
@@ -138,6 +138,16 @@ void FEBiphasicSolidDomain::PreSolveUpdate(const FETimeInfo& timeInfo)
138138
mp.Update(timeInfo);
139139
}
140140
}
141+
142+
// see if we update the stabilization factor
143+
if (m_auto_pressure_stab > 1)
144+
{
145+
if (!CalcAutoPressureStabilization())
146+
{
147+
feLogError("Failed to calculate automatic pressure stabilization factor.");
148+
return;
149+
}
150+
}
141151
}
142152

143153
//-----------------------------------------------------------------------------
@@ -158,7 +168,7 @@ bool FEBiphasicSolidDomain::Init()
158168
// allocate nodal pressures
159169
m_nodePressure.resize(Nodes(), 0.0);
160170

161-
if (m_auto_pressure_stab)
171+
if (m_auto_pressure_stab > 0)
162172
{
163173
if (!CalcAutoPressureStabilization())
164174
{
@@ -1267,6 +1277,8 @@ void FEBiphasicSolidDomain::GetNodalPressures(vector<double>& data)
12671277

12681278
bool FEBiphasicSolidDomain::CalcAutoPressureStabilization()
12691279
{
1280+
feLog("Updating stabilization factor for biphasic solid domain '%s'\n", GetName().c_str());
1281+
12701282
// make sure that the biphasic tau parameter is not zero
12711283
if (m_pMat->m_tau == 0.0)
12721284
{
@@ -1282,7 +1294,9 @@ bool FEBiphasicSolidDomain::CalcAutoPressureStabilization()
12821294

12831295
FEMesh& mesh = *GetMesh();
12841296

1285-
for (int i = 0; i < Elements(); ++i)
1297+
int NE = Elements();
1298+
#pragma omp parallel for shared(EL, EEL, mesh)
1299+
for (int i = 0; i < NE; ++i)
12861300
{
12871301
FESolidElement& el = Element(i);
12881302

@@ -1304,7 +1318,6 @@ bool FEBiphasicSolidDomain::CalcAutoPressureStabilization()
13041318
{
13051319
FEMaterialPoint& mp = *el.GetMaterialPoint(n);
13061320
FEBiphasicMaterialPoint* bpt = (mp.ExtractData<FEBiphasicMaterialPoint>());
1307-
if (bpt == nullptr) return false;
13081321

13091322
// get the tangent stiffness
13101323
tens4dmm C = m_pMat->Tangent(mp);

0 commit comments

Comments
 (0)