Skip to content

Commit

Permalink
Implement nodal interpolation transfer closes #1879
Browse files Browse the repository at this point in the history
r17957
  • Loading branch information
friedmud authored and permcody committed Feb 14, 2014
1 parent fbdf9f0 commit 0b9b03d
Show file tree
Hide file tree
Showing 11 changed files with 893 additions and 2 deletions.
60 changes: 60 additions & 0 deletions framework/include/transfers/MultiAppNodalInterpolationTransfer.h
@@ -0,0 +1,60 @@
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/

#ifndef MULTIAPPNODALINTERPOLATIONTRANSFER_H
#define MULTIAPPNODALINTERPOLATIONTRANSFER_H

#include "MultiAppTransfer.h"

class MooseVariable;
class MultiAppNodalInterpolationTransfer;

template<>
InputParameters validParams<MultiAppNodalInterpolationTransfer>();

/**
* Copy the value to the target domain from the nearest node in the source domain.
*/
class MultiAppNodalInterpolationTransfer :
public MultiAppTransfer
{
public:
MultiAppNodalInterpolationTransfer(const std::string & name, InputParameters parameters);
virtual ~MultiAppNodalInterpolationTransfer() {}

virtual void execute();

protected:
/**
* Return the nearest node to the point p.
* @param mesh The mesh you want to search.
* @param p The point you want to find the nearest node to.
* @param distance This will hold the distance between the returned node and p
* @return The Node closest to point p.
*/
Node * getNearestNode(const Point & p, Real & distance, const MeshBase::const_node_iterator & nodes_begin, const MeshBase::const_node_iterator & nodes_end);

AuxVariableName _to_var_name;
VariableName _from_var_name;

bool _displaced_source_mesh;
bool _displaced_target_mesh;

unsigned int _num_points;
Real _power;
MooseEnum _interp_type;
Real _radius;
};

#endif /* MULTIAPPVARIABLEVALUESAMPLEPOSTPROCESSORTRANSFER_H */
2 changes: 2 additions & 0 deletions framework/src/base/Moose.C
Expand Up @@ -207,6 +207,7 @@
#include "MultiAppMeshFunctionTransfer.h"
#include "MultiAppUserObjectTransfer.h"
#include "MultiAppNearestNodeTransfer.h"
#include "MultiAppNodalInterpolationTransfer.h"


// Actions
Expand Down Expand Up @@ -453,6 +454,7 @@ registerObjects(Factory & factory)
registerTransfer(MultiAppMeshFunctionTransfer);
registerTransfer(MultiAppUserObjectTransfer);
registerTransfer(MultiAppNearestNodeTransfer);
registerTransfer(MultiAppNodalInterpolationTransfer);

registered = true;
}
Expand Down
4 changes: 2 additions & 2 deletions framework/src/transfers/MultiAppNearestNodeTransfer.C
Expand Up @@ -195,6 +195,8 @@ MultiAppNearestNodeTransfer::execute()
}
}

delete serialized_solution;

break;
}
case FROM_MULTIAPP:
Expand Down Expand Up @@ -258,8 +260,6 @@ MultiAppNearestNodeTransfer::execute()
min_apps.resize(n_elems);
}

sleep(libMesh::processor_id() + 1);

for(unsigned int i=0; i<_multi_app->numGlobalApps(); i++)
{
if(!_multi_app->hasLocalApp(i))
Expand Down

0 comments on commit 0b9b03d

Please sign in to comment.