v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
FreeSurfaceOps::OpRhsH< I > Struct Template Reference

#include <users_modules/tutorials/vec-5/src/FreeSurfaceOps.hpp>

Inheritance diagram for FreeSurfaceOps::OpRhsH< I >:
[legend]
Collaboration diagram for FreeSurfaceOps::OpRhsH< I >:
[legend]

Public Member Functions

 OpRhsH (const std::string field_name, boost::shared_ptr< MatrixDouble > u_ptr, boost::shared_ptr< VectorDouble > dot_h_ptr, boost::shared_ptr< VectorDouble > h_ptr, boost::shared_ptr< MatrixDouble > grad_h_ptr, boost::shared_ptr< MatrixDouble > grad_g_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< MatrixDouble > uPtr
 
boost::shared_ptr< VectorDouble > dotHPtr
 
boost::shared_ptr< VectorDouble > hPtr
 
boost::shared_ptr< MatrixDouble > gradHPtr
 
boost::shared_ptr< MatrixDouble > gradGPtr
 

Detailed Description

template<bool I>
struct FreeSurfaceOps::OpRhsH< I >
Examples
free_surface.cpp.

Definition at line 599 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsH()

template<bool I>
FreeSurfaceOps::OpRhsH< I >::OpRhsH ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  u_ptr,
boost::shared_ptr< VectorDouble >  dot_h_ptr,
boost::shared_ptr< VectorDouble >  h_ptr,
boost::shared_ptr< MatrixDouble >  grad_h_ptr,
boost::shared_ptr< MatrixDouble >  grad_g_ptr 
)
inline

Definition at line 601 of file FreeSurfaceOps.hpp.

606 : AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
607 uPtr(u_ptr), dotHPtr(dot_h_ptr), hPtr(h_ptr), gradHPtr(grad_h_ptr),
608 gradGPtr(grad_g_ptr) {}
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: plastic.cpp:46
constexpr auto field_name
boost::shared_ptr< VectorDouble > hPtr
boost::shared_ptr< MatrixDouble > gradGPtr
boost::shared_ptr< MatrixDouble > uPtr
boost::shared_ptr< VectorDouble > dotHPtr
boost::shared_ptr< MatrixDouble > gradHPtr

Member Function Documentation

◆ iNtegrate()

template<bool I>
MoFEMErrorCode FreeSurfaceOps::OpRhsH< I >::iNtegrate ( EntitiesFieldData::EntData &  data)
inline

Definition at line 610 of file FreeSurfaceOps.hpp.

610 {
612
613 const double vol = getMeasure();
614 auto t_w = getFTensor0IntegrationWeight();
615 auto t_coords = getFTensor1CoordsAtGaussPts();
616 auto t_base = data.getFTensor0N();
617 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
618
619#ifndef NDEBUG
620 if(data.getDiffN().size1() != data.getN().size1())
621 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
622 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
623 MOFEM_LOG("SELF", Sev::error)
624 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
625 MOFEM_LOG("SELF", Sev::error) << data.getN();
626 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
627 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
628 }
629#endif
630
631 if constexpr (I) {
632
633 auto t_h = getFTensor0FromVec(*hPtr);
634 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*gradGPtr);
635
636 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
637
638 const double r = t_coords(0);
639 const double alpha = t_w * vol * cylindrical(r);
640
641 const double set_h = init_h(t_coords(0), t_coords(1), t_coords(2));
642 const double m = get_M(set_h) * alpha;
643
644 int bb = 0;
645 for (; bb != nbRows; ++bb) {
646 locF[bb] += (t_base * alpha) * (t_h - set_h);
647 locF[bb] += (t_diff_base(i) * m) * t_grad_g(i);
648 ++t_base;
649 ++t_diff_base;
650 }
651
652 for (; bb < nbRowBaseFunctions; ++bb) {
653 ++t_base;
654 ++t_diff_base;
655 }
656
657 ++t_h;
658 ++t_grad_g;
659
660 ++t_coords;
661 ++t_w;
662 }
663
664 } else {
665
666 auto t_dot_h = getFTensor0FromVec(*dotHPtr);
667 auto t_h = getFTensor0FromVec(*hPtr);
668 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*uPtr);
669 auto t_grad_h = getFTensor1FromMat<SPACE_DIM>(*gradHPtr);
670 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*gradGPtr);
671
672 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
673
674 const double r = t_coords(0);
675 const double alpha = t_w * vol * cylindrical(r);
676
677 const double m = get_M(t_h) * alpha;
678
679 int bb = 0;
680 for (; bb != nbRows; ++bb) {
681 locF[bb] += (t_base * alpha) * (t_dot_h);
682 locF[bb] += (t_base * alpha) * (t_grad_h(i) * t_u(i));
683 locF[bb] += (t_diff_base(i) * t_grad_g(i)) * m;
684 ++t_base;
685 ++t_diff_base;
686 }
687
688 for (; bb < nbRowBaseFunctions; ++bb) {
689 ++t_base;
690 ++t_diff_base;
691 }
692
693 ++t_dot_h;
694 ++t_h;
695 ++t_grad_g;
696 ++t_u;
697 ++t_grad_h;
698
699 ++t_coords;
700 ++t_w;
701 }
702 }
703
705 }
static Index< 'I', 3 > I
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'm', SPACE_DIM > m
auto cylindrical
auto init_h
auto get_M
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:301
FTensor::Index< 'i', SPACE_DIM > i
const double r
rate factor

Member Data Documentation

◆ dotHPtr

template<bool I>
boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsH< I >::dotHPtr
private

Definition at line 709 of file FreeSurfaceOps.hpp.

◆ gradGPtr

template<bool I>
boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsH< I >::gradGPtr
private

Definition at line 712 of file FreeSurfaceOps.hpp.

◆ gradHPtr

template<bool I>
boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsH< I >::gradHPtr
private

Definition at line 711 of file FreeSurfaceOps.hpp.

◆ hPtr

template<bool I>
boost::shared_ptr<VectorDouble> FreeSurfaceOps::OpRhsH< I >::hPtr
private

Definition at line 710 of file FreeSurfaceOps.hpp.

◆ uPtr

template<bool I>
boost::shared_ptr<MatrixDouble> FreeSurfaceOps::OpRhsH< I >::uPtr
private

Definition at line 708 of file FreeSurfaceOps.hpp.


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