Skip to content

File weights.h

File List > code_source > cosmolattice > include > CosmoInterface > definitions > defectsmodule > weights.h

Go to the documentation of this file

#ifndef COSMOINTERFACE_DEFINITIONS_DEFECTSMODULE_WEIGHTS_H
#define COSMOINTERFACE_DEFINITIONS_DEFECTSMODULE_WEIGHTS_H

/* This file is part of CosmoLattice, available at www.cosmolattice.net .
 *   Copyright Daniel G. Figueroa, Adrien Florio, Francisco Torrenti and Wessel Valkenburg.
 *   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Jorge Baeza-Ballesteros,  Year: 2026


#include "TempLat/util/exception.h"
#include "CosmoInterface/evolvers/evolver.h"

namespace TempLat
{

    class Weights
    {
    public:
        // Put public methods here. These should change very little over time.

        Weights() = delete;

        template<typename Model>
        static auto weightScalarSinglet(Model &model)
        {
            return 4 * Potential::potential(model) *  heaviside(1 - sqrt(Total(i, 0_c, Model::Ns - 1, pow<2>(model.fldS(i)); )) ) / model.resolutionPreservingFactor;
        }

        template<typename Model>
        static auto weightComplexScalar(Model &model)
        {
            return 4 * Potential::potential(model) * heaviside(0.5 - norm2(model.fldCS(0_c))) / model.resolutionPreservingFactor;
        }

    };


} // namespace TempLat

#endif