v0.13.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP > Struct Template Reference

Scale base functions by inverses of measure of element. More...

#include <src/finite_elements/HODataOperators.hpp>

Inheritance diagram for MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >:
[legend]
Collaboration diagram for MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >:
[legend]

Public Member Functions

 OpScaleBaseBySpaceInverseOfMeasure (boost::shared_ptr< VectorDouble > det_jac_ptr, const FieldSpace space=L2)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Private Attributes

FieldSpace fieldSpace
 
boost::shared_ptr< VectorDoubledetJacPtr
 

Detailed Description

template<typename OP>
struct MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >

Scale base functions by inverses of measure of element.

Template Parameters
OP
Examples
plastic.cpp.

Definition at line 364 of file HODataOperators.hpp.

Constructor & Destructor Documentation

◆ OpScaleBaseBySpaceInverseOfMeasure()

template<typename OP >
MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >::OpScaleBaseBySpaceInverseOfMeasure ( boost::shared_ptr< VectorDouble det_jac_ptr,
const FieldSpace  space = L2 
)
inline

Definition at line 366 of file HODataOperators.hpp.

368 : OP(space), fieldSpace(space), detJacPtr(det_jac_ptr) {}
boost::shared_ptr< VectorDouble > detJacPtr

Member Function Documentation

◆ doWork()

template<typename OP >
MoFEMErrorCode MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
inline

Definition at line 370 of file HODataOperators.hpp.

371 {
373
374 if (!detJacPtr) {
375 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "detJacPtr not set");
376 }
377
378 auto scale = [&]() {
379 for (int b = AINSWORTH_LEGENDRE_BASE; b != USER_BASE; b++) {
381 auto &base_fun = data.getN(base);
382 auto &diff_base_fun = data.getDiffN(base);
383 if (detJacPtr) {
384
385 auto &det_vec = *detJacPtr;
386 const auto nb_int_pts = base_fun.size1();
387
388 if (nb_int_pts != det_vec.size())
389 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
390 "Number of integration pts in detJacPtr does not mush "
391 "number of integration pts in base function");
392
393 auto get_row = [](auto &m, auto gg) {
394 return ublas::matrix_row<decltype(m)>(m, gg);
395 };
396
397 for (auto gg = 0; gg != nb_int_pts; ++gg)
398 get_row(base_fun) /= det_vec[gg];
399
400 if (diff_base_fun.size1() == nb_int_pts) {
401 for (auto gg = 0; gg != nb_int_pts; ++gg)
402 get_row(diff_base_fun) /= det_vec[gg];
403 }
404 }
405 }
406 };
407
408 if (this->getFEDim() == 3) {
409 switch (fieldSpace) {
410 case H1:
411 scale();
412 break;
413 case HCURL:
414 if (type >= MBEDGE)
415 scale();
416 break;
417 case HDIV:
418 if (type >= MBTRI)
419 scale();
420 break;
421 case L2:
422 if (type >= MBTET)
423 scale();
424 break;
425 default:
426 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "impossible case");
427 }
428 } else if (this->getFEDim() == 2) {
429 switch (fieldSpace) {
430 case H1:
431 scale();
432 break;
433 case HCURL:
434 if (type >= MBEDGE)
435 scale();
436 break;
437 case HDIV:
438 case L2:
439 if (type >= MBTRI)
440 scale();
441 break;
442 default:
443 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "impossible case");
444 }
445 } else if (this->getFEDim() == 1) {
446 switch (fieldSpace) {
447 case H1:
448 scale();
449 break;
450 case HCURL:
451 case L2:
452 if (type >= MBEDGE)
453 scale();
454 break;
455 default:
456 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "impossible case");
457 }
458 } else {
459 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "impossible case");
460 }
461
463 }
FieldApproximationBase
approximation base
Definition: definitions.h:58
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
@ USER_BASE
user implemented approximation base
Definition: definitions.h:68
@ L2
field with C-1 continuity
Definition: definitions.h:88
@ H1
continuous field
Definition: definitions.h:85
@ HCURL
field with continuous tangents
Definition: definitions.h:86
@ HDIV
field with continuous normal traction
Definition: definitions.h:87
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_IMPOSSIBLE_CASE
Definition: definitions.h:35
@ 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
double scale
Definition: plastic.cpp:97

Member Data Documentation

◆ detJacPtr

template<typename OP >
boost::shared_ptr<VectorDouble> MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >::detJacPtr
private

Definition at line 467 of file HODataOperators.hpp.

◆ fieldSpace

template<typename OP >
FieldSpace MoFEM::OpScaleBaseBySpaceInverseOfMeasure< OP >::fieldSpace
private

Definition at line 466 of file HODataOperators.hpp.


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