Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Nektar::FieldUtils::ProcessBoundaryExtract Class Reference

This processing module sets up for the boundary field to be extracted. More...

#include <ProcessBoundaryExtract.h>

Inheritance diagram for Nektar::FieldUtils::ProcessBoundaryExtract:
[legend]

Public Member Functions

 ProcessBoundaryExtract (FieldSharedPtr f)
 
 ~ProcessBoundaryExtract () override
 
- Public Member Functions inherited from Nektar::FieldUtils::ProcessModule
 ProcessModule ()
 
 ProcessModule (FieldSharedPtr p_f)
 
- Public Member Functions inherited from Nektar::FieldUtils::Module
FIELD_UTILS_EXPORT Module (FieldSharedPtr p_f)
 
virtual ~Module ()=default
 
void Process (po::variables_map &vm)
 
std::string GetModuleName ()
 
std::string GetModuleDescription ()
 
const ConfigOptionGetConfigOption (const std::string &key) const
 
ModulePriority GetModulePriority ()
 
std::vector< ModuleKeyGetModulePrerequisites ()
 
FIELD_UTILS_EXPORT void RegisterConfig (std::string key, std::string value="")
 Register a configuration option with a module. More...
 
FIELD_UTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
FIELD_UTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
FIELD_UTILS_EXPORT void AddFile (std::string fileType, std::string fileName)
 
FIELD_UTILS_EXPORT void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 

Static Public Member Functions

static std::shared_ptr< Modulecreate (FieldSharedPtr f)
 Creates an instance of this class. More...
 

Static Public Attributes

static ModuleKey className
 

Protected Member Functions

void v_Process (po::variables_map &vm) override
 
std::string v_GetModuleName () override
 
std::string v_GetModuleDescription () override
 
ModulePriority v_GetModulePriority () override
 
- Protected Member Functions inherited from Nektar::FieldUtils::Module
 Module ()
 
virtual void v_Process (po::variables_map &vm)
 
virtual std::string v_GetModuleName ()
 
virtual std::string v_GetModuleDescription ()
 
virtual ModulePriority v_GetModulePriority ()
 
virtual std::vector< ModuleKeyv_GetModulePrerequisites ()
 

Additional Inherited Members

- Public Attributes inherited from Nektar::FieldUtils::Module
FieldSharedPtr m_f
 Field object. More...
 
- Protected Attributes inherited from Nektar::FieldUtils::Module
std::map< std::string, ConfigOptionm_config
 List of configuration values. More...
 
std::set< std::string > m_allowedFiles
 List of allowed file formats. More...
 

Detailed Description

This processing module sets up for the boundary field to be extracted.

Definition at line 46 of file ProcessBoundaryExtract.h.

Constructor & Destructor Documentation

◆ ProcessBoundaryExtract()

Nektar::FieldUtils::ProcessBoundaryExtract::ProcessBoundaryExtract ( FieldSharedPtr  f)

Definition at line 52 of file ProcessBoundaryExtract.cpp.

53 : ProcessModule(f)
54{
55 // set up dafault values.
56 m_config["bnd"] = ConfigOption(false, "All", "Boundary to be processed");
57 m_config["addnormals"] = ConfigOption(true, "0", "Add normals to output");
58
59 f->m_writeBndFld = true;
60 f->m_declareExpansionAsContField = true;
61 f->m_requireBoundaryExpansion = true;
62}
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272

References Nektar::FieldUtils::Module::m_config.

◆ ~ProcessBoundaryExtract()

Nektar::FieldUtils::ProcessBoundaryExtract::~ProcessBoundaryExtract ( )
override

Definition at line 64 of file ProcessBoundaryExtract.cpp.

65{
66}

Member Function Documentation

◆ create()

static std::shared_ptr< Module > Nektar::FieldUtils::ProcessBoundaryExtract::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 50 of file ProcessBoundaryExtract.h.

51 {
53 }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ v_GetModuleDescription()

std::string Nektar::FieldUtils::ProcessBoundaryExtract::v_GetModuleDescription ( )
inlineoverrideprotectedvirtual

◆ v_GetModuleName()

std::string Nektar::FieldUtils::ProcessBoundaryExtract::v_GetModuleName ( )
inlineoverrideprotectedvirtual

◆ v_GetModulePriority()

ModulePriority Nektar::FieldUtils::ProcessBoundaryExtract::v_GetModulePriority ( )
inlineoverrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Definition at line 72 of file ProcessBoundaryExtract.h.

73 {
74 return eBndExtraction;
75 }

References Nektar::FieldUtils::eBndExtraction.

◆ v_Process()

void Nektar::FieldUtils::ProcessBoundaryExtract::v_Process ( po::variables_map &  vm)
overrideprotectedvirtual

Reimplemented from Nektar::FieldUtils::Module.

Reimplemented in Nektar::FieldUtils::ProcessDisplacement, Nektar::FieldUtils::ProcessScalGrad, Nektar::FieldUtils::ProcessSurfDistance, Nektar::FieldUtils::ProcessWallNormalData, and Nektar::FieldUtils::ProcessWSS.

Definition at line 68 of file ProcessBoundaryExtract.cpp.

69{
70 m_f->SetUpExp(vm);
71
72 m_f->m_addNormals = m_config["addnormals"].as<bool>();
73
74 // Set up Field options to output boundary fld
75 string bvalues = m_config["bnd"].as<string>();
76
77 vector<unsigned int> bndRegions;
78 if (boost::iequals(bvalues, "All"))
79 {
80 int numBndExp = 0;
81
82 SpatialDomains::BoundaryConditions bcs(m_f->m_session,
83 m_f->m_exp[0]->GetGraph());
85 bcs.GetBoundaryRegions();
86
87 for (auto &breg_it : bregions)
88 {
89 numBndExp = max(numBndExp, breg_it.first);
90 }
91 // assuming all boundary regions are consecutive number if
92 // regions is one more than maximum id
93 numBndExp++;
94
95 // not all partitions in parallel touch all boundaries so
96 // find maximum number of boundaries
97 m_f->m_comm->GetSpaceComm()->AllReduce(numBndExp,
99
100 // THis presumes boundary regions are numbered consecutively
101 for (int i = 0; i < numBndExp; ++i)
102 {
103 bndRegions.push_back(i);
104 }
105 }
106 else
107 {
108 ASSERTL0(ParseUtils::GenerateVector(bvalues, bndRegions),
109 "Failed to interpret bnd values string");
110 }
111
112 if (m_f->m_bndRegionsToWrite.size())
113 {
114 // This was already called. Just check if the bnd option is the same
115 ASSERTL0(m_f->m_bndRegionsToWrite == bndRegions,
116 "Incompatible bnd parameters.");
117 }
118 else
119 {
120 m_f->m_bndRegionsToWrite = bndRegions;
121
122 if (m_f->m_exp[0]->GetNumElmts() != 0)
123 {
124 for (int i = 0; i < m_f->m_exp.size(); ++i)
125 {
126 m_f->m_exp[i]->FillBndCondFromField(m_f->m_exp[i]->GetCoeffs());
127 }
128 }
129 }
130}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
Definition: ParseUtils.cpp:130
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:210

References ASSERTL0, Nektar::ParseUtils::GenerateVector(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, and Nektar::LibUtilities::ReduceMax.

Referenced by Nektar::FieldUtils::ProcessBodyFittedVelocity::v_Process(), Nektar::FieldUtils::ProcessDisplacement::v_Process(), Nektar::FieldUtils::ProcessScalGrad::v_Process(), Nektar::FieldUtils::ProcessSurfDistance::v_Process(), Nektar::FieldUtils::ProcessWallNormalData::v_Process(), and Nektar::FieldUtils::ProcessWSS::v_Process().

Member Data Documentation

◆ className

ModuleKey Nektar::FieldUtils::ProcessBoundaryExtract::className
static
Initial value:
=
"Extract Boundary field")
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:197
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:180
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:47

Definition at line 54 of file ProcessBoundaryExtract.h.