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

Rhs for mapping scalar fields with least squares. More...

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

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

Public Member Functions

 OpRhsScalarLeastSquaresProj (const std::string field_name, boost::shared_ptr< VectorDouble > old_sol_ptr, boost::shared_ptr< VectorDouble > dot_new_sol_ptr, boost::shared_ptr< VectorDouble > 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< VectorDouble > dotNewSolPtr
 
boost::shared_ptr< VectorDouble > newSolPtr
 
boost::shared_ptr< MatrixDouble > gradNewSolPtr
 
boost::shared_ptr< VectorDouble > oldSolPtr
 
MoFEM::InterfacemField
 

Detailed Description

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

Rhs for mapping scalar fields with least squares.

Examples
SolutionMapping.hpp.

Definition at line 105 of file EdgeFlippingOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsScalarLeastSquaresProj()

template<AssemblyType A, IntegrationType I, int DIM>
EdgeFlippingOps::OpRhsScalarLeastSquaresProj< A, I, DIM >::OpRhsScalarLeastSquaresProj ( const std::string  field_name,
boost::shared_ptr< VectorDouble >  old_sol_ptr,
boost::shared_ptr< VectorDouble >  dot_new_sol_ptr,
boost::shared_ptr< VectorDouble >  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 107 of file EdgeFlippingOps.hpp.

114 { return 1; })
116 oldSolPtr(old_sol_ptr), dotNewSolPtr(dot_new_sol_ptr),
117 newSolPtr(new_sol_ptr), gradNewSolPtr(grad_new_sol_ptr),
118 mField(m_field), scalarFunction(scalar_function) {}
constexpr auto field_name
boost::shared_ptr< MatrixDouble > gradNewSolPtr
boost::shared_ptr< VectorDouble > newSolPtr
boost::shared_ptr< VectorDouble > oldSolPtr
boost::shared_ptr< VectorDouble > dotNewSolPtr

Member Function Documentation

◆ iNtegrate()

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

Definition at line 120 of file EdgeFlippingOps.hpp.

120 {
122
123 const double vol = getMeasure();
124 auto t_w = getFTensor0IntegrationWeight();
125 auto t_coords = getFTensor1CoordsAtGaussPts();
126 auto t_base = data.getFTensor0N();
127 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
128
129#ifndef NDEBUG
130 if (data.getDiffN().size1() != data.getN().size1())
131 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
132 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
133 MOFEM_LOG("SELF", Sev::error)
134 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
135 MOFEM_LOG("SELF", Sev::error) << data.getN();
136 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
137 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
138 }
139#endif
140
141 auto t_old_sol = getFTensor0FromVec(*oldSolPtr);
142 auto t_new_sol = getFTensor0FromVec(*newSolPtr);
143
144 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
145
146 const double alpha =
147 t_w * vol * scalarFunction(t_coords(0), t_coords(1), t_coords(2));
148
149 int bb = 0;
150 for (; bb != nbRows; ++bb) {
151 locF[bb] += (t_base * alpha) * (t_old_sol);
152 ++t_base;
153 ++t_diff_base;
154 }
155
156 for (; bb < nbRowBaseFunctions; ++bb) {
157 ++t_base;
158 ++t_diff_base;
159 }
160
161 ++t_old_sol;
162 ++t_new_sol;
163
164 ++t_coords;
165 ++t_w;
166 }
167
169 }
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.

Member Data Documentation

◆ dotNewSolPtr

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

Definition at line 173 of file EdgeFlippingOps.hpp.

◆ gradNewSolPtr

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

Definition at line 175 of file EdgeFlippingOps.hpp.

◆ mField

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

Definition at line 177 of file EdgeFlippingOps.hpp.

◆ newSolPtr

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

Definition at line 174 of file EdgeFlippingOps.hpp.

◆ oldSolPtr

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

Definition at line 176 of file EdgeFlippingOps.hpp.

◆ scalarFunction

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

Definition at line 172 of file EdgeFlippingOps.hpp.


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