Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time-dependent Envelope #11

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

filliong
Copy link

These commits implement a new class Envelope that is used to generate a time envelope on the electromagnetic field. Each Envelope model is a function with values varying in time in [0,1]. This functions multiplies the electromagnetic field. The targeted application of the envelope is to ensure that the electromagnetic is zero at the initial time. Right now, there are two envelope models: NoEnvelope and EnvelopeHann (cos squared). Other models can be simply added using inheritance.

@joeydumont
Copy link
Owner

joeydumont commented Dec 22, 2018

The envelope should NOT be added in the Particle constructor. While it is badly named, in retrospect, Particle describes the motion of particle in a given electromagnetic field. The envelope is a property of the electromagnetic field, NOT of the motion of the particle.

This breaks backwards compatibility, and forces us to make unnecessary changes to all of the drivers and tests.

As an additional property of an electromagnetic field, Envelope should be a full-fledged electromagnetic field in its own right. This can be achieved through composition (see the StrattoCalculator's field models for examples). In short, you'd have something like this

template <class FieldModel>
class EnvelopeFieldModel
{
public:
    EnvelopeFieldModel(FieldModel & my_field_model,
                                      my_envelope_field_model_parameters...)
    {
    ...
    }

    std::array<double,6> ComputeFieldComponents(t,x,y,z) const
    {
        my_field = my_field_model.ComputeFieldComponents(t,x,y,z);
        
        for (auto&& element : my_field)
        {
            element *= envelope_value(t)
        }
        ....
    }
};

@joeydumont
Copy link
Owner

The new plot seems like a good idea. Would you mind showing an example?

@filliong
Copy link
Author

The new plot seems like a good idea. Would you mind showing an example?

particle_directions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants