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

Filter for scalar fields. More...

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

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

Public Member Functions

 filterScalarSolution (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, ScalarFun scalar_function=[](double, double, double) constexpr { return 1;})
 
MoFEMErrorCode doWork (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
 

Detailed Description

template<AssemblyType A, IntegrationType I>
struct EdgeFlippingOps::filterScalarSolution< A, I >

Filter for scalar fields.

Definition at line 20 of file EdgeFlippingOps.hpp.

Constructor & Destructor Documentation

◆ filterScalarSolution()

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

Definition at line 22 of file EdgeFlippingOps.hpp.

28 { return 1; })
30 oldSolPtr(old_sol_ptr), dotNewSolPtr(dot_new_sol_ptr),
31 newSolPtr(new_sol_ptr), gradNewSolPtr(grad_new_sol_ptr),
32 scalarFunction(scalar_function) {}
constexpr auto field_name
boost::shared_ptr< VectorDouble > dotNewSolPtr
boost::shared_ptr< VectorDouble > newSolPtr
boost::shared_ptr< MatrixDouble > gradNewSolPtr
boost::shared_ptr< VectorDouble > oldSolPtr

Member Function Documentation

◆ doWork()

template<AssemblyType A, IntegrationType I>
MoFEMErrorCode EdgeFlippingOps::filterScalarSolution< A, I >::doWork ( EntitiesFieldData::EntData &  data)
inline
Examples
EdgeFlippingOps.hpp.

Definition at line 34 of file EdgeFlippingOps.hpp.

34 {
36
37 const double vol = getMeasure();
38 auto t_w = getFTensor0IntegrationWeight();
39 auto t_coords = getFTensor1CoordsAtGaussPts();
40 auto t_base = data.getFTensor0N();
41 auto t_diff_base = data.getFTensor1DiffN<SPACE_DIM>();
42
43#ifndef NDEBUG
44 if (data.getDiffN().size1() != data.getN().size1())
45 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 1");
46 if (data.getDiffN().size2() != data.getN().size2() * SPACE_DIM) {
47 MOFEM_LOG("SELF", Sev::error)
48 << "Side " << rowSide << " " << CN::EntityTypeName(rowType);
49 MOFEM_LOG("SELF", Sev::error) << data.getN();
50 MOFEM_LOG("SELF", Sev::error) << data.getDiffN();
51 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong size 2");
52 }
53#endif
54
55 auto t_old_sol = getFTensor0FromVec(*oldSolPtr);
56 auto t_new_sol = getFTensor0FromVec(*newSolPtr);
57
58 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
59
60 const double alpha =
61 t_w * scalarFunction(t_coords(0), t_coords(1), t_coords(2));
62
63 int bb = 0;
64 for (; bb != nbRows; ++bb) {
65 t_old_sol += alpha * t_old_sol;
66
67 if (t_w > 0.0)
68 continue;
69 if (t_w > 0.0 && t_old_sol < fabs(1e-12))
70 continue;
71 if (t_w < fabs(1e-12))
72 continue;
73 ++t_base;
74 ++t_diff_base;
75 }
76
77 for (; bb < nbRowBaseFunctions; ++bb) {
78 ++t_base;
79 ++t_diff_base;
80 }
81
82 ++t_old_sol;
83 ++t_new_sol;
84
85 ++t_coords;
86 ++t_w;
87 }
88
90 }
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>
boost::shared_ptr<VectorDouble> EdgeFlippingOps::filterScalarSolution< A, I >::dotNewSolPtr
private
Examples
EdgeFlippingOps.hpp.

Definition at line 94 of file EdgeFlippingOps.hpp.

◆ gradNewSolPtr

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

Definition at line 96 of file EdgeFlippingOps.hpp.

◆ newSolPtr

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

Definition at line 95 of file EdgeFlippingOps.hpp.

◆ oldSolPtr

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

Definition at line 97 of file EdgeFlippingOps.hpp.

◆ scalarFunction

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

Definition at line 93 of file EdgeFlippingOps.hpp.


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