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

Rhs for mapping vector fields with a scalar basis with least squares. More...

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

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

Public Member Functions

 OpRhsH1VectorLeastSquaresProj (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::OpRhsH1VectorLeastSquaresProj< A, I, DIM >

Rhs for mapping vector fields with a scalar basis with least squares.

Definition at line 185 of file EdgeFlippingOps.hpp.

Constructor & Destructor Documentation

◆ OpRhsH1VectorLeastSquaresProj()

template<AssemblyType A, IntegrationType I, int DIM>
EdgeFlippingOps::OpRhsH1VectorLeastSquaresProj< A, I, DIM >::OpRhsH1VectorLeastSquaresProj ( 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 187 of file EdgeFlippingOps.hpp.

194 { return 1; })
196 oldSolPtr(old_sol_ptr), dotNewSolPtr(dot_new_sol_ptr),
197 newSolPtr(new_sol_ptr), gradNewSolPtr(grad_new_sol_ptr),
198 mField(m_field), scalarFunction(scalar_function) {}
constexpr auto field_name
boost::shared_ptr< MatrixDouble > gradNewSolPtr
boost::shared_ptr< MatrixDouble > oldSolPtr
boost::shared_ptr< MatrixDouble > newSolPtr
boost::shared_ptr< MatrixDouble > dotNewSolPtr

Member Function Documentation

◆ iNtegrate()

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

Definition at line 200 of file EdgeFlippingOps.hpp.

200 {
202
203 FTENSOR_INDEX(DIM, i);
204
205 const double vol = getMeasure();
206 auto t_w = getFTensor0IntegrationWeight();
207 auto t_coords = getFTensor1CoordsAtGaussPts();
208 auto t_base = data.getFTensor0N();
209 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
210
211#ifndef NDEBUG
212 if (data.getDiffN().size1() != data.getN().size1())
213 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
214 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
215 MOFEM_LOG("SELF", Sev::error)
216 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
217 MOFEM_LOG("SELF", Sev::error) << data.getN();
218 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
219 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
220 }
221#endif
222
223 auto t_old_sol = getFTensor1FromMat<SPACE_DIM>(*oldSolPtr);
224 auto t_new_sol = getFTensor1FromMat<SPACE_DIM>(*newSolPtr);
225
226 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
227
228 const double alpha =
229 t_w * vol * scalarFunction(t_coords(0), t_coords(1), t_coords(2));
230
231 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(locF);
232
233 int bb = 0;
234 for (; bb != nbRows / SPACE_DIM; ++bb) {
235 t_nf(i) += (t_base * alpha) * (t_old_sol(i));
236 ++t_base;
237 ++t_diff_base;
238 ++t_nf;
239 }
240
241 for (; bb < nbRowBaseFunctions; ++bb) {
242 ++t_base;
243 ++t_diff_base;
244 }
245
246 ++t_old_sol;
247 ++t_new_sol;
248
249 ++t_coords;
250 ++t_w;
251 }
252
254 }
#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::OpRhsH1VectorLeastSquaresProj< A, I, DIM >::dotNewSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 258 of file EdgeFlippingOps.hpp.

◆ gradNewSolPtr

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

Definition at line 260 of file EdgeFlippingOps.hpp.

◆ mField

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

Definition at line 262 of file EdgeFlippingOps.hpp.

◆ newSolPtr

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

Definition at line 259 of file EdgeFlippingOps.hpp.

◆ oldSolPtr

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

Definition at line 261 of file EdgeFlippingOps.hpp.

◆ scalarFunction

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

Definition at line 257 of file EdgeFlippingOps.hpp.


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