v0.15.5
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpTopologicalObjectivePythonImpl Struct Reference
Inheritance diagram for EshelbianPlasticity::OpTopologicalObjectivePythonImpl:
[legend]
Collaboration diagram for EshelbianPlasticity::OpTopologicalObjectivePythonImpl:
[legend]

Public Types

using OP = ForcesAndSourcesCore::UserDataOperator
 

Public Member Functions

 OpTopologicalObjectivePythonImpl (boost::shared_ptr< DataAtIntegrationPts > data_at_pts_ptr, boost::shared_ptr< TopologicalData > topo_p, boost::shared_ptr< ObjectiveFunctionData > python_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
boost::shared_ptr< TopologicalDatatopoData
 
boost::shared_ptr< ObjectiveFunctionDatapythonPtr
 

Detailed Description

Definition at line 215 of file EshelbianTopologicalDerivativeOperators.cpp.

Member Typedef Documentation

◆ OP

using EshelbianPlasticity::OpTopologicalObjectivePythonImpl::OP = ForcesAndSourcesCore::UserDataOperator

Definition at line 217 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpTopologicalObjectivePythonImpl()

EshelbianPlasticity::OpTopologicalObjectivePythonImpl::OpTopologicalObjectivePythonImpl ( boost::shared_ptr< DataAtIntegrationPts data_at_pts_ptr,
boost::shared_ptr< TopologicalData topo_p,
boost::shared_ptr< ObjectiveFunctionData python_ptr 
)
inline

Definition at line 219 of file EshelbianTopologicalDerivativeOperators.cpp.

223 : OP(NOSPACE, OP::OPSPACE), dataAtPts(data_at_pts_ptr), topoData(topo_p),
224 pythonPtr(python_ptr) {}
@ NOSPACE
Definition definitions.h:83

Member Function Documentation

◆ doWork()

MoFEMErrorCode EshelbianPlasticity::OpTopologicalObjectivePythonImpl::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 234 of file EshelbianTopologicalDerivativeOperators.cpp.

236 {
238
239#ifndef NDEBUG
240 if (!dataAtPts)
241 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
242 "DataAtIntegrationPts pointer is null");
243 if (!topoData)
244 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
245 "Topological data pointer is null");
246 if (!pythonPtr)
247 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
248 "ObjectiveFunctionData pointer is null");
249#endif // NDEBUG
250
251 constexpr int size_full = SPACE_DIM * SPACE_DIM;
252 const int nb_gauss_pts = getGaussPts().size2();
253 if (!nb_gauss_pts)
255
256 auto stress_full_ptr = boost::make_shared<MatrixDouble>();
257 stress_full_ptr->resize(size_full, nb_gauss_pts, false);
258 stress_full_ptr->clear();
259 auto strain_full_ptr = boost::make_shared<MatrixDouble>();
260 strain_full_ptr->resize(size_full, nb_gauss_pts, false);
261 strain_full_ptr->clear();
262
263 auto t_stress = getFTensor2FromMat<3, 3>(*stress_full_ptr);
264 auto t_strain = getFTensor2FromMat<3, 3>(*strain_full_ptr);
265
266 auto t_P = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(dataAtPts->approxPAtPts);
267 auto t_log_u =
268 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTensorAtPts);
269
270 auto next = [&]() {
271 ++t_stress;
272 ++t_strain;
273 ++t_P;
274 ++t_log_u;
275 };
276
279
280 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
281 // we have to handle all variants, that will render how the Jacobian
282 // gradient is evaluated.
283 t_stress(i, j) = t_P(i, j);
284 t_strain(i, j) = t_log_u(i, j);
285 next();
286 }
287
288 auto &coords = OP::getCoordsAtGaussPts();
289 CHKERR pythonPtr->evalInteriorObjectiveFunction(
290 coords, dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
291 topoData->getObjAtPts(), false);
292
293 CHKERR pythonPtr->evalInteriorObjectiveGradientStrain(
294 coords, dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
295 topoData->getObjDStrainAtPts(), false);
296
297 CHKERR pythonPtr->evalInteriorObjectiveGradientU(
298 coords, dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
299 topoData->getObjDDisplacementAtPts(), false);
300
301 CHKERR pythonPtr->evalInteriorObjectiveGradientStress(
302 coords, dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
303 topoData->getObjDStressAtPts(), false);
304
306}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpTopologicalObjectivePythonImpl::dataAtPts
private

Definition at line 229 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ pythonPtr

boost::shared_ptr<ObjectiveFunctionData> EshelbianPlasticity::OpTopologicalObjectivePythonImpl::pythonPtr
private

Definition at line 231 of file EshelbianTopologicalDerivativeOperators.cpp.

◆ topoData

boost::shared_ptr<TopologicalData> EshelbianPlasticity::OpTopologicalObjectivePythonImpl::topoData
private

Definition at line 230 of file EshelbianTopologicalDerivativeOperators.cpp.


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