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

Lhs for H dH. More...

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

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

Public Member Functions

 OpLhsH_dH (const std::string field_name, boost::shared_ptr< MatrixDouble > u_ptr, boost::shared_ptr< VectorDouble > h_ptr, boost::shared_ptr< MatrixDouble > grad_g_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

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

Detailed Description

template<bool I>
struct FreeSurfaceOps::OpLhsH_dH< I >

Lhs for H dH.

Examples
free_surface.cpp.

Definition at line 773 of file FreeSurfaceOps.hpp.

Constructor & Destructor Documentation

◆ OpLhsH_dH()

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

Definition at line 775 of file FreeSurfaceOps.hpp.

779 AssemblyDomainEleOp::OPROWCOL),
780 uPtr(u_ptr), hPtr(h_ptr), gradGPtr(grad_g_ptr) {
781 sYmm = false;
782 }
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: plastic.cpp:46
constexpr auto field_name
boost::shared_ptr< MatrixDouble > uPtr
boost::shared_ptr< MatrixDouble > gradGPtr
boost::shared_ptr< VectorDouble > hPtr

Member Function Documentation

◆ iNtegrate()

template<bool I>
MoFEMErrorCode FreeSurfaceOps::OpLhsH_dH< I >::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
inline

Definition at line 784 of file FreeSurfaceOps.hpp.

785 {
787
788 const double vol = getMeasure();
789 auto t_w = getFTensor0IntegrationWeight();
790 auto t_coords = getFTensor1CoordsAtGaussPts();
791 auto t_row_base = row_data.getFTensor0N();
792 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
793
794#ifndef NDEBUG
795 if (row_data.getDiffN().size1() != row_data.getN().size1())
796 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
797 if (row_data.getDiffN().size2() != row_data.getN().size2() * SPACE_DIM) {
798 MOFEM_LOG("SELF", Sev::error)
799 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
800 MOFEM_LOG("SELF", Sev::error) << row_data.getN();
801 MOFEM_LOG("SELF", Sev::error) << row_data.getDiffN();
802 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
803 }
804
805 if (col_data.getDiffN().size1() != col_data.getN().size1())
806 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
807 if (col_data.getDiffN().size2() != col_data.getN().size2() * SPACE_DIM) {
808 MOFEM_LOG("SELF", Sev::error)
809 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
810 MOFEM_LOG("SELF", Sev::error) << col_data.getN();
811 MOFEM_LOG("SELF", Sev::error) << col_data.getDiffN();
812 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
813 }
814#endif
815
816 if constexpr (I) {
817
818 auto t_h = getFTensor0FromVec(*hPtr);
819 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*gradGPtr);
820
821 for (int gg = 0; gg != nbIntegrationPts; gg++) {
822
823 const double r = t_coords(0);
824 const double alpha = t_w * vol * cylindrical(r);
825
826 int rr = 0;
827 for (; rr != nbRows; ++rr) {
828
829 auto t_col_base = col_data.getFTensor0N(gg, 0);
830 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
831
832 for (int cc = 0; cc != nbCols; ++cc) {
833
834 locMat(rr, cc) += (t_row_base * t_col_base * alpha);
835
836 ++t_col_base;
837 ++t_col_diff_base;
838 }
839
840 ++t_row_base;
841 ++t_row_diff_base;
842 }
843
844 for (; rr < nbRowBaseFunctions; ++rr) {
845 ++t_row_base;
846 ++t_row_diff_base;
847 }
848
849 ++t_h;
850 ++t_grad_g;
851 ++t_w;
852 ++t_coords;
853 }
854
855 } else {
856
857 auto t_h = getFTensor0FromVec(*hPtr);
858 auto t_grad_g = getFTensor1FromMat<SPACE_DIM>(*gradGPtr);
859 auto t_u = getFTensor1FromMat<U_FIELD_DIM>(*uPtr);
860
861 auto ts_a = getTSa();
862
863 for (int gg = 0; gg != nbIntegrationPts; gg++) {
864
865 const double r = t_coords(0);
866 const double alpha = t_w * vol * cylindrical(r);
867
868 auto m_dh = get_M_dh(t_h) * alpha;
869 int rr = 0;
870 for (; rr != nbRows; ++rr) {
871
872 auto t_col_base = col_data.getFTensor0N(gg, 0);
873 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
874
875 for (int cc = 0; cc != nbCols; ++cc) {
876
877 locMat(rr, cc) += (t_row_base * t_col_base * alpha) * ts_a;
878 locMat(rr, cc) +=
879 (t_row_base * alpha) * (t_col_diff_base(i) * t_u(i));
880 locMat(rr, cc) +=
881 (t_row_diff_base(i) * t_grad_g(i)) * (t_col_base * m_dh);
882
883 ++t_col_base;
884 ++t_col_diff_base;
885 }
886
887 ++t_row_base;
888 ++t_row_diff_base;
889 }
890
891 for (; rr < nbRowBaseFunctions; ++rr) {
892 ++t_row_base;
893 ++t_row_diff_base;
894 }
895
896 ++t_u;
897 ++t_h;
898 ++t_grad_g;
899 ++t_w;
900 ++t_coords;
901 }
902 }
903
905 }
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
auto cylindrical
auto get_M_dh
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:301
FTensor::Index< 'i', SPACE_DIM > i
const double r
rate factor

Member Data Documentation

◆ gradGPtr

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

Definition at line 910 of file FreeSurfaceOps.hpp.

◆ hPtr

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

Definition at line 909 of file FreeSurfaceOps.hpp.

◆ uPtr

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

Definition at line 908 of file FreeSurfaceOps.hpp.


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