Commit c6f1c05f authored by ghweber's avatar ghweber
Browse files

Added AMR stitch cell operator.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12386 18c085ea-50e0-402c-830e-de6fd14e8384
parent 66b99a24
......@@ -3262,3 +3262,23 @@ avtStructuredDomainBoundaries::GetNeighborPresence(int domain, bool *b,
}
// ****************************************************************************
// Method: avtStructuredDomainBoundaries::GetNeighbors
//
// Purpose:
// Get the domain ids of domain neighbors on each side of the domain.
//
// Programmer: Eduard Deines
// Creation: Dec 15, 2008
//
// ****************************************************************************
vector<Neighbor>
avtStructuredDomainBoundaries::GetNeighbors(int domain)
{
int ntotaldomains = wholeBoundary.size();
if (domain < 0 || domain >= ntotaldomains)
{
EXCEPTION2(BadIndexException, domain, ntotaldomains);
}
return wholeBoundary[domain].neighbors;
}
......@@ -254,6 +254,8 @@ class DATABASE_API avtStructuredDomainBoundaries : public avtDomainBoundaries
void GetNeighborPresence(int domain, bool *hasNeighbor,
std::vector<int> &);
vector<Neighbor> GetNeighbors(int domain);
virtual vector<vtkDataArray*> ExchangeScalar(vector<int> domainNum,
bool isPointData,
vector<vtkDataArray*> scalars);
......
......@@ -85,6 +85,9 @@ typedef enum
// Hank Childs, Fri Aug 3 13:22:40 PDT 2007
// Added ghost node types for coarse/fine boundaries.
//
// Gunther H. Weber, Mon Aug 30 21:27:37 PDT 2010
// Added const qualifiers where possible
//
// ****************************************************************************
class avtGhostData
......@@ -105,13 +108,13 @@ class avtGhostData
u -= bit;
}
static inline bool IsGhostZoneType(unsigned char &u, avtGhostZoneTypes t)
static inline bool IsGhostZoneType(const unsigned char &u, avtGhostZoneTypes t)
{
unsigned char bit = (1 << t);
return (u & bit);
}
static inline bool IsGhostZone(unsigned char &u)
static inline bool IsGhostZone(const unsigned char &u)
{
return (u != 0);
}
......@@ -131,24 +134,24 @@ class avtGhostData
u -= bit;
}
static inline bool IsGhostNodeType(unsigned char &u, avtGhostNodeTypes t)
static inline bool IsGhostNodeType(const unsigned char &u, avtGhostNodeTypes t)
{
unsigned char bit = (1 << t);
return (u & bit);
}
static inline bool IsGhostNode(unsigned char &u)
static inline bool IsGhostNode(const unsigned char &u)
{
return (u != 0);
}
static inline bool UseZoneForInterpolation(unsigned char &u)
static inline bool UseZoneForInterpolation(const unsigned char &u)
{
unsigned char bit = (1 << ZONE_NOT_APPLICABLE_TO_PROBLEM);
return (u & bit);
}
static inline bool RemoveThisZoneBeforeFindingFacelist(unsigned char &u)
static inline bool RemoveThisZoneBeforeFindingFacelist(const unsigned char &u)
{
unsigned char bit1 = (1 << ZONE_EXTERIOR_TO_PROBLEM);
unsigned char bit2 = (1 << ZONE_NOT_APPLICABLE_TO_PROBLEM);
......@@ -156,7 +159,7 @@ class avtGhostData
return (u & bit);
}
static inline bool IsZoneDuplicated(unsigned char &u)
static inline bool IsZoneDuplicated(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
unsigned char bit2 = (1 << ENHANCED_CONNECTIVITY_ZONE);
......@@ -165,7 +168,7 @@ class avtGhostData
return (u & bit);
}
static inline bool IsZoneDuplicatedByCombinationOfZones(unsigned char &u)
static inline bool IsZoneDuplicatedByCombinationOfZones(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
unsigned char bit2 = (1 << ENHANCED_CONNECTIVITY_ZONE);
......@@ -175,7 +178,7 @@ class avtGhostData
return (u & bit);
}
static inline bool IsZoneOnExteriorOfDomain(unsigned char &u)
static inline bool IsZoneOnExteriorOfDomain(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
unsigned char bit2 = (1 << ENHANCED_CONNECTIVITY_ZONE);
......@@ -185,7 +188,7 @@ class avtGhostData
return (u & bit);
}
static inline bool CanZoneBeUsedForStatistics(unsigned char &u)
static inline bool CanZoneBeUsedForStatistics(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_ZONE_INTERNAL_TO_PROBLEM);
unsigned char bit2 = (1 << ENHANCED_CONNECTIVITY_ZONE);
......@@ -195,7 +198,7 @@ class avtGhostData
return (u & bit);
}
static inline bool DiscardFaceIfAllNodesAreOfThisType(unsigned char &u)
static inline bool DiscardFaceIfAllNodesAreOfThisType(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_NODE);
unsigned char bit2 = (1 << NODE_NOT_APPLICABLE_TO_PROBLEM);
......@@ -205,13 +208,13 @@ class avtGhostData
return (u & bit);
}
static inline bool DiscardFaceIfOneNodeIsOfThisType(unsigned char &u)
static inline bool DiscardFaceIfOneNodeIsOfThisType(const unsigned char &u)
{
unsigned char bit = (1 << NODE_NOT_APPLICABLE_TO_PROBLEM);
return (u & bit);
}
static inline bool UseNodeForInterpolation(unsigned char &u)
static inline bool UseNodeForInterpolation(const unsigned char &u)
{
unsigned char bit1 = (1 << DUPLICATED_NODE);
unsigned char bit2 = (1 << NODE_IS_ON_COARSE_SIDE_OF_COARSE_FINE_BOUNDARY);
......
......@@ -12,7 +12,8 @@ SET(VISITHOME /Users/ghweber/devel/visit_3rdparty)
SET(VISITARCH i386-apple-darwin10_gcc-4.2)
SET(VISIT_VERBOSE_MAKEFILE TRUE)
VISIT_OPTION_DEFAULT(CMAKE_INSTALL_PREFIX /usr/local/visit)
VISIT_OPTION_DEFAULT(CMAKE_BUILD_TYPE Release)
VISIT_OPTION_DEFAULT(CMAKE_BUILD_TYPE Debug)
VISIT_OPTION_DEFAULT(VISIT_PYTHON_FILTERS ON)
##
## Specify the location of Mesa.
......
......@@ -145,6 +145,7 @@ avtChomboFileFormat::avtChomboFileFormat(const char *filename,
mappingIs3D = false;
hasParticles = false;
connectParticles = false;
alwaysComputeDomainBoundaries = false;
if (atts != NULL)
{
for (int i = 0; i < atts->GetNumberOfOptions(); ++i)
......@@ -159,6 +160,8 @@ avtChomboFileFormat::avtChomboFileFormat(const char *filename,
checkForMappingFile = atts->GetBool("Check for mapping file and import coordinates if available");
else if (atts->GetName(i) == "Use particle_nid and polymer_id to connect particles")
connectParticles = atts->GetBool("Use particle_nid and polymer_id to connect particles");
else if (atts->GetName(i) == "Always compute domain boundaries (hack for AMR stitch cells)")
alwaysComputeDomainBoundaries = atts->GetBool("Always compute domain boundaries (hack for AMR stitch cells)");
else
debug1 << "Ignoring unknown option " << atts->GetName(i) << endl;
}
......@@ -1286,7 +1289,7 @@ avtChomboFileFormat::CalculateDomainNesting(void)
// Now set up the data structure for patch boundaries. The data
// does all the work ... it just needs to know the extents of each patch.
//
if (!allowedToUseGhosts || !fileContainsGhosts)
if (alwaysComputeDomainBoundaries || !allowedToUseGhosts || !fileContainsGhosts)
{
int t2 = visitTimer->StartTimer();
avtRectilinearDomainBoundaries *rdb
......
......@@ -191,6 +191,7 @@ class avtChomboFileFormat : public avtSTMDFileFormat
int nMaterials;
bool hasParticles;
bool connectParticles;
bool alwaysComputeDomainBoundaries;
std::vector<std::string> particleVarnames;
double dtime;
int cycle;
......
......@@ -72,6 +72,7 @@ GetChomboReadOptions(void)
rv->SetBool("Enable only explicitly defined materials by default", false);
rv->SetBool("Check for mapping file and import coordinates if available", true);
rv->SetBool("Use particle_nid and polymer_id to connect particles", false);
rv->SetBool("Always compute domain boundaries (hack for AMR stitch cells)", false);
return rv;
}
......
......@@ -507,18 +507,14 @@ avtH5PartFileFormat::RegisterDataSelections(
if (useFastBitIndex)
{
#if 0
// FIXME: Need to debug this, or its corresponding branch in
// PerformQuery. Currently using this code leads to an ImproperUse
// exception.
if (selList.size() == 1 &&
std::string(selList[0]->GetType()) ==
std::string("Identifier Data Selection"))
{
// Short cut. There is only one query and it is a list of identifiers.
// Shortcut: There is only one query and it is a list of identifiers.
// Thus, we can skip the step of creating a string and having FastBit
// parse it again.
(*selsApplied)[0] = true;
querySpecified = idListQuery;
avtIdentifierSelection *ids = (avtIdentifierSelection *) *(selList[0]);
queryIdList = ids->GetIdentifiers();
......@@ -526,7 +522,6 @@ avtH5PartFileFormat::RegisterDataSelections(
debug5 << " ids specified." << std::endl;
}
else
#endif
{
for (int i = 0; i < selList.size(); ++i)
{
......@@ -2300,7 +2295,9 @@ void avtH5PartFileFormat::PerformQuery()
{
int t1 = visitTimer->StartTimer();
debug5 << "avtH5PartFileFormat::PerformQuery(): Running query." << std::endl;
#ifdef VERYVERBOSE
std::cout << "avtH5PartFileFormat::PerformQuery(): Running query." << std::endl;
#endif
if (!file)
{
......
<?xml version="1.0"?>
<Plugin name="AMRStitchCell" type="operator" label="AMR Dual Grid and Stitch Cells" version="1.0" enabled="false" mdspecificcode="false" engspecificcode="false" onlyengine="false" noengine="false" iconFile="AMRStitchCell.xpm" category="Geometry">
<Files components="E">
avtAMRStitchCellFilter.C
AMRStitchCellTesselations3D.C
AMRStitchCellTesselations2D.C
</Files>
<Attribute name="AMRStitchCellAttributes" purpose="Attributes for Stitch Cell Operator" persistent="false" keyframe="true" exportAPI="" exportInclude="" codefile="AMRStitchCellAttributes.code">
<Enum name="CreateType">
DualGridAndStitchCells
DualGrid
StitchCells
</Enum>
<Field name="CreateCellsOfType" label="Create cells of type" type="enum" subtype="CreateType">
</Field>
</Attribute>
</Plugin>
/* XPM */
static const char * AMRStitchCell_xpm[] = {
"32 32 127 2",
" c None",
". c #FFFFFF",
"+ c #7B7B7B",
"@ c #0A0A0A",
"# c #B9B9B9",
"$ c #9E9E9E",
"% c #000000",
"& c #959595",
"* c #7F7F7F",
"= c #0B0B0B",
"- c #BFBFBF",
"; c #A2A2A2",
"> c #999999",
", c #3B3B3B",
"' c #050505",
") c #5A5A5A",
"! c #7E7E7E",
"~ c #808080",
"{ c #4C4C4C",
"] c #484848",
"^ c #0C0C0C",
"/ c #010101",
"( c #0D0D0D",
"_ c #BBBBBB",
": c #AFAFAF",
"< c #3E3E3E",
"[ c #BABABA",
"} c #BCBCBC",
"| c #A7A7A7",
"1 c #171717",
"2 c #151515",
"3 c #CCCCCC",
"4 c #B8B8B8",
"5 c #E8E8E8",
"6 c #A4A4A4",
"7 c #1E1E1E",
"8 c #121212",
"9 c #E0E0E0",
"0 c #FEFEFE",
"a c #303030",
"b c #A9A9A9",
"c c #6C6C6C",
"d c #A5A5A5",
"e c #898989",
"f c #E2E2E2",
"g c #111111",
"h c #424242",
"i c #ECECEC",
"j c #0E0E0E",
"k c #6F6F6F",
"l c #F8F8F8",
"m c #D5D5D5",
"n c #232323",
"o c #5C5C5C",
"p c #505050",
"q c #A3A3A3",
"r c #020202",
"s c #F6F6F6",
"t c #323232",
"u c #B5B5B5",
"v c #767676",
"w c #131313",
"x c #C4C4C4",
"y c #404040",
"z c #ABABAB",
"A c #C1C1C1",
"B c #FCFCFC",
"C c #DEDEDE",
"D c #A1A1A1",
"E c #DDDDDD",
"F c #272727",
"G c #C5C5C5",
"H c #101010",
"I c #FDFDFD",
"J c #E4E4E4",
"K c #F2F2F2",
"L c #EEEEEE",
"M c #F5F5F5",
"N c #9B9B9B",
"O c #C7C7C7",
"P c #030303",
"Q c #8F8F8F",
"R c #F7F7F7",
"S c #707070",
"T c #D7D7D7",
"U c #626262",
"V c #EAEAEA",
"W c #C0C0C0",
"X c #686868",
"Y c #1C1C1C",
"Z c #D0D0D0",
"` c #2E2E2E",
" . c #525252",
".. c #F3F3F3",
"+. c #717171",
"@. c #444444",
"#. c #DFDFDF",
"$. c #4D4D4D",
"%. c #B4B4B4",
"&. c #393939",
"*. c #777777",
"=. c #F9F9F9",
"-. c #595959",
";. c #FAFAFA",
">. c #747474",
",. c #CFCFCF",
"'. c #7C7C7C",
"). c #D1D1D1",
"!. c #040404",
"~. c #414141",
"{. c #2A2A2A",
"]. c #F1F1F1",
"^. c #242424",
"/. c #1A1A1A",
"(. c #1D1D1D",
"_. c #1F1F1F",
":. c #8C8C8C",
"<. c #060606",
"[. c #9F9F9F",
"}. c #A8A8A8",
"|. c #C3C3C3",
"1. c #848484",
"2. c #B0B0B0",
"3. c #3C3C3C",
"4. c #3D3D3D",
"5. c #292929",
"6. c #252525",
". . . . . + @ # . . . . . . . . . . . . . . . . . $ % & . . . . ",
". . . . . + @ # . . . . . . . . . . . . . . . . . $ % & . . . . ",
". . . . . + @ # . . . . . . . . . . . . . . . . . $ % & . . . . ",
". . . . . + @ # . . . . . . . . . . . . . . . . . $ % & . . . . ",
". . . . . * = - . . . . . . . . . . . . . . . . . ; % > . . . . ",
"+ + + + * , ' ) ! + + + + + + + + + + + + + + + ~ { % ] ~ + + + ",
"@ @ @ @ ^ % % / ^ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ( % % % ^ @ @ @ ",
"# # # _ : % % < # [ # # # # # # # # # # # # # } | 1 % 2 3 # # # ",
". . . . 4 % % , 5 . . . . . . . . . . . . . . . 6 @ 7 8 9 . . . ",
". . 0 . a % } % b . 0 . . . . . . . . . . . 0 . c % d % e . . . ",
". . . f g h i j k l . . . . . . . . . . . . . m n o . % p . 0 . ",
". 0 . q r & s { t 5 . . . . . . . . . . . 0 . u % ; . v w x . . ",
". . . y % . . z % A 0 . . . . . . . . . . . B ~ % C . } % D . 0 ",
". . E F ] . . G H ! I . . . . . . . . . . . J n ) K 0 L 2 o M . ",
"0 . N % O . . . p P . 0 . . . . . . . . . . C % Q . . R S 2 T . ",
". s U g V 0 0 . e % W . . . . . . . . . . I X Y Z . 0 . z % O . ",
". f ` .... . . W ( +.. 0 . . . . . . . 0 B 7 @.K . . . #.a $.R ",
". %.% } . . . 0 . &.% . . . . . . . . . . C % *.. 0 . . =.-.= s ",
";.>.2 ,.. . . . . '.% 4 . . . . . . . . . -.w ).. . . 0 . > % _ ",
". !.X . . . . . . . P ~.. . . . . . . . . ( {.. . . . . . ].^.$.",
"/.% ( (.Y Y Y Y Y _.% / 7 Y Y Y Y Y Y Y (.% !.7 Y Y Y Y Y /.!.' ",
"r % P !.!.!.!.!.!.!.r % P !.!.!.!.!.!.!.r % r !.!.!.!.!.!.!./ % ",
"* 8 Z . . . . . . . :.<.} . . . . . . . [.% }.. . . . . . . y % ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"*.g |.. . . . . . . 1.' 2.. . . . . . . & % $ . . . . . . . 3.% ",
"* 8 ,.. . . . . . . :.<.} . . . . . . . [.% }.. . . . . . . y % ",
"Y !.` 4.3.3.3.3.3.< _./ 5.< 3.3.3.3.3.< n % 6.< 3.3.3.3.3.y j % ",
"% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % "};
/*****************************************************************************
*
* Copyright (c) 2000 - 2010, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-400124
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
*****************************************************************************/
#include <AMRStitchCellAttributes.h>
#include <DataNode.h>
//
// Enum conversion methods for AMRStitchCellAttributes::CreateType
//
static const char *CreateType_strings[] = {
"Dual grid and stitch cells", "Dual grid", "Stitch cells"
};
std::string
AMRStitchCellAttributes::CreateType_ToString(AMRStitchCellAttributes::CreateType t)
{
int index = int(t);
if(index < 0 || index >= 3) index = 0;
return CreateType_strings[index];
}
std::string
AMRStitchCellAttributes::CreateType_ToString(int t)
{
int index = (t < 0 || t >= 3) ? 0 : t;
return CreateType_strings[index];
}
bool
AMRStitchCellAttributes::CreateType_FromString(const std::string &s, AMRStitchCellAttributes::CreateType &val)
{
val = AMRStitchCellAttributes::DualGridAndStitchCells;
for(int i = 0; i < 3; ++i)
{
if(s == CreateType_strings[i])
{
val = (CreateType)i;
return true;
}
}
return false;
}
// ****************************************************************************
// Method: AMRStitchCellAttributes::AMRStitchCellAttributes
//
// Purpose:
// Init utility for the AMRStitchCellAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
void AMRStitchCellAttributes::Init()
{
AMRStitchCellAttributes::SelectAll();
}
// ****************************************************************************
// Method: AMRStitchCellAttributes::AMRStitchCellAttributes
//
// Purpose:
// Copy utility for the AMRStitchCellAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
void AMRStitchCellAttributes::Copy(const AMRStitchCellAttributes &obj)
{
CreateCellsOfType = obj.CreateCellsOfType;
AMRStitchCellAttributes::SelectAll();
}
// Type map format string
const char *AMRStitchCellAttributes::TypeMapFormatString = AMRSTITCHCELLATTRIBUTES_TMFS;
const AttributeGroup::private_tmfs_t AMRStitchCellAttributes::TmfsStruct = {AMRSTITCHCELLATTRIBUTES_TMFS};
// ****************************************************************************
// Method: AMRStitchCellAttributes::AMRStitchCellAttributes
//
// Purpose:
// Default constructor for the AMRStitchCellAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
AMRStitchCellAttributes::AMRStitchCellAttributes() :
AttributeSubject(AMRStitchCellAttributes::TypeMapFormatString)
{
AMRStitchCellAttributes::Init();
}
// ****************************************************************************
// Method: AMRStitchCellAttributes::AMRStitchCellAttributes
//
// Purpose:
// Constructor for the derived classes of AMRStitchCellAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
AMRStitchCellAttributes::AMRStitchCellAttributes(private_tmfs_t tmfs) :
AttributeSubject(tmfs.tmfs)
{
AMRStitchCellAttributes::Init();
}
// ****************************************************************************
// Method: AMRStitchCellAttributes::AMRStitchCellAttributes
//
// Purpose:
// Copy constructor for the AMRStitchCellAttributes class.
//
// Note: Autogenerated by xml2atts.
//
// Programmer: xml2atts
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
AMRStitchCellAttributes::AMRStitchCellAttributes(const AMRStitchCellAttributes &obj) :
AttributeSubject(AMRStitchCellAttributes::TypeMapFormatString)
{
AMRStitchCellAttributes::Copy(obj);
}