Skip to content

Commit c3115d1

Browse files
authored
Merge pull request #39 from kmokstad/outofcore-settings
Change default out-of-core settings
2 parents f12572b + 47f9c59 commit c3115d1

File tree

5 files changed

+68
-55
lines changed

5 files changed

+68
-55
lines changed

vpmDB/FmAnalysis.C

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ FmAnalysis::FmAnalysis()
157157
FFA_FIELD_DEFAULT_INIT(solverAddOpts, "SOLVER_ADD_OPTIONS");
158158
FFA_FIELD_DEFAULT_INIT(stressAddOpts, "STRESS_ADD_OPTIONS");
159159

160-
FFA_FIELD_INIT(useRamSizeGSF, true,"USE_RAMSIZE_GSF_SOLVER");
160+
FFA_FIELD_INIT(useRamSizeGSF,false,"USE_RAMSIZE_GSF_SOLVER");
161161
FFA_FIELD_INIT(autoRamSizeGSF,true,"AUTO_RAMSIZE_GSF_SOLVER");
162162
FFA_FIELD_INIT(ramSizeGSF, 0,"RAMSIZE_GSF_SOLVER");
163163

164-
FFA_FIELD_INIT(useRamSizeBmat, true,"USE_RAMSIZE_RECOVERY_MATRIX");
164+
FFA_FIELD_INIT(useRamSizeBmat,false,"USE_RAMSIZE_RECOVERY_MATRIX");
165165
FFA_FIELD_INIT(autoRamSizeBmat,true,"AUTO_RAMSIZE_RECOVERY_MATRIX");
166166
FFA_FIELD_INIT(ramSizeBmat, 0,"RAMSIZE_RECOVERY_MATRIX");
167167

@@ -252,11 +252,11 @@ bool FmAnalysis::readAndConnect(std::istream& is, std::ostream&)
252252
else if (shadowPosAlg.getValue() == 0)
253253
{
254254
obj->defaultShadowPosAlg.setValue(3);
255-
FFaMsg::dialog("This model used the depreciated \"Max triangle, with unit offset\" option in the\n"
256-
"\"Default positioning algorithm for the co-rotated reference coordinate system\"\n"
257-
"menu. This is now changed to \"Max triangle, with scaled offset\" instead.\n\n"
258-
"This change may affect the simulation, if the model contains Parts that\n"
259-
"rely on the default positioning algorithm.",FFaMsg::WARNING);
255+
FFaMsg::dialog("This model used the deprecated \"Max triangle, with unit offset\" option in the\n"
256+
"\"Default positioning algorithm for the co-rotated reference coordinate system\"\n"
257+
"menu. This is now changed to \"Max triangle, with scaled offset\" instead.\n\n"
258+
"This change may affect the simulation, if the model contains Parts that\n"
259+
"rely on the default positioning algorithm.", FFaMsg::WARNING);
260260
}
261261
else
262262
obj->defaultShadowPosAlg.setValue(shadowPosAlg.getValue());
@@ -275,12 +275,21 @@ bool FmAnalysis::readAndConnect(std::istream& is, std::ostream&)
275275
if (old && obj->numEigenmodes.getValue() == 0)
276276
obj->numEigenmodes.setValue(old->numEigenmodes.getValue());
277277

278+
if (FmDB::getModelFileVer() < FFaVersionNumber(8,1,2,8))
279+
{
280+
// The default used to be true for these settings, but they should be false
281+
if (obj->useRamSizeGSF.setValue(false))
282+
ListUI <<" -> Resetting the FE model Reducer out-of-core option to OFF.\n";
283+
if (obj->useRamSizeBmat.setValue(false))
284+
ListUI <<" -> Resetting the Recovery matrix out-of-core option to OFF.\n";
285+
}
286+
278287
return obj->cloneOrConnect();
279288
}
280289

281290

282291
bool FmAnalysis::localParse(const char* keyWord, std::istream& activeStatement,
283-
FmAnalysis* obj)
292+
FmAnalysis* obj)
284293
{
285294
enum { MAX_EIGENMODES = 1,
286295
ABSOLUTE_INTEGRATION_TOLERANCE,
@@ -317,6 +326,7 @@ bool FmAnalysis::localParse(const char* keyWord, std::istream& activeStatement,
317326
"CURR_SCALE",
318327
NULL};
319328

329+
bool defsonly;
320330
int tmpInt;
321331
double tmp;
322332
switch (FaParse::findIndex(key_words, keyWord))
@@ -353,7 +363,6 @@ bool FmAnalysis::localParse(const char* keyWord, std::istream& activeStatement,
353363
break;
354364

355365
case STRESS_DEFORMATIONS_ONLY:
356-
bool defsonly;
357366
activeStatement >> defsonly;
358367
obj->stressDeformation.setValue(true);
359368
obj->stressStressTensor.setValue(!defsonly);
@@ -419,21 +428,18 @@ void FmAnalysis::initAfterResolve()
419428

420429
if (seaEngine == 0) return;
421430

422-
FmMathFuncBase* sfunc = NULL;
423-
FmBase* found = FmDB::findID(FmEngine::getClassTypeID(),seaEngine);
424-
if (found) sfunc = static_cast<FmEngine*>(found)->getFunction();
425-
if (sfunc)
426-
{
427-
sfunc->setUserDescription(found->getUserDescription());
428-
sfunc->setFunctionUse(FmMathFuncBase::WAVE_FUNCTION);
429-
FmDB::getSeaStateObject()->waveFunction.setRef(sfunc);
430-
FmModelMemberBase* user = NULL;
431-
if (!found->hasReferringObjs(user))
431+
if (FmBase* found = FmDB::findID(FmEngine::getClassTypeID(),seaEngine); found)
432+
if (FmMathFuncBase* swf = static_cast<FmEngine*>(found)->getFunction(); swf)
432433
{
433-
static_cast<FmEngine*>(found)->setFunction(NULL);
434-
found->erase();
434+
swf->setUserDescription(found->getUserDescription());
435+
swf->setFunctionUse(FmMathFuncBase::WAVE_FUNCTION);
436+
FmDB::getSeaStateObject()->waveFunction.setRef(swf);
437+
if (FmModelMemberBase* user; !found->hasReferringObjs(user))
438+
{
439+
static_cast<FmEngine*>(found)->setFunction(NULL);
440+
found->erase();
441+
}
435442
}
436-
}
437443

438444
seaEngine = 0;
439445
}

vpmDB/FmFuncAdmin.C

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,20 @@ namespace
6767
numClassTypes = FFaTypeCheck::getNewTypeID(NULL);
6868

6969
std::string funcName(64,' ');
70-
const char* fName = funcName.c_str()+4;
70+
char* fName = const_cast<char*>(funcName.c_str()+4);
71+
int funcIdx = USER_HEADING + 1;
7172
itsFuncInfoTable[USER_HEADING] = "-- User-defined Functions --";
72-
for (int i = 1; i <= nUserFuncs; i++)
73-
if (FFaUserFuncPlugin::instance()->getFuncName(funcId[i-1],60,const_cast<char*>(fName)) > 0)
74-
itsFuncInfoTable[USER_HEADING+i] = FmFuncTypeInfo(funcName.c_str(),numClassTypes+funcId[i-1]);
73+
for (int i = 0; i < nUserFuncs; i++, funcIdx++)
74+
if (FFaUserFuncPlugin::instance()->getFuncName(funcId[i],60,fName) > 0)
75+
itsFuncInfoTable[funcIdx] = FmFuncTypeInfo(funcName.c_str(),
76+
numClassTypes + funcId[i]);
7577
}
7678

7779
for (std::pair<const int,FmFuncTypeInfo>& info : itsFuncInfoTable)
7880
info.second.funcMenuEnum = info.first;
7981

80-
itsFuncInfoTable[WAVE_SINUS].funcMenuEnum = INTERNAL; // Should not appear in Function type menu
82+
// Should not appear in the Function type menu
83+
itsFuncInfoTable[WAVE_SINUS].funcMenuEnum = INTERNAL;
8184
}
8285
}
8386

@@ -140,36 +143,32 @@ bool FmFuncAdmin::hasSmartPoints(int type)
140143
}
141144

142145

143-
void FmFuncAdmin::getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& toFill,
144-
FmMathFuncBase* compatibleFunc)
146+
void FmFuncAdmin::getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& types,
147+
FmMathFuncBase* func)
145148
{
146-
toFill.clear();
147-
if (!compatibleFunc)
148-
return;
149-
150149
if (itsFuncInfoTable.empty())
151150
initFuncInfoTable();
152151

153152
using FmFuncInfo = std::pair<const int,FmFuncTypeInfo>;
154153

155-
switch (compatibleFunc->getFunctionUse())
154+
switch (func ? func->getFunctionUse() : FmMathFuncBase::GENERAL)
156155
{
157156
case FmMathFuncBase::GENERAL:
158157
// General function, allow all function types,
159158
// except for internal ones and wave spectrums
160-
if (compatibleFunc->getTypeID() == FmfWaveSinus::getClassTypeID())
159+
if (func && func->getTypeID() == FmfWaveSinus::getClassTypeID())
161160
// Internal function with predefined type, don't allow type switching
162-
toFill.push_back(itsFuncInfoTable[FmFuncAdmin::WAVE_SINUS]);
161+
types.push_back(itsFuncInfoTable[FmFuncAdmin::WAVE_SINUS]);
163162
else
164163
for (const FmFuncInfo& info : itsFuncInfoTable)
165164
if (info.second.funcMenuEnum > FmFuncAdmin::UNDEFINED &&
166165
info.second.funcMenuEnum != FmFuncAdmin::WAVE_SPECTRUM &&
167166
info.second.funcMenuEnum != FmFuncAdmin::FILE_SPECTRUM)
168-
toFill.push_back(info.second);
167+
types.push_back(info.second);
169168
return;
170169

171170
case FmMathFuncBase::DRIVE_FILE:
172-
toFill.push_back(itsFuncInfoTable[FmFuncAdmin::DEVICE]);
171+
types.push_back(itsFuncInfoTable[FmFuncAdmin::DEVICE]);
173172
return;
174173

175174
case FmMathFuncBase::NONE:
@@ -180,20 +179,20 @@ void FmFuncAdmin::getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& toFill
180179
info.second.funcMenuEnum != FmFuncAdmin::WAVE_SPECTRUM &&
181180
info.second.funcMenuEnum != FmFuncAdmin::FILE_SPECTRUM &&
182181
info.second.funcMenuEnum != FmFuncAdmin::REFERENCE)
183-
toFill.push_back(info.second);
182+
types.push_back(info.second);
184183
return;
185184

186185
case FmMathFuncBase::WAVE_FUNCTION:
187-
toFill.push_back(itsFuncInfoTable[FmFuncAdmin::SINUSOIDAL]);
188-
toFill.push_back(itsFuncInfoTable[FmFuncAdmin::WAVE_SPECTRUM]);
189-
toFill.push_back(itsFuncInfoTable[FmFuncAdmin::FILE_SPECTRUM]);
186+
types.push_back(itsFuncInfoTable[FmFuncAdmin::SINUSOIDAL]);
187+
types.push_back(itsFuncInfoTable[FmFuncAdmin::WAVE_SPECTRUM]);
188+
types.push_back(itsFuncInfoTable[FmFuncAdmin::FILE_SPECTRUM]);
190189
// Check if we have user-defined wave functions
191190
for (const FmFuncInfo& info : itsFuncInfoTable)
192191
if (info.first > FmFuncAdmin::USER_HEADING &&
193192
info.second.funcType > numClassTypes)
194193
if (int fId = info.second.funcType - numClassTypes;
195194
FFaUserFuncPlugin::instance()->getFlag(fId) & 4)
196-
toFill.push_back(info.second);
195+
types.push_back(info.second);
197196
return;
198197

199198
default: // Stiffness or Damper function
@@ -204,7 +203,7 @@ void FmFuncAdmin::getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& toFill
204203
for (const FmFuncInfo& info : itsFuncInfoTable)
205204
if (std::find(ftyp.begin(),ftyp.end(),info.second.funcType) != ftyp.end())
206205
if (info.first != FmFuncAdmin::FILE_SPECTRUM)
207-
toFill.push_back(info.second);
206+
types.push_back(info.second);
208207
}
209208

210209

vpmDB/FmFuncAdmin.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ namespace FmFuncAdmin
3232

3333
bool hasSmartPoints(int type);
3434

35-
void getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& toFill,
36-
FmMathFuncBase* compatibleFunc);
35+
void getCompatibleFunctionTypes(std::vector<FmFuncTypeInfo>& types,
36+
FmMathFuncBase* func);
3737

3838
FmMathFuncBase* createFunction(int type);
3939

vpmDB/FmPart.C

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,6 +1089,8 @@ void FmPart::updateMassProperties()
10891089
// We have a generic part without a FE data file.
10901090
// Calculate mass properties from the associated CAD data file, if any.
10911091
std::string cadFile = this->getGeometryFile();
1092+
if (FFaLowerCaseString(FFaFilePath::getExtension(cadFile)) == "obj")
1093+
myCalculateMass.setValue(EXPLICIT); // not implemented for obj-files
10921094
if (!cadFile.empty() && myCalculateMass.getValue() == FROM_GEOMETRY)
10931095
{
10941096
ListUI <<" -> Calculating mass properties for "<< this->getIdString(true)

vpmDB/FmSolverInput.C

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,18 @@ std::string Fedem::createReducerInput(FmAnalysis* analysis,
261261
else if (!analysis->autoRamSizeBmat.getValue())
262262
fcoArgs.add("-Bramsize",analysis->ramSizeBmat.getValue());
263263
const std::string& addOptions = analysis->reducerAddOpts.getValue();
264-
if (addOptions.find("-gsfSolver") != std::string::npos) {
265-
if (!analysis->useRamSizeGSF.getValue())
264+
if (analysis->useRamSizeGSF.getValue())
265+
{
266+
// Use the out-of-core GSF equation solver
267+
if (addOptions.find("-gsfSolver") != std::string::npos)
268+
fcoArgs.add("-gsfSolver",2);
269+
if (analysis->autoRamSizeGSF.getValue())
266270
fcoArgs.add("-cachesize",0);
267-
else if (!analysis->autoRamSizeGSF.getValue())
271+
else if (analysis->ramSizeGSF.getValue() > 0)
268272
fcoArgs.add("-cachesize",analysis->ramSizeGSF.getValue());
273+
// else switch off out-of-core for GSF
269274
}
275+
// else use the SPR solver (default)
270276

271277
int ngen = part->nGenModes.getValue();
272278
fcoArgs.add("-neval", part->nEigvalsCalc.getValue());
@@ -614,12 +620,12 @@ std::string Fedem::createSolverInput(FmAnalysis* analysis,
614620
{
615621
fcoArgs.addComment("Eigenvalue solution parameters");
616622
if (analysis->dynamicsEnable.getValue())
617-
fcoArgs.add("-eiginc", analysis->eigenSolveTimeInterval.getValue());
618-
fcoArgs.add("-numEigModes", analysis->numEigenmodes.getValue());
619-
fcoArgs.add("-damped", analysis->dampedEigenvalues.getValue());
620-
fcoArgs.add("-eigenshift", analysis->eigenvalueShiftFactor.getValue());
623+
fcoArgs.add("-eiginc", analysis->eigenSolveTimeInterval.getValue());
624+
fcoArgs.add("-numEigModes", analysis->numEigenmodes.getValue());
625+
fcoArgs.add("-damped", analysis->dampedEigenvalues.getValue());
626+
fcoArgs.add("-eigenshift", analysis->eigenvalueShiftFactor.getValue());
621627
fcoArgs.add("-addBC_eigensolver", analysis->useBCsOnEigenvalues.getValue());
622-
fcoArgs.add("-stressStiffEig", analysis->useEigStressStiffening.getValue());
628+
fcoArgs.add("-stressStiffEig", analysis->useEigStressStiffening.getValue());
623629
}
624630

625631
if (analysis->solveFrequencyDomain.getValue())
@@ -677,7 +683,7 @@ std::string Fedem::createSolverInput(FmAnalysis* analysis,
677683
const std::string& addOptions = analysis->solverAddOpts.getValue();
678684

679685
// Check if frs-output of recovery results has been enabled
680-
// though the additional solver options
686+
// through the additional solver options
681687
size_t iStr = addOptions.rfind("-partDeformation");
682688
bool saveStr = iStr == std::string::npos; // use "==" here since default value is 1
683689
if (!saveStr && iStr+17 < addOptions.size())

0 commit comments

Comments
 (0)