FieldNorms Class Reference

AMR-Wind API: amr_wind::field_norms::FieldNorms Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <FieldNorms.H>

Inheritance diagram for amr_wind::field_norms::FieldNorms:
[legend]
Collaboration diagram for amr_wind::field_norms::FieldNorms:
[legend]

Public Member Functions

 FieldNorms (CFDSim &, std::string)
 
 ~FieldNorms () override
 
void pre_init_actions () override
 Perform actions before mesh is created.
 
void initialize () override
 Read user inputs and create the different data probe instances.
 
void post_advance_work () override
 Interpolate fields at a given timestep and output to disk.
 
void post_regrid_actions () override
 
const amrex::Vector< std::string > & var_names () const
 
const amrex::Vector< amrex::Real > & field_norms () const
 

Static Public Member Functions

static std::string identifier ()
 
static amrex::Real l2_norm (amr_wind::Field &field, const int comp, const bool use_mask)
 calculate the L2 norm of a given field and component
 

Private Member Functions

virtual void prepare_ascii_file ()
 prepare ASCII file and directory
 
virtual void write_ascii ()
 Output sampled data in ASCII format.
 
void process_field_norms ()
 process all fields and calculate norms
 

Private Attributes

CFDSimm_sim
 Reference to the CFD sim.
 
amrex::Vector< std::string > m_var_names
 List of variable names for output.
 
amrex::Vector< amrex::Real > m_fnorms
 List holding norms for all fields and their components.
 
const std::string m_label
 
std::string m_out_fname
 filename for ASCII output
 
int m_out_freq {10}
 Frequency of data sampling and output.
 
int m_width {18}
 width in ASCII output
 
int m_precision {12}
 precision in ASCII output
 
bool m_use_mask {true}
 Mask redundant grids (finest available grid only)
 

Detailed Description

field norm object

A concrete implementation of the post-processing interface that deals with norms of fields. FIXME: need to update this

Constructor & Destructor Documentation

◆ FieldNorms()

amr_wind::field_norms::FieldNorms::FieldNorms ( CFDSim & sim,
std::string label )

◆ ~FieldNorms()

amr_wind::field_norms::FieldNorms::~FieldNorms ( )
overridedefault

Member Function Documentation

◆ field_norms()

const amrex::Vector< amrex::Real > & amr_wind::field_norms::FieldNorms::field_norms ( ) const
inline

◆ identifier()

static std::string amr_wind::field_norms::FieldNorms::identifier ( )
inlinestatic

◆ initialize()

void amr_wind::field_norms::FieldNorms::initialize ( )
override

Read user inputs and create the different data probe instances.

◆ l2_norm()

amrex::Real amr_wind::field_norms::FieldNorms::l2_norm ( amr_wind::Field & field,
const int comp,
const bool use_mask )
static

calculate the L2 norm of a given field and component

◆ post_advance_work()

void amr_wind::field_norms::FieldNorms::post_advance_work ( )
override

Interpolate fields at a given timestep and output to disk.

◆ post_regrid_actions()

void amr_wind::field_norms::FieldNorms::post_regrid_actions ( )
inlineoverride

◆ pre_init_actions()

void amr_wind::field_norms::FieldNorms::pre_init_actions ( )
inlineoverride

Perform actions before mesh is created.

◆ prepare_ascii_file()

void amr_wind::field_norms::FieldNorms::prepare_ascii_file ( )
privatevirtual

prepare ASCII file and directory

◆ process_field_norms()

void amr_wind::field_norms::FieldNorms::process_field_norms ( )
private

process all fields and calculate norms

◆ var_names()

const amrex::Vector< std::string > & amr_wind::field_norms::FieldNorms::var_names ( ) const
inline

◆ write_ascii()

void amr_wind::field_norms::FieldNorms::write_ascii ( )
privatevirtual

Output sampled data in ASCII format.

Member Data Documentation

◆ m_fnorms

amrex::Vector<amrex::Real> amr_wind::field_norms::FieldNorms::m_fnorms
private

List holding norms for all fields and their components.

◆ m_label

const std::string amr_wind::field_norms::FieldNorms::m_label
private

Name of this sampling object.

The label is used to read user inputs from file and is also used for naming files directories depending on the output format.

◆ m_out_fname

std::string amr_wind::field_norms::FieldNorms::m_out_fname
private

filename for ASCII output

◆ m_out_freq

int amr_wind::field_norms::FieldNorms::m_out_freq {10}
private

Frequency of data sampling and output.

◆ m_precision

int amr_wind::field_norms::FieldNorms::m_precision {12}
private

precision in ASCII output

◆ m_sim

CFDSim& amr_wind::field_norms::FieldNorms::m_sim
private

Reference to the CFD sim.

◆ m_use_mask

bool amr_wind::field_norms::FieldNorms::m_use_mask {true}
private

Mask redundant grids (finest available grid only)

◆ m_var_names

amrex::Vector<std::string> amr_wind::field_norms::FieldNorms::m_var_names
private

List of variable names for output.

◆ m_width

int amr_wind::field_norms::FieldNorms::m_width {18}
private

width in ASCII output


The documentation for this class was generated from the following files:
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/FieldNorms.H
  • /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/FieldNorms.cpp