idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.7k stars 1.04k forks source link

Evaluate Curl in MooseParsedVectorFunction #13041

Closed cticenhour closed 5 years ago

cticenhour commented 5 years ago

Rationale

When calculating the scattered electromagnetic field resulting from an incoming field wave, general absorbing boundary conditions often require both the value of the incoming field as well as its curl (see an absorbing BC example proposed in Jin's The Finite Element Method for Electromagnetics 3rd Ed, Chapter 9). I have been using MooseParsedVectorFunction to define my incoming field for use in BC. Currently, it only provides the value of the field vector. I propose adding a vectorCurl virtual function to allow for the evaluation of the curl given user-provided curl components, similar to how the gradient is evaluated in MooseParsedGradFunction.

Description

A new vectorCurl virtual function would need to be added to the Function class, and overridden in MooseParsedVectorFunction. _curl_value and _curl_function_ptr would be added to store the input functions and point to the parsed function wrapper object for the curl. No changes should be needed in MooseParsedFunctionWrapper (I think).

Impact

New capability.

permcody commented 5 years ago

This seems alright to me. Can you possibly add a unit or regression test so that we hit those new lines of code?

cticenhour commented 5 years ago

Currently working on a test for it. Hopefully I can get the formal PR submitted today.