v0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM > Struct Template Reference

Rhs for mapping symmetric tensor fields with least squares. More...

#include "users_modules/multifield-thermoplasticity-private/src/EdgeFlippingOps.hpp"

Inheritance diagram for EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >:
[legend]
Collaboration diagram for EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >:
[legend]

Public Member Functions

 OpRhsSymTensorLeastSquaresProj (const std::string field_name, boost::shared_ptr< MatrixDouble > old_sol_ptr, boost::shared_ptr< MatrixDouble > dot_new_sol_ptr, boost::shared_ptr< MatrixDouble > new_sol_ptr, boost::shared_ptr< MatrixDouble > grad_new_sol_ptr, MoFEM::Interface &m_field, ScalarFun scalar_function=[](double, double, double) constexpr { return 1;})
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Private Attributes

ScalarFun scalarFunction
 
boost::shared_ptr< MatrixDouble > dotNewSolPtr
 
boost::shared_ptr< MatrixDouble > newSolPtr
 
boost::shared_ptr< MatrixDouble > gradNewSolPtr
 
boost::shared_ptr< MatrixDouble > oldSolPtr
 
MoFEM::InterfacemField
 

Detailed Description

template<AssemblyType A, IntegrationType I, int DIM>
struct EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >

Rhs for mapping symmetric tensor fields with least squares.

Examples
SolutionMapping.hpp.

Definition at line 270 of file EdgeFlippingOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsSymTensorLeastSquaresProj()

template<AssemblyType A, IntegrationType I, int DIM>
EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::OpRhsSymTensorLeastSquaresProj ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  old_sol_ptr,
boost::shared_ptr< MatrixDouble >  dot_new_sol_ptr,
boost::shared_ptr< MatrixDouble >  new_sol_ptr,
boost::shared_ptr< MatrixDouble >  grad_new_sol_ptr,
MoFEM::Interface m_field,
ScalarFun  scalar_function = [](doubledouble,                                     double) constexpr { return 1; } 
)
inline

Definition at line 272 of file EdgeFlippingOps.hpp.

279 { return 1; })
281 oldSolPtr(old_sol_ptr), dotNewSolPtr(dot_new_sol_ptr),
282 newSolPtr(new_sol_ptr), gradNewSolPtr(grad_new_sol_ptr),
283 mField(m_field), scalarFunction(scalar_function) {}
constexpr auto field_name
boost::shared_ptr< MatrixDouble > oldSolPtr
boost::shared_ptr< MatrixDouble > newSolPtr
boost::shared_ptr< MatrixDouble > gradNewSolPtr
boost::shared_ptr< MatrixDouble > dotNewSolPtr

Member Function Documentation

◆ iNtegrate()

template<AssemblyType A, IntegrationType I, int DIM>
MoFEMErrorCode EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::iNtegrate ( EntitiesFieldData::EntData &  data)
inline
Examples
EdgeFlippingOps.hpp.

Definition at line 285 of file EdgeFlippingOps.hpp.

285 {
287
288 FTENSOR_INDEX(DIM, i);
289 FTENSOR_INDEX(DIM, j);
290 constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
292
293 const double vol = getMeasure();
294 auto t_w = getFTensor0IntegrationWeight();
295 auto t_coords = getFTensor1CoordsAtGaussPts();
296 auto t_base = data.getFTensor0N();
297 auto t_diff_base = data.getFTensor1DiffN<DIM>();
298
299#ifndef NDEBUG
300 if (data.getDiffN().size1() != data.getN().size1())
301 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
302 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
303 MOFEM_LOG("SELF", Sev::error)
304 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
305 MOFEM_LOG("SELF", Sev::error) << data.getN();
306 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
307 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
308 }
309#endif
310
312 auto &nf = AssemblyDomainEleOp::locF;
313
314 auto t_old_sol = getFTensor2SymmetricFromMat<DIM>(*oldSolPtr);
315 auto t_new_sol = getFTensor2SymmetricFromMat<DIM>(*newSolPtr);
316
317 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
318
319 const double alpha =
320 t_w * vol * scalarFunction(t_coords(0), t_coords(1), t_coords(2));
321
323 t_old_sol_L(L) = alpha * t_old_sol(i, j) * t_L(i, j, L);
324
325 auto t_nf = getFTensor1FromArray<size_symm, size_symm>(nf);
326 int bb = 0;
327 for (; bb != AssemblyDomainEleOp::nbRows / size_symm; ++bb) {
328 t_nf(L) += t_base * (t_old_sol_L(L));
329 ++t_base;
330 ++t_diff_base;
331 ++t_nf;
332 }
333
334 for (; bb < nbRowBaseFunctions; ++bb) {
335 ++t_base;
336 ++t_diff_base;
337 }
338
339 ++t_old_sol;
340 ++t_new_sol;
341
342 ++t_coords;
343 ++t_w;
344 }
345
347 }
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
[Define dimension]
#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 MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
auto symm_L_tensor(FTensor::Number< DIM >)
constexpr auto size_symm
Definition plastic.cpp:42

Member Data Documentation

◆ dotNewSolPtr

template<AssemblyType A, IntegrationType I, int DIM>
boost::shared_ptr<MatrixDouble> EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::dotNewSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 351 of file EdgeFlippingOps.hpp.

◆ gradNewSolPtr

template<AssemblyType A, IntegrationType I, int DIM>
boost::shared_ptr<MatrixDouble> EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::gradNewSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 353 of file EdgeFlippingOps.hpp.

◆ mField

template<AssemblyType A, IntegrationType I, int DIM>
MoFEM::Interface& EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::mField
private
Examples
EdgeFlippingOps.hpp.

Definition at line 355 of file EdgeFlippingOps.hpp.

◆ newSolPtr

template<AssemblyType A, IntegrationType I, int DIM>
boost::shared_ptr<MatrixDouble> EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::newSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 352 of file EdgeFlippingOps.hpp.

◆ oldSolPtr

template<AssemblyType A, IntegrationType I, int DIM>
boost::shared_ptr<MatrixDouble> EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::oldSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 354 of file EdgeFlippingOps.hpp.

◆ scalarFunction

template<AssemblyType A, IntegrationType I, int DIM>
ScalarFun EdgeFlippingOps::OpRhsSymTensorLeastSquaresProj< A, I, DIM >::scalarFunction
private
Examples
EdgeFlippingOps.hpp.

Definition at line 350 of file EdgeFlippingOps.hpp.


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