Skip to content

Commit

Permalink
Merge branch 'develop' into shell-recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMaas1978 committed Dec 12, 2024
2 parents 9f5b5ed + aed29b9 commit 52b27b0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 8 deletions.
1 change: 0 additions & 1 deletion FEBioFluid/FEBiphasicFSIDomain3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ void FEBiphasicFSIDomain3D::UpdateElementStress(int iel, const FETimeInfo& tp)

//calculate gradJ gradphif
bt.m_gradJ = Fi.transpose()*(GradJ*alphaf + GradJp*(1-alphaf));
ept.m_gradJ = bt.m_gradJ;

// FSI material point data
ft.m_w = el.Evaluate(w, n);
Expand Down
1 change: 0 additions & 1 deletion FEBioFluid/FEMultiphasicFSIDomain3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,6 @@ void FEMultiphasicFSIDomain3D::UpdateElementStress(int iel, const FETimeInfo& tp

//calculate gradJ gradphif
bt.m_gradJ = Fi.transpose()*(GradJ*alphaf + GradJp*(1-alphaf));
ept.m_gradJ = bt.m_gradJ;

// FSI material point data
ft.m_w = el.Evaluate(w, n);
Expand Down
6 changes: 3 additions & 3 deletions FEBioMech/FEElasticMaterialPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FEElasticMaterialPoint::FEElasticMaterialPoint(FEMaterialPointData* mp) : FEMate
m_F.unit();
m_J = 1;
m_s.zero();
m_v = m_a = m_gradJ = vec3d(0, 0, 0);
m_v = m_a = vec3d(0, 0, 0);
m_buncoupled = false;
m_Wt = m_Wp = 0;
m_p = 0;
Expand All @@ -58,7 +58,7 @@ void FEElasticMaterialPoint::Init()

m_s.zero();

m_v = m_a = m_gradJ = vec3d(0, 0, 0);
m_v = m_a = vec3d(0, 0, 0);
m_L.zero();

m_Wt = m_Wp = 0;
Expand All @@ -73,7 +73,7 @@ void FEElasticMaterialPoint::Init()
void FEElasticMaterialPoint::Serialize(DumpStream& ar)
{
FEMaterialPointData::Serialize(ar);
ar & m_F & m_J & m_s & m_v & m_a & m_gradJ & m_L & m_Wt & m_Wp & m_p;
ar & m_F & m_J & m_s & m_v & m_a & m_L & m_Wt & m_Wp & m_p;
ar & m_buncoupled;
}

Expand Down
1 change: 0 additions & 1 deletion FEBioMech/FEElasticMaterialPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class FEBIOMECH_API FEElasticMaterialPoint : public FEMaterialPointData
// deformation data at intermediate time
mat3d m_F; //!< deformation gradient
double m_J; //!< determinant of F
vec3d m_gradJ; //!< gradient of J
vec3d m_v; //!< velocity
vec3d m_a; //!< acceleration
mat3d m_L; //!< spatial velocity gradient
Expand Down
16 changes: 16 additions & 0 deletions FEBioOpt/FEBioOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ SOFTWARE.*/
#include "FEPowellOptimizeMethod.h"
#include "FEScanOptimizeMethod.h"

#ifdef HAVE_LEVMAR
#include "levmar.h"
#endif

//-----------------------------------------------------------------------------
//! Initialization of the FEBioOpt module. This function registers all the classes
//! in this module with the FEBio framework.
Expand All @@ -55,3 +59,15 @@ void FEBioOpt::InitModule()
REGISTER_FECORE_CLASS(FEPowellOptimizeMethod, "powell");
REGISTER_FECORE_CLASS(FEScanOptimizeMethod, "scan");
}

int FEBioOpt::optimize(
void (*func)(double* p, double* hx, int m, int n, void* adata),
double* p, double* x, int m, int n, double* lb, double* ub, double* dscl,
int itmax, double* opts, double* info, double* work, double* covar, void* adata)
{
#ifdef HAVE_LEVMAR
return dlevmar_bc_dif(func, p, x, m, n, lb, ub, dscl, itmax, opts, info, work, covar, adata);
#else
return -1;
#endif
}
6 changes: 6 additions & 0 deletions FEBioOpt/FEBioOpt.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ namespace FEBioOpt {

FEBIOOPT_API void InitModule();

// wrapper function for some levmar calls.
// This is only used in FEBio Studio, but don't want to link there with levmar.
FEBIOOPT_API int optimize(
void (*func)(double* p, double* hx, int m, int n, void* adata),
double* p, double* x, int m, int n, double* lb, double* ub, double* dscl,
int itmax, double* opts, double* info, double* work, double* covar, void* adata);
}
2 changes: 1 addition & 1 deletion NumCore/MKLDSSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ BEGIN_FECORE_CLASS(MKLDSSolver, LinearSolver)
ADD_PARAMETER(m->msglvl, "msglvl");
END_FECORE_CLASS();

MKLDSSolver::MKLDSSolver(FEModel* fem) : LinearSolver(fem), m(nullptr) {}
MKLDSSolver::MKLDSSolver(FEModel* fem) : LinearSolver(fem), m(new MKLDSSolver::Imp) {}
MKLDSSolver::~MKLDSSolver() {}
SparseMatrix* MKLDSSolver::CreateSparseMatrix(Matrix_Type ntype) { return nullptr; }
bool MKLDSSolver::SetSparseMatrix(SparseMatrix* pA) { return false; }
Expand Down
5 changes: 4 additions & 1 deletion NumCore/NumCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ SOFTWARE.*/
NUMCORE_API void NumCore::InitModule()
{
// register linear solvers
#ifdef PARDISO
REGISTER_FECORE_CLASS(PardisoSolver , "pardiso");
REGISTER_FECORE_CLASS(PardisoSolver64, "pardiso_64");
REGISTER_FECORE_CLASS(MKLDSSolver, "mkl_dss");
#endif

REGISTER_FECORE_CLASS(PardisoProjectSolver, "pardiso-project");
REGISTER_FECORE_CLASS(FGMRESSolver , "fgmres" );
REGISTER_FECORE_CLASS(BoomerAMGSolver , "boomeramg");
Expand All @@ -72,7 +76,6 @@ NUMCORE_API void NumCore::InitModule()
REGISTER_FECORE_CLASS(TestSolver , "test");
REGISTER_FECORE_CLASS(AccelerateSparseSolver, "accelerate");
REGISTER_FECORE_CLASS(SuperLU_MT_Solver , "superlu_mt");
REGISTER_FECORE_CLASS(MKLDSSolver , "mkl_dss");

// register preconditioners
REGISTER_FECORE_CLASS(ILU0_Preconditioner, "ilu0");
Expand Down

0 comments on commit 52b27b0

Please sign in to comment.