v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
OpElasticTools::FePrePostProcess Struct Reference

Not used at this stage. Could be used to do some calculations, before assembly of local elements. More...

#include <users_modules/multifield_plasticity/src/ElasticOperators.hpp>

Inheritance diagram for OpElasticTools::FePrePostProcess:
[legend]
Collaboration diagram for OpElasticTools::FePrePostProcess:
[legend]

Public Member Functions

 FePrePostProcess (MoFEM::Interface &m_field, boost::ptr_vector< DataFromMove > &bc_data, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode postProcess ()
 

Public Attributes

MoFEM::InterfacemField
 
boost::ptr_vector< DataFromMove > & bcData
 
boost::shared_ptr< MethodForForceScalingmethodsOpForMove
 
boost::shared_ptr< MethodForForceScalingmethodsOpForRollersDisp
 
boost::shared_ptr< CommonDatacommonDataPtr
 
bool runOnceFlag
 

Detailed Description

Not used at this stage. Could be used to do some calculations, before assembly of local elements.

Definition at line 1220 of file ElasticOperators.hpp.

Constructor & Destructor Documentation

◆ FePrePostProcess()

OpElasticTools::FePrePostProcess::FePrePostProcess ( MoFEM::Interface m_field,
boost::ptr_vector< DataFromMove > &  bc_data,
boost::shared_ptr< CommonData common_data_ptr 
)
inline

Definition at line 1235 of file ElasticOperators.hpp.

1238 : mField(m_field), bcData(bc_data), commonDataPtr(common_data_ptr) {}
boost::ptr_vector< DataFromMove > & bcData
MoFEM::Interface & mField
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ postProcess()

MoFEMErrorCode OpElasticTools::FePrePostProcess::postProcess ( )
inline

Definition at line 1317 of file ElasticOperators.hpp.

1317 {
1319 // if (ts_ctx == CTX_TSSETIJACOBIAN)
1320 // CHKERR MatView(ts_B, PETSC_VIEWER_STDOUT_SELF);
1321 auto assemble = [](Mat a) {
1323 if (a) {
1324 CHKERR MatAssemblyBegin(a, MAT_FINAL_ASSEMBLY);
1325 CHKERR MatAssemblyEnd(a, MAT_FINAL_ASSEMBLY);
1326 }
1328 };
1329
1330 if (ts_ctx == CTX_TSSETIJACOBIAN) {
1331
1332 if (commonDataPtr->SEpEp)
1333 CHKERR assemble(commonDataPtr->SEpEp);
1334 if (commonDataPtr->STauTau)
1335 CHKERR assemble(commonDataPtr->STauTau);
1336
1337 // if (true)
1338 // CHKERR MatView(ts_B, PETSC_VIEWER_DRAW_WORLD);
1339 // if (commonDataPtr->SEpEp)
1340 // CHKERR MatView(commonDataPtr->SEpEp, PETSC_VIEWER_DRAW_WORLD);
1341 // if (commonDataPtr->STauTau)
1342 // CHKERR MatView(commonDataPtr->STauTau, PETSC_VIEWER_DRAW_WORLD);
1343
1344 }
1345
1347 }
constexpr double a
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define CHKERR
Inline error check.
Definition: definitions.h:535
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1865

◆ preProcess()

MoFEMErrorCode OpElasticTools::FePrePostProcess::preProcess ( )
inline

Definition at line 1240 of file ElasticOperators.hpp.

1240 {
1242 runOnceFlag = true;
1243 CHKERR VecSetOption(ts_F, VEC_IGNORE_NEGATIVE_INDICES, PETSC_TRUE);
1244
1245 switch (ts_ctx) {
1246 case CTX_TSSETIJACOBIAN: {
1247 snes_ctx = CTX_SNESSETJACOBIAN;
1248 snes_B = ts_B;
1249 // CHKERR MatSetOption(ts_B, MAT_NO_OFF_PROC_ZERO_ROWS, PETSC_TRUE);
1250 // CHKERR MatSetOption(ts_B, MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE);
1251
1252 if (commonDataPtr->SEpEp)
1253 CHKERR MatZeroEntries(commonDataPtr->SEpEp);
1254 if (commonDataPtr->STauTau)
1255 CHKERR MatZeroEntries(commonDataPtr->STauTau);
1256
1257 break;
1258 }
1259 case CTX_TSSETIFUNCTION: {
1260 snes_ctx = CTX_SNESSETFUNCTION;
1261 snes_f = ts_F;
1262 break;
1263 }
1264 default:
1265 break;
1266 }
1267
1268 auto time = ts_t;
1269
1270 // forceDataScaled = forceData;
1271 // pressureDataScaled = pressureData;
1272 if (methodsOpForMove)
1273 for (auto &bdata : bcData) {
1274 bdata.scaledValues = bdata.values;
1276 bdata.scaledValues);
1277 }
1278
1279 //FIXME: obsolete, for debugging get rid of this flag
1280 if (time <= (*cache).rollers_stop_time) {
1281
1283 for (auto &roller : (*cache).rollerDataVec) {
1284 roller.BodyDispScaled = roller.rollerDisp;
1286 this, methodsOpForRollersDisp, roller.BodyDispScaled);
1287 }
1288
1289 for (auto &roller : (*cache).rollerDataVec) {
1290 if (roller.methodOpForRollerPosition) {
1291 roller.BodyDispScaled.clear();
1293 this, roller.methodOpForRollerPosition, roller.BodyDispScaled);
1294 }
1295 if (roller.methodOpForRollerDirection) {
1296 roller.BodyDirectionScaled.clear();
1298 this, roller.methodOpForRollerDirection,
1299 roller.BodyDirectionScaled);
1300 }
1301 }
1302 }
1303
1304 // if (snes_ctx == CTX_SNESNONE) {
1305 // if (!dofsIndices.empty()) {
1306 // CHKERR VecSetValues(snes_x, dofsIndices.size(),
1307 // &*dofsIndices.begin(),
1308 // &*dofsValues.begin(), INSERT_VALUES);
1309 // }
1310 // CHKERR VecAssemblyBegin(snes_x);
1311 // CHKERR VecAssemblyEnd(snes_x);
1312 // }
1313
1315 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)
boost::shared_ptr< MethodForForceScaling > methodsOpForMove
bool runOnceFlag
boost::shared_ptr< MethodForForceScaling > methodsOpForRollersDisp

Member Data Documentation

◆ bcData

boost::ptr_vector<DataFromMove>& OpElasticTools::FePrePostProcess::bcData

Definition at line 1223 of file ElasticOperators.hpp.

◆ commonDataPtr

boost::shared_ptr<CommonData> OpElasticTools::FePrePostProcess::commonDataPtr

Definition at line 1228 of file ElasticOperators.hpp.

◆ methodsOpForMove

boost::shared_ptr<MethodForForceScaling> OpElasticTools::FePrePostProcess::methodsOpForMove

Definition at line 1225 of file ElasticOperators.hpp.

◆ methodsOpForRollersDisp

boost::shared_ptr<MethodForForceScaling> OpElasticTools::FePrePostProcess::methodsOpForRollersDisp

Definition at line 1226 of file ElasticOperators.hpp.

◆ mField

MoFEM::Interface& OpElasticTools::FePrePostProcess::mField

Definition at line 1222 of file ElasticOperators.hpp.

◆ runOnceFlag

bool OpElasticTools::FePrePostProcess::runOnceFlag

Definition at line 1233 of file ElasticOperators.hpp.


The documentation for this struct was generated from the following file: