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

Rhs for mapping vector fields with an Hdiv basis with least squares. More...

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

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

Public Member Functions

 OpRhsHdivLeastSquaresProj (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, ScalarFun resistance_function, 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
 
ScalarFun resistanceFunction
 
MoFEM::InterfacemField
 

Detailed Description

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

Rhs for mapping vector fields with an Hdiv basis with least squares.

Definition at line 435 of file EdgeFlippingOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsHdivLeastSquaresProj()

template<AssemblyType A, IntegrationType I, int DIM>
EdgeFlippingOps::OpRhsHdivLeastSquaresProj< A, I, DIM >::OpRhsHdivLeastSquaresProj ( 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,
ScalarFun  resistance_function,
MoFEM::Interface m_field,
ScalarFun  scalar_function = [](doubledouble,                                     double) constexpr { return 1; } 
)
inline

Definition at line 437 of file EdgeFlippingOps.hpp.

444 { return 1; })
446 oldSolPtr(old_sol_ptr), dotNewSolPtr(dot_new_sol_ptr),
447 newSolPtr(new_sol_ptr), gradNewSolPtr(grad_new_sol_ptr),
448 resistanceFunction(resistance_function), mField(m_field),
449 scalarFunction(scalar_function) {}
constexpr auto field_name
boost::shared_ptr< MatrixDouble > dotNewSolPtr
boost::shared_ptr< MatrixDouble > newSolPtr
boost::shared_ptr< MatrixDouble > gradNewSolPtr
boost::shared_ptr< MatrixDouble > oldSolPtr

Member Function Documentation

◆ iNtegrate()

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

Definition at line 451 of file EdgeFlippingOps.hpp.

451 {
453
454 FTENSOR_INDEX(DIM, i);
455
456 const double vol = getMeasure();
457 auto t_w = getFTensor0IntegrationWeight();
458 auto t_coords = getFTensor1CoordsAtGaussPts();
459 auto t_base = data.getFTensor1N<3>();
460 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
461
462#ifndef NDEBUG
463 if (data.getDiffN().size1() != data.getN().size1())
464 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
465 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
466 MOFEM_LOG("SELF", Sev::error)
467 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
468 MOFEM_LOG("SELF", Sev::error) << data.getN();
469 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
470 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
471 }
472#endif
473
474 auto t_old_sol = getFTensor1FromMat<SPACE_DIM>(*oldSolPtr);
475 auto t_new_sol = getFTensor1FromMat<SPACE_DIM>(*newSolPtr);
476
477 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
478
479 const double alpha =
480 t_w * vol * scalarFunction(t_coords(0), t_coords(1), t_coords(2));
481
482 int bb = 0;
483 for (; bb != nbRows; ++bb) {
484 locF[bb] += (t_base(i) * alpha) *
485 resistanceFunction(t_coords(0), t_coords(1), t_coords(2)) *
486 (t_old_sol(i));
487 ++t_base;
488 ++t_diff_base;
489 }
490
491 for (; bb < nbRowBaseFunctions; ++bb) {
492 ++t_base;
493 ++t_diff_base;
494 }
495
496 ++t_old_sol;
497 ++t_new_sol;
498
499 ++t_coords;
500 ++t_w;
501 }
502
504 }
#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

Member Data Documentation

◆ dotNewSolPtr

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

Definition at line 508 of file EdgeFlippingOps.hpp.

◆ gradNewSolPtr

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

Definition at line 510 of file EdgeFlippingOps.hpp.

◆ mField

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

Definition at line 513 of file EdgeFlippingOps.hpp.

◆ newSolPtr

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

Definition at line 509 of file EdgeFlippingOps.hpp.

◆ oldSolPtr

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

Definition at line 511 of file EdgeFlippingOps.hpp.

◆ resistanceFunction

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

Definition at line 512 of file EdgeFlippingOps.hpp.

◆ scalarFunction

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

Definition at line 507 of file EdgeFlippingOps.hpp.


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